<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Separating data from execution in osCommerce boxes</title>
	<atom:link href="http://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/feed/" rel="self" type="application/rss+xml" />
	<link>https://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/</link>
	<description>lets talk about osCommerce</description>
	<lastBuildDate>Tue, 07 Apr 2020 11:18:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Alexandra</title>
		<link>https://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/#comment-1333</link>
		<dc:creator>Alexandra</dc:creator>
		<pubDate>Mon, 17 Mar 2014 22:39:07 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=640#comment-1333</guid>
		<description>Ok, I figured it out. :)
This part should be below the curly braces
 return $data;
}
         }
      }
	  function execute() {
  global $oscTemplate;</description>
		<content:encoded><![CDATA[<p>Ok, I figured it out. :)<br />
This part should be below the curly braces<br />
 return $data;<br />
}<br />
         }<br />
      }<br />
	  function execute() {<br />
  global $oscTemplate;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexandra</title>
		<link>https://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/#comment-1332</link>
		<dc:creator>Alexandra</dc:creator>
		<pubDate>Mon, 17 Mar 2014 22:00:04 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=640#comment-1332</guid>
		<description>Hi George,
I followed your instructions and was able to separate data from the bm_information box and output the data into another file.
I am trying to separate data now for bm_currencies. I get a Fatal error: Call to undefined method bm_currencies::execute()

This is what I have done. Any idea as to what I have done wrong? Thank you in advance.

function dataF() {
     global $PHP_SELF, $currencies, $HTTP_GET_VARS, $request_type, $currency;
      

      if (substr(basename($PHP_SELF), 0, 8) != &#039;checkout&#039;) {
        if (isset($currencies) &amp;&amp; is_object($currencies) &amp;&amp; (count($currencies-&gt;currencies) &gt; 1)) {
          reset($currencies-&gt;currencies);
          $currencies_array = array();
          while (list($key, $value) = each($currencies-&gt;currencies)) {
            $currencies_array[] = array(&#039;id&#039; =&gt; $key, &#039;text&#039; =&gt; $value[&#039;title&#039;]);
          }

          $hidden_get_variables = &#039;&#039;;
          reset($HTTP_GET_VARS);
          while (list($key, $value) = each($HTTP_GET_VARS)) {
            if ( is_string($value) &amp;&amp; ($key != &#039;currency&#039;) &amp;&amp; ($key != tep_session_name()) &amp;&amp; ($key != &#039;x&#039;) &amp;&amp; ($key != &#039;y&#039;) ) {
              $hidden_get_variables .= tep_draw_hidden_field($key, $value);
            }
          }

          $data = &#039;&#039; .
                  &#039;  &#039; . MODULE_BOXES_CURRENCIES_BOX_TITLE . &#039;&#039; .
                  &#039;  &#039; . 
                  &#039;    &#039; . tep_draw_form(&#039;currencies&#039;, tep_href_link(basename($PHP_SELF), &#039;&#039;, $request_type, false), &#039;get&#039;) .
                  &#039;    &#039; . tep_draw_pull_down_menu(&#039;currency&#039;, $currencies_array, $currency, &#039;onchange=&quot;this.form.submit();&quot; style=&quot;width: 100%&quot;&#039;) . $hidden_get_variables . tep_hide_session_id() . &#039;&#039; .
                  &#039;  &#039; .
                  &#039;&#039;;
				  
				  return $data;
}
          function execute() {
		  global $oscTemplate;
          $oscTemplate-&gt;addBlock($this-&gt;dataF(), $this-&gt;group);
        }
      }
    }</description>
		<content:encoded><![CDATA[<p>Hi George,<br />
I followed your instructions and was able to separate data from the bm_information box and output the data into another file.<br />
I am trying to separate data now for bm_currencies. I get a Fatal error: Call to undefined method bm_currencies::execute()</p>
<p>This is what I have done. Any idea as to what I have done wrong? Thank you in advance.</p>
<p>function dataF() {<br />
     global $PHP_SELF, $currencies, $HTTP_GET_VARS, $request_type, $currency;</p>
<p>      if (substr(basename($PHP_SELF), 0, 8) != &#8216;checkout&#8217;) {<br />
        if (isset($currencies) &amp;&amp; is_object($currencies) &amp;&amp; (count($currencies-&gt;currencies) &gt; 1)) {<br />
          reset($currencies-&gt;currencies);<br />
          $currencies_array = array();<br />
          while (list($key, $value) = each($currencies-&gt;currencies)) {<br />
            $currencies_array[] = array(&#8216;id&#8217; =&gt; $key, &#8216;text&#8217; =&gt; $value['title']);<br />
          }</p>
<p>          $hidden_get_variables = &#8221;;<br />
          reset($HTTP_GET_VARS);<br />
          while (list($key, $value) = each($HTTP_GET_VARS)) {<br />
            if ( is_string($value) &amp;&amp; ($key != &#8216;currency&#8217;) &amp;&amp; ($key != tep_session_name()) &amp;&amp; ($key != &#8216;x&#8217;) &amp;&amp; ($key != &#8216;y&#8217;) ) {<br />
              $hidden_get_variables .= tep_draw_hidden_field($key, $value);<br />
            }<br />
          }</p>
<p>          $data = &#8221; .<br />
                  &#8216;  &#8216; . MODULE_BOXES_CURRENCIES_BOX_TITLE . &#8221; .<br />
                  &#8216;  &#8216; .<br />
                  &#8216;    &#8216; . tep_draw_form(&#8216;currencies&#8217;, tep_href_link(basename($PHP_SELF), &#8221;, $request_type, false), &#8216;get&#8217;) .<br />
                  &#8216;    &#8216; . tep_draw_pull_down_menu(&#8216;currency&#8217;, $currencies_array, $currency, &#8216;onchange=&#8221;this.form.submit();&#8221; style=&#8221;width: 100%&#8221;&#8216;) . $hidden_get_variables . tep_hide_session_id() . &#8221; .<br />
                  &#8216;  &#8216; .<br />
                  &#8221;;</p>
<p>				  return $data;<br />
}<br />
          function execute() {<br />
		  global $oscTemplate;<br />
          $oscTemplate-&gt;addBlock($this-&gt;dataF(), $this-&gt;group);<br />
        }<br />
      }<br />
    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zeeshan</title>
		<link>https://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/#comment-1174</link>
		<dc:creator>Zeeshan</dc:creator>
		<pubDate>Thu, 20 Jun 2013 08:06:44 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=640#comment-1174</guid>
		<description>Very Useful topic.
Thanks for writing this.</description>
		<content:encoded><![CDATA[<p>Very Useful topic.<br />
Thanks for writing this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ludwig Arcache</title>
		<link>https://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/#comment-931</link>
		<dc:creator>Ludwig Arcache</dc:creator>
		<pubDate>Sat, 04 Aug 2012 11:13:44 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=640#comment-931</guid>
		<description>never mind, its done... thank you for the information, sir!!</description>
		<content:encoded><![CDATA[<p>never mind, its done&#8230; thank you for the information, sir!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ludwig Arcache</title>
		<link>https://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/#comment-930</link>
		<dc:creator>Ludwig Arcache</dc:creator>
		<pubDate>Sat, 04 Aug 2012 10:21:27 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=640#comment-930</guid>
		<description>Hello, well thank you for this posting this article. 
i understood very well how to split the execute function. but i want to know:

-should i leave the rest of the code ? (function isEnabled(), function check(), ect...)

-after editing the file (bm_manufacturer_info), should i upload and replace the existing file?</description>
		<content:encoded><![CDATA[<p>Hello, well thank you for this posting this article.<br />
i understood very well how to split the execute function. but i want to know:</p>
<p>-should i leave the rest of the code ? (function isEnabled(), function check(), ect&#8230;)</p>
<p>-after editing the file (bm_manufacturer_info), should i upload and replace the existing file?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick</title>
		<link>https://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/#comment-912</link>
		<dc:creator>Rick</dc:creator>
		<pubDate>Thu, 05 Jul 2012 00:49:15 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=640#comment-912</guid>
		<description>Thank you very much, I understand better now.</description>
		<content:encoded><![CDATA[<p>Thank you very much, I understand better now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: multimixer</title>
		<link>https://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/#comment-911</link>
		<dc:creator>multimixer</dc:creator>
		<pubDate>Wed, 04 Jul 2012 06:19:05 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=640#comment-911</guid>
		<description>There is no difference for box bm_categories.php, its the same process like for any other boxes: You slit the function execute() into 2 functions, the one is dataF() that return the output, the other execute() that add the box to a &quot;group&quot;

Concrete, in bm_categories.php you have


    function execute() {
      global $SID, $oscTemplate;

      if ((USE_CACHE == &#039;true&#039;) &amp;&amp; empty($SID)) {
        $output = tep_cache_categories_box();
      } else {
        $output = $this-&gt;getData();
      }

      $oscTemplate-&gt;addBlock($output, $this-&gt;group);
    }

This you can replace with following


    function dataF() {
      global $SID;

      if ((USE_CACHE == &#039;true&#039;) &amp;&amp; empty($SID)) {
        $output = tep_cache_categories_box();
      } else {
        $output = $this-&gt;getData();
      }
	  
	  return $output;
    }
	
    function execute() {
      global $oscTemplate;

      $oscTemplate-&gt;addBlock($this-&gt;dataF(), $this-&gt;group);
    }</description>
		<content:encoded><![CDATA[<p>There is no difference for box bm_categories.php, its the same process like for any other boxes: You slit the function execute() into 2 functions, the one is dataF() that return the output, the other execute() that add the box to a &#8220;group&#8221;</p>
<p>Concrete, in bm_categories.php you have</p>
<p>    function execute() {<br />
      global $SID, $oscTemplate;</p>
<p>      if ((USE_CACHE == &#8216;true&#8217;) &amp;&amp; empty($SID)) {<br />
        $output = tep_cache_categories_box();<br />
      } else {<br />
        $output = $this-&gt;getData();<br />
      }</p>
<p>      $oscTemplate-&gt;addBlock($output, $this-&gt;group);<br />
    }</p>
<p>This you can replace with following</p>
<p>    function dataF() {<br />
      global $SID;</p>
<p>      if ((USE_CACHE == &#8216;true&#8217;) &amp;&amp; empty($SID)) {<br />
        $output = tep_cache_categories_box();<br />
      } else {<br />
        $output = $this-&gt;getData();<br />
      }</p>
<p>	  return $output;<br />
    }</p>
<p>    function execute() {<br />
      global $oscTemplate;</p>
<p>      $oscTemplate-&gt;addBlock($this-&gt;dataF(), $this-&gt;group);<br />
    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick</title>
		<link>https://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/#comment-910</link>
		<dc:creator>Rick</dc:creator>
		<pubDate>Tue, 03 Jul 2012 21:38:15 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=640#comment-910</guid>
		<description>This all makes great sense and thank you for posting this tutorial.

However I am confused where to split the function in the bm_categories.php file so that I can call it where I would like to?

Thanks for any help in advance.</description>
		<content:encoded><![CDATA[<p>This all makes great sense and thank you for posting this tutorial.</p>
<p>However I am confused where to split the function in the bm_categories.php file so that I can call it where I would like to?</p>
<p>Thanks for any help in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>https://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/#comment-415</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Wed, 04 Jan 2012 11:27:19 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=640#comment-415</guid>
		<description>Yep it was point 1 that solved it, I had the code correct in the data A call, it just didnt show when I posted it.
 
thanks alot</description>
		<content:encoded><![CDATA[<p>Yep it was point 1 that solved it, I had the code correct in the data A call, it just didnt show when I posted it.</p>
<p>thanks alot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: multimixer</title>
		<link>https://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/#comment-407</link>
		<dc:creator>multimixer</dc:creator>
		<pubDate>Tue, 03 Jan 2012 13:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://multimixer.gr/?p=640#comment-407</guid>
		<description>Hi Steve

From a first sight I think that you need to do following to get it working

1) Add all &quot;globals&quot; that you have now in function execute() to function dataA(), except $oscTemplate that should stay in function execute()

2) Add to the page the complete piece of code like it is done for the shopping cart example. Simply &quot;dataA()&quot; says nothing

3) make sure you have the manufacturer info box installed in admin. It has not to be enabled, but it need to be active

Hope it helps</description>
		<content:encoded><![CDATA[<p>Hi Steve</p>
<p>From a first sight I think that you need to do following to get it working</p>
<p>1) Add all &#8220;globals&#8221; that you have now in function execute() to function dataA(), except $oscTemplate that should stay in function execute()</p>
<p>2) Add to the page the complete piece of code like it is done for the shopping cart example. Simply &#8220;dataA()&#8221; says nothing</p>
<p>3) make sure you have the manufacturer info box installed in admin. It has not to be enabled, but it need to be active</p>
<p>Hope it helps</p>
]]></content:encoded>
	</item>
</channel>
</rss>
