<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>multimixer &#187; learn</title>
	<atom:link href="http://multimixer.gr/ecommerce/learn/feed/" rel="self" type="application/rss+xml" />
	<link>http://multimixer.gr</link>
	<description>lets talk about osCommerce</description>
	<lastBuildDate>Fri, 19 Nov 2021 08:23:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to install the osCommerce Hook system</title>
		<link>http://multimixer.gr/30/10/2015/how-to-install-the-oscommerce-hook-system/</link>
		<comments>http://multimixer.gr/30/10/2015/how-to-install-the-oscommerce-hook-system/#comments</comments>
		<pubDate>Fri, 30 Oct 2015 13:58:17 +0000</pubDate>
		<dc:creator>multimixer</dc:creator>
				<category><![CDATA[learn]]></category>
		<category><![CDATA[function]]></category>

		<guid isPermaLink="false">http://multimixer.gr/?p=1453</guid>
		<description><![CDATA[This is a quick explanation about how to install the osCommerce "hook system". It will be standard in the next osCommerce versions, but you can start using it on your existing store of series 2.3.xx right now.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">This is a quick explanation about how to install the osCommerce &#8220;hook system&#8221;. It will be standard in the next osCommerce versions, but you can start using it on your existing store of series 2.3.xx, it make things like adding content or a mini application to a page much easier</p>
<p>Here you go</p>
<h4>1) File catalog/admin/includes/application_top.php</h4>
<p>Add to the bottom of the file, before the last closing ?&gt; following</p>
<pre class="brush:php">// hook
  require(DIR_FS_CATALOG . 'includes/classes/hooks.php');
  $OSCOM_Hooks = new hooks('admin');</pre>
<h4>2) File catalog/includes/application_top.php</h4>
<p>Add to the bottom of the file, before the last closing ?&gt; following</p>
<pre class="brush:php">// hook
  require(DIR_FS_CATALOG . 'includes/classes/hooks.php');
  $OSCOM_Hooks = new hooks('shop');</pre>
<h4>3) Upload file hooks.php</h4>
<p>Create a file named hooks.php, copy paste the code shown below and upload it to location catalog/includes/classes/</p>
<pre class="brush:php">&lt;?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2014 osCommerce

  Released under the GNU General Public License
*/

  class hooks {
    var $_site;
    var $_hooks = array();

    function hooks($site) {
      $this-&gt;_site = basename($site);

      $this-&gt;register('global');
    }

    function register($group) {
      $group = basename($group);

      $directory = DIR_FS_CATALOG . 'includes/hooks/' . $this-&gt;_site . '/' . $group;

      if ( file_exists($directory) ) {
        if ( $dir = @dir($directory) ) {
          while ( $file = $dir-&gt;read() ) {
            if ( !is_dir($directory . '/' . $file) ) {
              if ( substr($file, strrpos($file, '.')) == '.php' ) {
                $code = substr($file, 0, strrpos($file, '.'));
                $class = 'hook_' . $this-&gt;_site . '_' . $group . '_' . $code;

                include($directory . '/' . $file);
                $GLOBALS[$class] = new $class();

                foreach ( get_class_methods($GLOBALS[$class]) as $method ) {
                  if ( substr($method, 0, 7) == 'listen_' ) {
                    $this-&gt;_hooks[$this-&gt;_site][$group][substr($method, 7)][] = $code;
                  }
                }
              }
            }
          }

          $dir-&gt;close();
        }
      }
    }

    function call($group, $action) {
      $result = '';

      foreach ( $this-&gt;_hooks[$this-&gt;_site][$group][$action] as $hook ) {
        $result .= call_user_func(array($GLOBALS['hook_' . $this-&gt;_site . '_' . $group . '_' . $hook], 'listen_' . $action));
      }

      if ( !empty($result) ) {
        return $result;
      }
    }
  }
?&gt;</pre>
<h4>4) Create new folders</h4>
<p>First a folder named /hooks/ within catalog/includes/ Then, create 2 new folders named /shop/ and /admin/ within that new folder /hooks/</p>
<p>Your folder structure should look like this now &#8211; the image is showing only the new folders of course</p>
<p><a href="http://multimixer.gr/wp-content/uploads/2015/10/hook_folders.jpg"><img class="aligncenter size-large wp-image-1462" title="hook_folders" src="http://multimixer.gr/wp-content/uploads/2015/10/hook_folders-540x199.jpg" alt="" width="540" height="199" /></a></p>
<p style="text-align: center;">
<p style="text-align: justify;">That&#8217;s all, now you have the hook system installed and can start creating hooks.</p>
<p style="text-align: justify;">I&#8217;ll post some examples about how to create and use that &#8220;hooks&#8221; soon</p>
]]></content:encoded>
			<wfw:commentRss>http://multimixer.gr/30/10/2015/how-to-install-the-oscommerce-hook-system/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Nice css tooltips for your store</title>
		<link>http://multimixer.gr/11/06/2013/nice-css-tooltips-for-your-store/</link>
		<comments>http://multimixer.gr/11/06/2013/nice-css-tooltips-for-your-store/#comments</comments>
		<pubDate>Tue, 11 Jun 2013 17:43:38 +0000</pubDate>
		<dc:creator>multimixer</dc:creator>
				<category><![CDATA[learn]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://multimixer.gr/?p=1297</guid>
		<description><![CDATA[It is really easy to create nice tooltips in your osCommerce store and to provide additional information to your store visitors. No complicated coding, you'll be done in 2 minutes]]></description>
			<content:encoded><![CDATA[<p>I got several questions recently from people who want to add tooltips to various areas of their osCommerce store. I got to see any kind of possible and impossible approaches to this ! It is true that tooltips are a nice way to provide additional information to your store visitors</p>
<p>Things are really simple, I&#8217;ll post a couple of examples that you can use in your store. There are many ways available of course, I prefer to use plain css</p>
<p>Important to understand is, that a tooltip has an &#8220;anchor&#8221; and a &#8220;content&#8221;. The anchor is the part that stay visible on the page and will trigger the tooltip effect when someone hover over it. The content is the part that stay hidden until someone hover over the anchor</p>
<h2>1 Tooltips in product descriptions</h2>
<p>This is the most simple case since it is plain html. You can add following into your product description, or any other text, like for example a category description, the text in your static pages etc</p>
<pre class="brush:xml">&lt;a href="#" class="tooltip 1"&gt;
  &lt;span class="Tanc"&gt;Tooltip&lt;/span&gt;
  &lt;span class="Tcon"&gt;
      &lt;strong&gt;The title 1&lt;/strong&gt;&lt;br /&gt;
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque a purus et mauris pharetra sagittis ut in ligula. Sed sagittis, lacus sit amet aliquet elementum, dui leo porttitor arcu, ut tempus orci erat eget sem. Proin nec orci sit amet lorem semper gravida sed eu sapien. Nulla commodo odio vitae libero venenatis sit amet suscipit est tempus.
  &lt;/span&gt;
&lt;/a&gt;</pre>
<p>The word &#8220;tooltip&#8221; is the anchor. The text that comes after that and is wrapped into a span of class &#8220;Tcon&#8221; is the tooltip content.</p>
<p>There is no need to have the tooltip wrapped into a &lt;a&gt; element, you can use anything you like, for example a div, like this</p>
<pre class="brush:xml">&lt;div class="tooltip 2"&gt;
  &lt;div class="Tanc"&gt;Tooltip&lt;/div&gt;
  &lt;div class="Tcon"&gt;
      &lt;strong&gt;The title 2&lt;/strong&gt;&lt;br /&gt;
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque a purus et mauris pharetra sagittis ut in ligula. Sed sagittis, lacus sit amet aliquet elementum, dui leo porttitor arcu, ut tempus orci erat eget sem. Proin nec orci sit amet lorem semper gravida sed eu sapien. Nulla commodo odio vitae libero venenatis sit amet suscipit est tempus.
  &lt;/div&gt;
&lt;/div&gt;</pre>
<p>Try it out, copy paste it into your description and enjoy the result :) Don&#8217;t forget to add the css that comes further down this post</p>
<p>There are of course more variations that you can try out, for example</p>
<h4>The tooltip anchor and the tooltip are a link</h4>
<pre class="brush:xml">&lt;a href="http://minitemplatesystem.com" target="_blank" class="tooltip"&gt;
  &lt;span class="Tanc"&gt;Tooltip 3&lt;/span&gt;
  &lt;span class="Tcon"&gt;
      &lt;strong&gt;The title 3&lt;/strong&gt;&lt;br /&gt;
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque a purus et mauris pharetra sagittis ut in ligula. Sed sagittis, lacus sit amet aliquet elementum, dui leo porttitor arcu, ut tempus orci erat eget sem. Proin nec orci sit amet lorem semper gravida sed eu sapien. Nulla commodo odio vitae libero venenatis sit amet suscipit est tempus.
  &lt;/span&gt;
&lt;/a&gt;</pre>
<h4>Only the tooltip anchor is a link</h4>
<pre class="brush:xml">&lt;div class="tooltip"&gt;
  &lt;div class="Tanc"&gt;&lt;a href="http://minitemplatesystem.com" target="_blank"&gt;Tooltip 4&lt;/a&gt;&lt;/div&gt;
  &lt;div class="Tcon"&gt;
      &lt;strong&gt;The title 4&lt;/strong&gt;&lt;br /&gt;
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque a purus et mauris pharetra sagittis ut in ligula. Sed sagittis, lacus sit amet aliquet elementum, dui leo porttitor arcu, ut tempus orci erat eget sem. Proin nec orci sit amet lorem semper gravida sed eu sapien. Nulla commodo odio vitae libero venenatis sit amet suscipit est tempus.
  &lt;/div&gt;
&lt;/div&gt;</pre>
<h4>Add a link within the tooltip</h4>
<pre class="brush:xml">&lt;div class="tooltip"&gt;
  &lt;div class="Tanc"&gt;Tooltip 5&lt;/div&gt;
  &lt;div class="Tcon"&gt;
      &lt;strong&gt;The title 5&lt;/strong&gt;&lt;br /&gt;
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque a purus et mauris pharetra sagittis ut in ligula. Sed sagittis, lacus sit amet aliquet elementum, dui leo porttitor arcu, ut tempus orci erat eget sem. &lt;a href="http://minitemplatesystem.com" target="_blank"&gt;This is a link&lt;/a&gt; Proin nec orci sit amet lorem semper gravida sed eu sapien. Nulla commodo odio vitae libero venenatis sit amet suscipit est tempus.
  &lt;/div&gt;
&lt;/div&gt;</pre>
<h4>Use an image as an anchor, with or without a link.</h4>
<p><span style="font-weight: normal;">The example below is showing the anchor as an image and link</span></p>
<pre class="brush:xml">&lt;div class="tooltip"&gt;
  &lt;div class="Tanc"&gt;&lt;a href="http://minitemplatesystem.com" target="_blank"&gt;&lt;img src="images/info_icon.png" style="vertical-align:middle" /&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;div class="Tcon"&gt;
      &lt;strong&gt;The title 6&lt;/strong&gt;&lt;br /&gt;
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque a purus et mauris pharetra sagittis ut in ligula. Sed sagittis, lacus sit amet aliquet elementum, dui leo porttitor arcu, ut tempus orci erat eget sem. Proin nec orci sit amet lorem semper gravida sed eu sapien. Nulla commodo odio vitae libero venenatis sit amet suscipit est tempus.
  &lt;/div&gt;
&lt;/div&gt;</pre>
<h4>Add an image within the tooltip.</h4>
<p><span style="font-weight: normal;">The image can be a link or not</span></p>
<pre class="brush:xml">&lt;div class="tooltip"&gt;
  &lt;div class="Tanc"&gt;&lt;a href="http://minitemplatesystem.com" target="_blank"&gt;&lt;img src="images/info_icon.png" style="vertical-align:middle" /&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;div class="Tcon"&gt;
      &lt;strong&gt;The title 6&lt;/strong&gt;&lt;br /&gt;
      Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque a purus et mauris pharetra sagittis ut in ligula. Sed sagittis, lacus sit amet aliquet elementum, dui leo porttitor arcu, ut tempus orci erat eget sem. Proin nec orci sit amet lorem semper gravida sed eu sapien. Nulla commodo odio vitae libero venenatis sit amet suscipit est tempus.
  &lt;/div&gt;
&lt;/div&gt;</pre>
<p>There are of course more options available, but I think that you got the idea now.</p>
<p>Next part will be about how to create tooltips within php pages of osCommerce</p>
<h2>The tooltip css</h2>
<p>This is the most important part, this is what makes the tooltip alive. The css is common for all too tips, doesn&#8217;t matter in what part of the store you are using them.</p>
<p>You can paste the following part into your file catalog/stylesheet.css</p>
<blockquote>
<p style="text-align: center;"><span style="color: #ff0000;"><strong>Mini Template System users</strong></span>, please use file catalog/mts/themes/your_theme/style_custom.css to add that and leave the default stylesheet.css and any other css file in peace</p>
</blockquote>
<pre class="brush:css">/* tooltip base: Do not alter */
.tooltip, .tooltip:hover{position:relative;}
.tooltip .Tcon{visibility:hidden;position:absolute;}
.tooltip:hover .Tcon{visibility:visible;}

/* tooltip positioning */
.tooltip .Tcon{
  left:-350px;
  bottom:30px;
}
.tooltip:hover .Tcon{
  left:0;
  bottom:30px;
}

/* tooltip styling */
.tooltip, .tooltip a, .tooltip:hover{text-decoration:none;}
.tooltip .Tcon{
  width:300px;
  padding:20px;
  line-height:16px;
  background:#000;
  opacity: 0.8;
  border:2px solid #FFF;  color:#EEE;
  -moz-border-radius: 2px;
  -webkit-border-radius: 2px;
  border-radius:2px;
  -moz-box-shadow: 0px 0px 8px 4px #666;
  -webkit-box-shadow: 0px 0px 8px 4px #666;
  box-shadow: 0px 0px 8px 4px #666;
}
.tooltip .Tcon, .tooltip:hover .Tcon{
  -webkit-transition: all 0.6s ease;
  -moz-transition:    all 0.6s ease;
  -o-transition:      all 0.6s ease;
}
.tooltip .Tcon strong{line-height:30px; font-size:16px;}
.tooltip .Tcon a{text-decoration:underline}

/* anchor styling */
.tooltip .Tanc{cursor:pointer;}</pre>
<p>You can see that the css rules are split into groups about styling and positioning.  You could merge some of them, but for starting you can leave them like this, it&#8217;s easier to understand what is going on</p>
<p>You can change anything you want of course, important is to leave the first set of rules (tooltip base) in peace</p>
<p>If you want an example of how such a tooltip look like, you can hover over the text &#8220;support this blog&#8221; that comes right after, or over the twitter icon in the footer</p>
<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://multimixer.gr/11/06/2013/nice-css-tooltips-for-your-store/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Make all your buttons primary</title>
		<link>http://multimixer.gr/02/11/2012/make-all-your-buttons-primary/</link>
		<comments>http://multimixer.gr/02/11/2012/make-all-your-buttons-primary/#comments</comments>
		<pubDate>Fri, 02 Nov 2012 09:59:29 +0000</pubDate>
		<dc:creator>multimixer</dc:creator>
				<category><![CDATA[learn]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://multimixer.gr/?p=1267</guid>
		<description><![CDATA[An in-depth explanation to help you understand the primary/secondary buttons appearance in osCommerce and a quick tip to make them all look same]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">osCommerce use 2 types of buttons regarding display: &#8220;Primary buttons and secondary buttons&#8221;. The difference is, that primary buttons appear &#8220;stronger&#8221; on the screen, while secondary are like faded out</p>
<p style="text-align: justify;">This has a good reason, the main action use a &#8220;primary&#8221; button, while any others use a &#8220;secondary&#8221; one. For example, on the product information page you can see that the &#8220;add to cart&#8221; button is a primary one &#8211; this is the main and most important button on that page &#8211; while the reviews button is a secondary one</p>
<div style="border-bottom: 1px solid #d0d0d0; padding-bottom: 5px; margin-bottom: 5px;"><a href="http://multimixer.gr/wp-content/uploads/2012/11/default_1.jpg"><img class="aligncenter size-large wp-image-1269" title="Primary secondary button on default template" src="http://multimixer.gr/wp-content/uploads/2012/11/default_1-540x68.jpg" alt="Primary secondary button on default template" width="540" height="68" /></a></div>
<div style="border-bottom: 1px solid #d0d0d0; padding-bottom: 5px; margin-bottom: 5px;"><a href="http://multimixer.gr/wp-content/uploads/2012/11/default_2.jpg"><img class="aligncenter size-large wp-image-1270" title="primary secondary buttons on MTS template with ui lightness theme" src="http://multimixer.gr/wp-content/uploads/2012/11/default_2-540x92.jpg" alt="primary secondary buttons on MTS template with ui lightness them" width="540" height="92" /></a></div>
<div><a href="http://multimixer.gr/wp-content/uploads/2012/11/default_3.jpg"><img class="aligncenter size-large wp-image-1271" title="primary secondary buttons on MTS template with flickr theme" src="http://multimixer.gr/wp-content/uploads/2012/11/default_3-540x108.jpg" alt="primary secondary buttons on MTS template with flickr theme" width="540" height="108" /></a></div>
<p style="text-align: justify;">How it comes that there are 2 types of buttons? A short explanation:</p>
<h3>a) The file</h3>
<p style="text-align: justify;">Each button is created in the file it has to appear, so, in this example, we can see in file catalog/product_info.php</p>
<p style="text-align: justify;">The &#8220;add to cart&#8221; button</p>
<pre class="brush:xml">tep_draw_button(IMAGE_BUTTON_IN_CART, 'cart', null, 'primary');</pre>
<p>The &#8220;reviews&#8221; button</p>
<pre class="brush:xml">tep_draw_button(IMAGE_BUTTON_REVIEWS . (($reviews['count'] &gt; 0) ? ' (' . $reviews['count'] . ')' : ''), 'comment', tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()));</pre>
<p style="text-align: justify;">Beside any other difference, that are not part of this topic, you can see that the &#8220;add to cart&#8221; button has the parameter &#8220;primary&#8221; while the &#8220;reviews&#8221; button, don&#8217;t have any parameter regarding this</p>
<p style="text-align: justify;">Here is an other button example that appear as a secondary button on the website, maybe more clear, because of less other parameters</p>
<p>A primary button</p>
<pre class="brush:xml">tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&amp;products_id=' . $product['id'] ) , 'primary')</pre>
<p>A secondary button</p>
<pre class="brush:xml">tep_draw_button(IMAGE_BUTTON_DETAILS, 'info', tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product['id']))</pre>
<p style="text-align: justify;">That are the &#8220;details&#8221; and &#8220;buy now&#8221; buttons that appear like this on a website</p>
<p style="text-align: justify;"><a href="http://multimixer.gr/wp-content/uploads/2012/11/default_4.jpg"><img class="aligncenter size-large wp-image-1283" title="Buttons of mini template system's front page module" src="http://multimixer.gr/wp-content/uploads/2012/11/default_4-540x177.jpg" alt="Buttons of mini template system's front page module" width="540" height="177" /></a>You can see that again, the &#8220;buy now&#8221; button has the parameter &#8220;primary&#8221; while the &#8220;details&#8221; has no parameter in this direction at all</p>
<p style="text-align: justify;">Where do this parameters go to, and how do they affect the display?</p>
<h3>b) the function</h3>
<p style="text-align: justify;">All buttons are created using the function &#8220;tep_draw_button(parameters)&#8221; This function is in file catalog/includes/functions/html_output.php</p>
<pre class="brush:xml">  function tep_draw_button($title = null, $icon = null, $link = null, $priority = null, $params = null) {</pre>
<p style="text-align: justify;">You can see that the 4th parameter the function accept is $priority, this is where the &#8220;primary&#8221; parameter of the above buttons goes to</p>
<p>The function handles this parameter as follows</p>
<pre class="brush:xml">    if (!isset($priority)) {
      $priority = 'secondary';
    }</pre>
<p style="text-align: justify;">What does this mean? It say &#8221; if there is no $priority set, then set $priority to be secondary&#8221;</p>
<p style="text-align: justify;">So, you see why buttons with no priority parameter set appear as secondary buttons.</p>
<p style="text-align: justify;">In a next step, the function adds the $priority to the button html</p>
<p style="text-align: justify;">
<pre class="brush:xml">    $button .= ').addClass("ui-priority-' . $priority . '").parent().removeClass("tdbLink");&lt;/script&gt;';</pre>
<p style="text-align: justify;">In simple words, it add the class &#8220;ui-priority-primary or ui-priority-secondary to the jQuery function that goes with each button, depending on how $priority was defined before. In our html the button appear then having one of the two priorities</p>
<p>Next thing that happen is plain and simple css</p>
<h3>c) the css</h3>
<p>In the css file of each UI theme, there are rules regarding the priority, that look like this</p>
<pre class="brush:css">.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary,  .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }</pre>
<p>The above example is from jQueryUI version 1.8.22, but there are no big differences (if any) to the other versions</p>
<p>This rules say plain and simple that anything with priority &#8220;primary&#8221; has to have bold fonts, while anything with priority &#8220;secondary&#8221; has to have normal fonts and a opacity of 0.7</p>
<p>That&#8217;s all that happen with the buttons, there is no mystery, in case you suspected any :)</p>
<h2>How to change the buttons</h2>
<p>Now, after we know this all, what can we do if we want all of our buttons to look the same?</p>
<p><strong><span style="color: #000000;">Not good options are:</span></strong></p>
<p>- Modify all osCommerce files that have a button and add a priority of &#8220;primary&#8221; to each button. A huge task that will cause the same amount of work if you want to change anything</p>
<p>- Modify the tep_draw_button() function to set a priority of &#8220;primary&#8221; by default, instead of &#8220;secondary&#8221; as it does now. Not good, because you&#8217;ll loose the flexibility you have now, your change will not affect any buttons that have a priority of secondary set explicit and finally you&#8217;ll modify a core osCommerce file, this is never a very good idea</p>
<p>- modify manually the css file of your jQueryUI theme and change the rules for the 2 cases</p>
<p>Unfortunately  the above options (and some other) are often suggested in the forum, anyway.</p>
<p style="text-align: justify;"><strong><span style="color: #000000;">The good option is</span></strong> to do everything in css by adding new rules to your stylesheet.css file. This is very simple to do</p>
<p style="text-align: justify;">- open your file catalog/stylesheet.css</p>
<p style="text-align: justify;">- copy paste the original jQueryUI css rules into it</p>
<pre class="brush:css">.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary,  .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }</pre>
<p style="text-align: justify;">- change them to anything you want. For example if you want both buttons to be same, you can use he rules as follows</p>
<pre class="brush:applescript">.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: normal; }
.ui-priority-secondary, .ui-widget-content .ui-priority-secondary,  .ui-widget-header .ui-priority-secondary { opacity: 1; filter:Alpha(Opacity=100); }</pre>
<blockquote>
<p style="text-align: center;">Mini Template System users, please use file <strong><span style="color: #ff0000;">catalog/mts/themes/your_theme/style_custom.css</span></strong> to add that and leave the default stylesheet.css and any other css file in peace</p>
</blockquote>
<p>That&#8217;s all people, enjoy</p>
<p style="text-align: justify;">
]]></content:encoded>
			<wfw:commentRss>http://multimixer.gr/02/11/2012/make-all-your-buttons-primary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Streamline your checkout process in osCommerce</title>
		<link>http://multimixer.gr/23/06/2012/streamline-your-checkout-process-in-oscommerce/</link>
		<comments>http://multimixer.gr/23/06/2012/streamline-your-checkout-process-in-oscommerce/#comments</comments>
		<pubDate>Sat, 23 Jun 2012 17:16:05 +0000</pubDate>
		<dc:creator>multimixer</dc:creator>
				<category><![CDATA[learn]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[osCommerce v2.3]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://multimixer.gr/?p=1254</guid>
		<description><![CDATA[This is a quick tip that will help you to skip the checkout shipping and checkout payment pages if you have only one shipping or payment option enabled. Complete code to copy paste]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">There are many cases where the visitor get just one shipping or payment option presented. This can be the case if you have just one shipping or payment module enabled or it can be that you have conditions for your shipping and payment ways: In this case a visitor from UK will get just one shipping or payment option while a visitor from the USA 3 of them.</p>
<p style="text-align: justify;">In any case, it makes no sense to let people navigate through pages where there is nothing to select and no information presented. All your visitors can do in such a case is to press the &#8220;continue&#8221; button, and this is something the system can do automatically</p>
<p style="text-align: justify;">In this way, you can cut of 2 of the 4 checkout steps and that&#8217;s a huge improvement. People will be transfered directly from the shopping cart page to the checkout confirmation page. Please note, that it case you enable a second shipping or payment module, the page will appear again by it self</p>
<p style="text-align: justify;">The tip presented here comes from the &#8220;tip and trick&#8221; section of the <a title="osCommerce tip" href="http://forums.oscommerce.com/topic/193155-skip-checkout-shipping-and-checkout-payment/page__view__findpost__p__790043" target="_blank">osCommerce forum</a>, to the topic there I <a title="multimixer tip" href="http://forums.oscommerce.com/topic/193155-skip-checkout-shipping-and-checkout-payment/page__view__findpost__p__1495135" target="_blank">contributed</a> my self, unfortunately it&#8217;s getting lost in the crowd and I thing it&#8217;s worth to have it clearly presented. Like each forum post, it evolved over the time.</p>
<p style="text-align: justify;">Lets start, things are easy, you&#8217;ll need just to copy paste</p>
<p>The files you&#8217;ll be working on are</p>
<ul>
<li>catalog/checkout_shipping.php</li>
<li>catalog/checkout_payment.php</li>
</ul>
<p style="text-align: justify;">Make a copy of that files and store them somewhere on your computer, in that way you&#8217;ll be able to get back to the previous status in case you mess up</p>
<h3>1. checkout_shipping.php</h3>
<p>open the file and find following line, it&#8217;s number 97 in a default file</p>
<pre class="brush:xml">// process the selected shipping method</pre>
<p>Add just before following</p>
<pre class="brush:applescript">// bypass if only 1 shipping method available or free shipping
if ( (tep_count_shipping_modules() &lt;= 1) || ($free_shipping == true) ) {
if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
if ($free_shipping) {
$quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
$quote[0]['methods'][0]['cost'] = '0';
} else {
$quote = $shipping_modules-&gt;quote($method, $module);
}
$shipping = array('id' =&gt; $shipping,
'title' =&gt; (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
'cost' =&gt; $quote[0]['methods'][0]['cost']);
$shipping = $shipping_modules-&gt;cheapest();
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}</pre>
<p>Done !</p>
<h3>2. checkout_payment.php</h3>
<p>Open the file and find following line, it&#8217;s number 81 in a default file</p>
<pre class="brush:xml">  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT);</pre>
<p>Add just before</p>
<pre class="brush:applescript">// skip if only 1 payment method available
$payment_module_selections = $payment_modules-&gt;selection();
if (sizeof($payment_module_selections) &lt;= 1) {
  if (!tep_session_is_registered('payment')) tep_session_register('payment');
  $payment = $payment_module_selections[0]['id'];
  tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
}</pre>
<p>Done !</p>
<blockquote><p><span style="font-weight: normal;"><strong>Mini template system users</strong></span><span style="font-weight: normal;">, you can do exactly the same if your want, your files are identical to the default osCommerce version</span></p></blockquote>
<p>Thats all people, try it out</p>
<p>All credits to the original posters at the osCommerce forum</p>
]]></content:encoded>
			<wfw:commentRss>http://multimixer.gr/23/06/2012/streamline-your-checkout-process-in-oscommerce/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Add more buttons to your osCommerce header</title>
		<link>http://multimixer.gr/19/06/2012/add-more-buttons-to-your-oscommerce-header/</link>
		<comments>http://multimixer.gr/19/06/2012/add-more-buttons-to-your-oscommerce-header/#comments</comments>
		<pubDate>Tue, 19 Jun 2012 13:15:05 +0000</pubDate>
		<dc:creator>multimixer</dc:creator>
				<category><![CDATA[learn]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[osCommerce v2.3]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://multimixer.gr/?p=1220</guid>
		<description><![CDATA[Read here how to add more buttons to your stores header, just beside the existing "cart", "checkout" and "my account" buttons. It's very easy to do, try it out]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">
<p style="text-align: justify;">Even this question has been asked &#8211; and answered &#8211; really many times in the osCommerce forum, it still seem to be a hard thing to do for many people. I recently got an email from a osCommerce user asking exactly this: How to add more buttons to my header, just beside the existing &#8220;cart&#8221;, &#8220;checkout&#8221; and &#8220;my account&#8221; buttons.</p>
<p style="text-align: justify;">This is how the section look by default</p>
<p style="text-align: justify;"><a href="http://multimixer.gr/wp-content/uploads/2012/06/contact_us_button_header0.jpg"><img class="aligncenter size-large wp-image-1238" title="The default osCommerce header with 3 buttons" src="http://multimixer.gr/wp-content/uploads/2012/06/contact_us_button_header0-540x77.jpg" alt="The default osCommerce header with 3 buttons" width="540" height="77" /></a></p>
<p style="text-align: justify;">That is really very easy to do, lets start. The file to work on is catalog/includes/header.php. Make a copy of it for backup reasons and open the file (not the copy)</p>
<h3>Step 1: Locate the existing buttons</h3>
<p>They are very easy to find, very close to the top of the file you&#8217;ll see following:</p>
<pre class="brush:php; first-line: 21">  &lt;div id="headerShortcuts"&gt;
&lt;?php
  echo tep_draw_button(HEADER_TITLE_CART_CONTENTS . ($cart-&gt;count_contents() &gt; 0 ? ' (' . $cart-&gt;count_contents() . ')' : ''), 'cart', tep_href_link(FILENAME_SHOPPING_CART)) .
       tep_draw_button(HEADER_TITLE_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) .
       tep_draw_button(HEADER_TITLE_MY_ACCOUNT, 'person', tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

  if (tep_session_is_registered('customer_id')) {
    echo tep_draw_button(HEADER_TITLE_LOGOFF, null, tep_href_link(FILENAME_LOGOFF, '', 'SSL'));
  }
?&gt;
  &lt;/div&gt;</pre>
<p style="text-align: justify;">Each of that lines is a button. Well, the term &#8220;button&#8221; is maybe to exactly correct, since they don&#8217;t submit anything. In fact <strong>they are just links looking like buttons</strong>. This happens because of the &#8220;tep_draw_button()&#8221; function of osCommerce, that take a plain link and make it look like a button</p>
<h3>Step 2: Create a new button</h3>
<p>Each button need at least following information</p>
<ul>
<li><strong>a link</strong>: To where should your button link to? It can be any page of your store, like eg &#8220;contact us&#8221;, any product, any category</li>
<li><strong>a text</strong>: There should be a text, so that people know what the button is for</li>
<li><strong>an icon</strong>: This is the small symbol on the left of your button</li>
</ul>
<p>Here is a single button</p>
<pre class="brush:php">tep_draw_button(HEADER_TITLE_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'))</pre>
<p>In plain english we could say</p>
<blockquote><p><strong>tep_draw_button(button text, button icon, button link)</strong></p></blockquote>
<p style="text-align: justify;">As an example, lets create a button to the contact us page. So we want to link to &#8220;contact_us.php&#8221;, we want the button text to say &#8220;contact us&#8221; and the icon to be an envelope</p>
<h4>2.1 The button link</h4>
<p>This is this part of the button code</p>
<pre class="brush:applescript">tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')</pre>
<p style="text-align: justify;">This is the regular tep_href_link() function used all over osCommerce. For the &#8220;contact_us.php&#8221; page, the link would look like this</p>
<pre class="brush:applescript">tep_href_link(FILENAME_CONTACT_US)</pre>
<p style="text-align: justify;">We don&#8217;t need the SSL part of the link, since contact us is a regular page not SSL protected. As you can see, we did use the constant (FILENAME_CONTACT_US) instead of just typing in the filename (contact_us.php). This has no difference to the link functionality, but it&#8217;s highly recommended to keep this practice. You can find a list of all files and their constants in file catalog/includes/filenames.php</p>
<h4>2.2 The button text</h4>
<p>This is following part of the button code that we use as a reference:</p>
<p>HEADER_TITLE_CHECKOUT</p>
<p style="text-align: justify;">As you can see there is again a &#8220;constant&#8221; used, instead of just typing in the text. This way the store can be multilingual. Even you use just one language in your store right now, it&#8217;s better to keep it that way instead of typing in plain text. Additional benefits are that all text is in one file and that you can change it easily there. Finally, the same text can be reused anywhere in the store</p>
<p>We will use</p>
<p>IMAGE_BUTTON_CONTACT_US</p>
<p style="text-align: justify;">The file to define the text is catalog/includes/languages/english.php (or german.php, italian.php, swahili.php etc). Here you can add to anywhere (maybe after all other defines that are like IMAGE_BUTTON_XY)</p>
<pre class="brush:applescript">define('IMAGE_BUTTON_CONTACT_US', 'Contact us');</pre>
<p>What we did here is, to define, set, declare, that constant IMAGE_BUTTON_CONTACT_US be &#8220;contact us&#8221;in English. Same you need to do for all languages of your store and translate accordingly</p>
<h4>2.3 The button icon</h4>
<p style="text-align: justify;">Here we cant use anything we want, but need to pick an icon from the existing icon set of jQuery UI. There is a large selection available, you can see it on the <a title="Themeroller" href="http://jqueryui.com/themeroller/" target="_blank">themeroller</a> website. Going to the bottom of the site, you&#8217;ll see a listing of all available icons. Hover over each and you&#8217;ll see its name.</p>
<p>For the contact us button, where we want the envelope icon and got the text &#8220;ui-icon-mail-closed&#8221;, so the text I need for the button is &#8220;mail -closed&#8221;</p>
<h4>2.4 Putt it together</h4>
<p>Now after we have the button link, button text and button icon, lets put our new button together again. Here it is</p>
<pre class="brush:php">tep_draw_button(IMAGE_BUTTON_CONTACT_US, 'mail-closed', tep_href_link(FILENAME_CONTACT_US))</pre>
<h3>3 Place the button to the header</h3>
<p>You can place that button to anywhere you like. Now, since we said we want it in the header, lets add it to there.</p>
<pre class="brush:php">  echo tep_draw_button(HEADER_TITLE_CART_CONTENTS . ($cart-&gt;count_contents() &gt; 0 ? ' (' . $cart-&gt;count_contents() . ')' : ''), 'cart', tep_href_link(FILENAME_SHOPPING_CART)) .
       tep_draw_button(HEADER_TITLE_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) .
       tep_draw_button(HEADER_TITLE_MY_ACCOUNT, 'person', tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

  echo tep_draw_button(IMAGE_BUTTON_CONTACT_US, 'mail-closed', tep_href_link(FILENAME_CONTACT_US));

  if (tep_session_is_registered('customer_id')) {
    echo tep_draw_button(HEADER_TITLE_LOGOFF, null, tep_href_link(FILENAME_LOGOFF, '', 'SSL'));
  }</pre>
<p style="text-align: justify;">If you want to place the button between the existing &#8220;cart&#8221; and &#8220;checkout&#8221; buttons it would look like this</p>
<pre class="brush:php">  echo tep_draw_button(HEADER_TITLE_CART_CONTENTS . ($cart-&gt;count_contents() &gt; 0 ? ' (' . $cart-&gt;count_contents() . ')' : ''), 'cart', tep_href_link(FILENAME_SHOPPING_CART)) .
       tep_draw_button(HEADER_TITLE_CHECKOUT, 'triangle-1-e', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) .
       tep_draw_button(IMAGE_BUTTON_CONTACT_US, 'mail-closed', tep_href_link(FILENAME_CONTACT_US)) .
       tep_draw_button(HEADER_TITLE_MY_ACCOUNT, 'person', tep_href_link(FILENAME_ACCOUNT, '', 'SSL'));

  if (tep_session_is_registered('customer_id')) {
    echo tep_draw_button(HEADER_TITLE_LOGOFF, null, tep_href_link(FILENAME_LOGOFF, '', 'SSL'));
  }</pre>
<p>This is how things look like so far</p>
<p><a href="http://multimixer.gr/wp-content/uploads/2012/06/contact_us_button_header1.jpg"><img class="aligncenter size-large wp-image-1245" title="osCommerce header with contact us button" src="http://multimixer.gr/wp-content/uploads/2012/06/contact_us_button_header1-540x76.jpg" alt="osCommerce header with contact us button" width="540" height="76" /></a></p>
<h3>4 Some more button examples</h3>
<p>A nice thing to have would be a login button in the header that would change to logoff in case the customer is already logged in</p>
<p>Here you can change this</p>
<pre class="brush:php">  if (tep_session_is_registered('customer_id')) {
    echo tep_draw_button(HEADER_TITLE_LOGOFF, null, tep_href_link(FILENAME_LOGOFF, '', 'SSL'));
  }</pre>
<p>to this</p>
<pre class="brush:php">  if (tep_session_is_registered('customer_id')) {
    echo tep_draw_button(HEADER_TITLE_LOGOFF, null, tep_href_link(FILENAME_LOGOFF, '', 'SSL'));
  } else {
    echo tep_draw_button(IMAGE_BUTTON_LOGIN, 'key', tep_href_link(FILENAME_LOGIN, '', 'SSL'));
  }</pre>
<p>and it will to exactly this</p>
<p style="text-align: justify;">An other thing you can do, is to add a link to an external website, for example your blog. Here we don&#8217;t need to use the tep_href_link() function to create the link since the session will be lost anyway. What we want here is, to make the link target open in a new browser window and to be &#8220;stronger&#8221; than the others</p>
<p style="text-align: justify;">Here is the button:</p>
<p style="text-align: justify;">
<pre class="brush:applescript"> echo tep_draw_button('My blog', 'person', 'http://multimixer.gr', 'primary', array('newwindow'=&gt;'newwindow'));</pre>
<p>You can check the parameters that the tep_draw_button() function accept in file catalog/includes/functions/html_output.php</p>
<p>Here is how our header look now with all that buttons</p>
<p><a href="http://multimixer.gr/wp-content/uploads/2012/06/contact_us_button_header3.jpg"><img class="aligncenter size-large wp-image-1240" title="osCommerce header with many buttons" src="http://multimixer.gr/wp-content/uploads/2012/06/contact_us_button_header3-540x77.jpg" alt="osCommerce header with many buttons" width="540" height="77" /></a></p>
<p style="text-align: justify;">While you are doing in the header section, you could take a look about other things you can do to make it look nicer<a title="Nice header for osCommerce store" href="http://multimixer.gr/25/11/2010/make-a-nice-header-for-your-store-in-oscommerce-version-2-3-1/">: Make a nice header for your osCommerce store</a></p>
<p style="text-align: justify;">Mini template system users: Please don&#8217;t do anything of all this, it&#8217;s not necessary. You can use <a title="Create new links in osCommerce" href="http://minitemplatesystem.com/usage/link-manager-oscommerce/#b" target="_blank">link manager</a> to create links and add them to any <a title="Link manager osCommerce" href="http://minitemplatesystem.com/usage/link-manager-oscommerce/#gb" target="_blank">link groups</a> and <a title="Create menu osCommerce" href="http://minitemplatesystem.com/usage/menu-maker-horizontal-drop-down-navigation-menu/" target="_blank">menu maker</a> to place them either to your main navigation or to your link boxes. There is no need to modify any file</p>
]]></content:encoded>
			<wfw:commentRss>http://multimixer.gr/19/06/2012/add-more-buttons-to-your-oscommerce-header/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Styling the breadcrumb area in osCommerce</title>
		<link>http://multimixer.gr/13/02/2012/styling-the-breadcrumb-in-oscommerce/</link>
		<comments>http://multimixer.gr/13/02/2012/styling-the-breadcrumb-in-oscommerce/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 10:37:45 +0000</pubDate>
		<dc:creator>multimixer</dc:creator>
				<category><![CDATA[learn]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://multimixer.gr/?p=1156</guid>
		<description><![CDATA[The so called "breadcrumb trail" is the part on top of your osCommerce store showing the path to the actual location of the store the visitor is in. Read here how to style it by just adding a couple of lines to your stylesheet.css file]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><a href="http://multimixer.gr/wp-content/uploads/2012/02/bread.jpg"><img class="aligncenter size-large wp-image-1178" title="Styling the breadcrumb of your osCommerce store" src="http://multimixer.gr/wp-content/uploads/2012/02/bread-540x432.jpg" alt="The so called &quot;breadcrumb trail&quot; is the part on top of your osCommerce store showing the path to the actual location of the store the visitor is in." width="540" height="432" /></a></p>
<p style="text-align: justify;">The so called &#8220;breadcrumb trail&#8221; is the part on top of your osCommerce store showing the path to the actual location of the store the visitor is in. Reading the many questions in the osCommerce forum about how to style this area I think it&#8217;s worth to give a quick overview about how to do this.</p>
<p>Nothing of all this is necessary, things are really simple.</p>
<p>This is how the area looks like by default</p>
<p><a href="http://multimixer.gr/wp-content/uploads/2012/02/breadcrumb_default1.jpg"><img class="aligncenter size-large wp-image-1160" title="The default breadcrumb look in osCommerce" src="http://multimixer.gr/wp-content/uploads/2012/02/breadcrumb_default1-540x75.jpg" alt="The default breadcrumb look in osCommerc" width="540" height="75" /></a></p>
<p>This is generated in file catalog/includes/header.php, the code looks like this</p>
<pre class="brush:xml; first-line:38">&lt;div class="grid_24 ui-widget infoBoxContainer"&gt;
  &lt;div class="ui-widget-header infoBoxHeading"&gt;&lt;?php echo '  ' . $breadcrumb-&gt;trail(' » '); ?&gt;&lt;/div&gt;
&lt;/div&gt;</pre>
<p style="text-align: justify;">There is nothing to do at this file, you can close it right away, just please notice the css classes used to wrap the beadrcrumb. They are &#8220;grid_24 ui-widget infoBoxContainer&#8221; in the outer level and &#8220;ui-widget-header infoBoxHeading&#8221; in the inner level. You can close the file now, we are not going to modify it in any way.</p>
<p style="text-align: justify;">Lets start doing something</p>
<h3>1 Change the ui-widget theme</h3>
<p style="text-align: justify;">First thing we can do for the look of our breadcrumb is to <a title="Change the ui theme of your osCommerce store" href="http://multimixer.gr/02/12/2010/how-to-get-a-new-theme-for-your-oscommerce-store/">change the ui theme of the store</a>. Well yes, this will change the overall look, but it&#8217;s also a good idea to get the general look as close as possible to what you like, before starting with the details.</p>
<p>This is how it would look like using ui theme &#8220;lightness&#8221;</p>
<p><a href="http://multimixer.gr/wp-content/uploads/2012/02/breadcrumb_lightness.jpg"><img class="aligncenter size-large wp-image-1167" title="osCommerce breadcrumb using ui-lightness theme" src="http://multimixer.gr/wp-content/uploads/2012/02/breadcrumb_lightness-540x78.jpg" alt="osCommerce breadcrumb using ui-lightness theme" width="540" height="78" /></a></p>
<p style="text-align: justify;">Why did the look change? Because the whole section is wrapped into the ui classes &#8220;ui-widget&#8221; and &#8220;ui-widget-header&#8221; as we just saw above</p>
<h3>2. Individual styling</h3>
<p style="text-align: justify;">All actions will be done in one and olny file: catalog/stylesheet.css I would suggest to add any code posted below to the bottom of this file</p>
<p style="text-align: justify;">First lets see how to target this section in our css file, in other words, how to make our css file to know that we mean this and only this section of our store. If we are not specific enough, any rules added will affect other areas too (like the <a title="Styling the information boxes with css and jQuery" href="http://multimixer.gr/28/09/2011/jquery-tips-rounded-corners-for-oscommerce-boxes/">styling of the information boxes</a>) and that&#8217;s something we don&#8217;t want to do right now</p>
<p>The selector we are going to use as a &#8220;prefix&#8221; for all other css classes is <strong>#header+div </strong>.</p>
<p style="text-align: justify;">What does this mean? In plain text this say to the css file that we mean <em>the div that comes after the element that has an id of &#8220;header&#8221;</em>. There is only one in the whole store, the breadcrumb, there is no other.</p>
<p>After we know this, we can easily start adding some rules</p>
<pre class="brush:css">/* START breadcrumb styling */
#header+div .ui-widget-header{
background:none;background:#f00; /* the background color */
border:5px solid #00ff00; /* the border around */
color:#000; /* the text color */
font-weight:400; /* use a normal font weight */
}

#header+div .ui-widget-header a{
color:#000; /* the text color of the links*/
}

#header+div .infoBoxHeading{
font-size:14px; /* the font size */
padding:10px 2px; /* padding top/bottom and left/right*/
}

#header+div .infoBoxHeading{
font-family:Verdana, Arial, Helvetica, sans-serif; /* the fonts to be used */
}
/* END breadcrumb styling */</pre>
<p>Lets take a look now how it looks after this styling actions</p>
<p><a href="http://multimixer.gr/wp-content/uploads/2012/02/breadcrumb_custom.jpg"><img class="aligncenter size-large wp-image-1174" title="The breadcrumb after our custom styling" src="http://multimixer.gr/wp-content/uploads/2012/02/breadcrumb_custom-540x93.jpg" alt="The breadcrumb after our custom styling" width="540" height="93" /></a></p>
<p>Very sexy, yes? I won&#8217;t be offended if you use some other colors, I promise :)</p>
<p style="text-align: justify;">Important to keep in mind is (1) that only the breadcrumb area got affected by our actions and (2) that we didn&#8217;t had to modify any file, just to add a couple of lines to our css</p>
<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://multimixer.gr/13/02/2012/styling-the-breadcrumb-in-oscommerce/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Add a remove button to the shopping cart page</title>
		<link>http://multimixer.gr/05/01/2012/add-remove-button-to-shopping-cart-page/</link>
		<comments>http://multimixer.gr/05/01/2012/add-remove-button-to-shopping-cart-page/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 14:18:12 +0000</pubDate>
		<dc:creator>multimixer</dc:creator>
				<category><![CDATA[learn]]></category>
		<category><![CDATA[osCommerce v2.3]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://multimixer.gr/?p=1123</guid>
		<description><![CDATA[In version 2.3.1 of osCommerce, there is no remove button for items placed into the shopping cart, but a plain text link.  Read here how to replace this with a nice button in same style of all other store buttons]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">In version 2.3.1 of osCommerce, there is no remove button for items placed into the shopping cart, but a plain text link. On top of this, the link text is also &#8220;hardcoded&#8221;, so it always says &#8220;remove&#8221;, doesn&#8217;t matter what language you have in use in your store.</p>
<p>That is how the shopping cart page look by default</p>
<p><a href="http://multimixer.gr/wp-content/uploads/2011/12/button_1.jpg"><img class="aligncenter size-large wp-image-1127" title="Default &quot;remove&quot; link on shopping cart page in osCommerce" src="http://multimixer.gr/wp-content/uploads/2011/12/button_1-540x283.jpg" alt="Default &quot;remove&quot; link on shopping cart page in osCommerce" width="540" height="283" /></a></p>
<p style="text-align: justify;">Let&#8217;s change this, and let&#8217;s create a multilingual button, that will look consistent with all other buttons all over your store. The file we need to work on is</p>
<blockquote><p><strong>catalog/shopping_cart.php</strong></p></blockquote>
<p style="text-align: justify;">Make a copy of that file so you can replace the file you are working on, in case you mess anything up. At about line 97 we can see there following piece of code</p>
<pre class="brush:php; first-line:97;">      $products_name .= '&lt;br /&gt;&lt;br /&gt;' . tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']) . tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh') . '   or &lt;a href="' . tep_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products[$i]['id'] . '&amp;action=remove_product') . '"&gt;remove&lt;/a&gt;';</pre>
<p>To make it a bit more clear what&#8217;s happening here, let&#8217;s break the code into separate lines</p>
<pre class="brush:php; first-line:97;">$products_name .= '&lt;br /&gt;&lt;br /&gt;' .
tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') .
tep_draw_hidden_field('products_id[]', $products[$i]['id']) .
tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh') .
'   or &lt;a href="' . tep_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products[$i]['id'] . '&amp;action=remove_product') . '"&gt;remove&lt;/a&gt;';</pre>
<p>The &#8220;remove&#8221; link is following</p>
<pre class="brush:php; first-line:101;">'   or &lt;a href="' . tep_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products[$i]['id'] . '&amp;action=remove_product') . '"&gt;remove&lt;/a&gt;'</pre>
<p style="text-align: justify;">As you can see, the words &#8220;or&#8221; and &#8220;remove&#8221; are hardcoded into the file and the result is the plain text link you can see on your screen. This we are going to replace by a nice button. This is the code we are going to use</p>
<pre class="brush:php; first-line:101;">tep_draw_button(IMAGE_BUTTON_REMOVE, 'trash', tep_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products[$i]['id'] . '&amp;action=remove_product'))</pre>
<p style="text-align: justify;">As you can see, the link part, including it&#8217;s &#8220;action&#8221; is exactly same as before. New is, that we use the tep_draw_button function of osCommerce</p>
<p style="text-align: justify;">IMAGE_BUTTON_REMOVE is the text for our button, this we wil add later to file catalog/includes/languages/english.php. The word &#8220;trash&#8221; is for the icon we want to use on the button, we can use any of the available icons of the <a href="http://jqueryui.com/themeroller/" target="_blank">jQuery ui theme.</a></p>
<p>So, our code looks now like this</p>
<pre class="brush:php; first-line:97;">$products_name .= '&lt;br /&gt;&lt;br /&gt;' .
tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') .
tep_draw_hidden_field('products_id[]', $products[$i]['id']) .
tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh') .
tep_draw_button(IMAGE_BUTTON_REMOVE, 'trash', tep_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products[$i]['id'] . '&amp;action=remove_product'));</pre>
<p>and in one line, as it was before, like this</p>
<pre class="brush:php; first-line:97;">  $products_name .= '&lt;br /&gt;&lt;br /&gt;' .  tep_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . tep_draw_hidden_field('products_id[]', $products[$i]['id']) . tep_draw_button(IMAGE_BUTTON_UPDATE, 'refresh') . tep_draw_button(IMAGE_BUTTON_REMOVE, 'trash', tep_href_link(FILENAME_SHOPPING_CART, 'products_id=' . $products[$i]['id'] . '&amp;action=remove_product'));</pre>
<p>Copy-pasters in a hurry, can just replace line 97 of their file with this line here</p>
<p>Next thing we need to do is, to define the text we want to have displayed on our new button, this we do in file</p>
<blockquote><p>catalog/includes/languages/english.php</p></blockquote>
<p style="text-align: justify;">Here you can add anywhere before the last closing ?&gt; following into the file, it will be better of course if you add it close to the other button text defines</p>
<pre class="brush:php; first-line:210;">      define('IMAGE_BUTTON_REMOVE', 'Remove');</pre>
<p style="text-align: justify;">Please note that this define is globally available all over your sore, so you can use the same constant anywhere else you want to have the text &#8220;remove&#8221; displayed. You can change the text of course to anything that fit your needs, eg to &#8220;kuku&#8221; and you need to add the same define to your other main language files in case you use more languages (eg german.php, spanish.php, swahili.php etc)</p>
<p>Lets lake a look now how our shopping cart page look like</p>
<p><a href="http://multimixer.gr/wp-content/uploads/2012/01/button_2.jpg"><img class="aligncenter size-large wp-image-1139" title="Shopping cart page with &quot;remove&quot; button" src="http://multimixer.gr/wp-content/uploads/2012/01/button_2-540x283.jpg" alt="Shopping cart page with &quot;remove&quot; button" width="540" height="283" /></a></p>
<p>Easy not? Enjoy and lets hope that nobody is going to press this :)</p>
<p>In case you are interested, here&#8217;s an other interesting post about how to <a title="Remove all items from the shopping cart" href="http://www.clubosc.com/remove-all-items-from-shopping-cart.html" target="_blank">remove all items from the shopping cart</a></p>
<p><small>Front page trash can image taken from <a href="http://www.wpclipart.com/" target="_blank">wp clipart</a>, thank you guys</small></p>
]]></content:encoded>
			<wfw:commentRss>http://multimixer.gr/05/01/2012/add-remove-button-to-shopping-cart-page/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>jQuery tips: Rounded corners for osCommerce boxes</title>
		<link>http://multimixer.gr/28/09/2011/jquery-tips-rounded-corners-for-oscommerce-boxes/</link>
		<comments>http://multimixer.gr/28/09/2011/jquery-tips-rounded-corners-for-oscommerce-boxes/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 18:16:03 +0000</pubDate>
		<dc:creator>multimixer</dc:creator>
				<category><![CDATA[learn]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[jQuery UI]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://multimixer.gr/?p=1060</guid>
		<description><![CDATA[This is a quick and easy way to add rounded corners to your osCommerce boxes using jQuery and styling them with a couple of simple css rules. Easy as 123, try it out.]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Here is a quick and easy way to add rounded corners to your osCommerce boxes using jQuery and styling them with a couple of simple css rules</p>
<p>Here is how the boxes look by default</p>
<p><a href="http://multimixer.gr/wp-content/uploads/2011/09/boxes_default.jpg"><img class="aligncenter size-large wp-image-1062" title="Default osCommerce boxes: Square corners and gluing to each other" src="http://multimixer.gr/wp-content/uploads/2011/09/boxes_default-540x283.jpg" alt="Default osCommerce boxes: Square corners and gluing to each other" width="540" height="283" /></a></p>
<p style="text-align: justify;">They have square corners and glue to each other. Lets go to change this. Please do not follow any advices posted in the osCommerce forum telling you that you have to go to several files changing this and that, or that you have to write huge blocks of css.</p>
<p>Things are much more simple, because of <strong>2 facts</strong></p>
<blockquote><p><strong>1) osCommerce uses a &#8220;jQuery UI&#8221; theme</strong>, and in it&#8217;s css there are already classes defined that will do rounded corners in any direction.</p>
<p>That classes are (names are self explanatory)</p>
<ul>
<li>.ui-corner-all</li>
<li>.ui-corner-top</li>
<li>.ui-corner-bottom</li>
<li>.ui-corner-right</li>
<li>.ui-corner-left</li>
<li>.ui-corner-tl (tl = top left)</li>
<li>.ui-corner-tr (tr = top right)</li>
<li>.ui-corner-bl (bl = bottom left)</li>
<li>.ui-corner-br (br = bottom right)</li>
</ul>
<p><strong>2) jQuery has a method called &#8220;</strong><a href="http://api.jquery.com/addClass/" target="_blank"><strong>addClass()</strong></a><strong>&#8220;</strong>, that does exactly this: to add a css class to anywhere you want</p></blockquote>
<p>Now after we know this, all we have to do is to add the ui class that creates rounded corners to the right element of the box using addClass()</p>
<p>All code snipsets I will add to file catalog/includes/footer.php (if not something else is mentioned) to here</p>
<pre class="brush:js">&lt;script type="text/javascript"&gt;
$('.productListTable tr:nth-child(even)').addClass('alt');
// here is where I add any jQuery code //
&lt;/script&gt;</pre>
<blockquote><p><strong>Mini template system users</strong></p>
<p>please find the same part of code in file mts/themes/your_theme/files/includes/footer.php</p></blockquote>
<p>Lets say you want to add rounded corners to the top of the box heading and to the bottom of the box content, so that the whole box looks like &#8220;rounded&#8221;. That what you need to add:</p>
<pre class="brush:js">$("#columnLeft div.ui-widget-header, #columnRight div.ui-widget-header").addClass("ui-corner-top");
$("#columnLeft div.ui-widget-content, #columnRight div.ui-widget-content").addClass("ui-corner-bottom");</pre>
<p>And this is the result</p>
<p><a href="http://multimixer.gr/wp-content/uploads/2011/09/boxes_round1_margin.jpg"><img class="aligncenter size-large wp-image-1071" title="osCommerce boxes: All around rounded corners" src="http://multimixer.gr/wp-content/uploads/2011/09/boxes_round1_margin-540x283.jpg" alt="osCommerce boxes: All around rounded corners" width="540" height="283" /></a>For sure you noticed that I added also some space between the boxes, so that they don&#8217;t glue to each other. This I did by adding following to file catalog/stylesheet.css</p>
<pre class="brush:css">#columnLeft .infoBoxContainer, #columnRight .infoBoxContainer {margin-bottom:10px; }</pre>
<p>You can adjust of course the value of the margin as you like</p>
<blockquote><p><strong>Mini template system users</strong>, don&#8217;t need to add anything to anywhere since this is a admin setting. For questions please click the support link on top of your administration panel</p></blockquote>
<p>There are of course other possibilities to play with rounded corners, for example to add separate rounded corners to both, box heading and box content, like this:</p>
<p><a href="http://multimixer.gr/wp-content/uploads/2011/09/boxes_round2.jpg"><img class="aligncenter size-large wp-image-1072" title="Separate rounded corners to box heading and box content" src="http://multimixer.gr/wp-content/uploads/2011/09/boxes_round2-540x283.jpg" alt="Separate rounded corners to box heading and box content" width="540" height="283" /></a>Just add to your footer (same location as before) following</p>
<pre class="brush:js">$("#columnLeft div.ui-widget-header, #columnRight div.ui-widget-header").addClass("ui-corner-all");
$("#columnLeft div.ui-widget-content, #columnRight div.ui-widget-content").addClass("ui-corner-all");</pre>
<p>To my stylesheet.css file I added folowing to make things a bit nicer</p>
<pre class="brush:css">#columnLeft .infoBoxHeading, #columnRight .infoBoxHeading {
  margin-bottom:2px;
  padding:7px 2px;
}</pre>
<p>You can of course add such a ronded corner only to the top left of the box heading or to anywhere you want. Go on and try it out</p>
<p>A possible question: How round are the rounded corners? This depends on the ui-widget theme you have installed. If you need an other corner radius, you can go to the <a href="http://jqueryui.com/themeroller/" target="_blank">themeroller</a> page and create a new theme using any settings you like for the corners.</p>
<p>You may be interested to read about how to <a title="change your jQuery ui theme in osCommerce" href="http://multimixer.gr/02/12/2010/how-to-get-a-new-theme-for-your-oscommerce-store/">add a jQuery ui theme to your osCommerce store</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://multimixer.gr/28/09/2011/jquery-tips-rounded-corners-for-oscommerce-boxes/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Styling the modules on the product information page in osCommerce</title>
		<link>http://multimixer.gr/27/07/2011/styling-the-modules-on-the-product-information-page-in-oscommerce/</link>
		<comments>http://multimixer.gr/27/07/2011/styling-the-modules-on-the-product-information-page-in-oscommerce/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 16:10:29 +0000</pubDate>
		<dc:creator>multimixer</dc:creator>
				<category><![CDATA[learn]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[osCommerce v2.3]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://multimixer.gr/?p=1003</guid>
		<description><![CDATA[If you like to change the look of one - or all - the modules on your product information page, keep on reading, it's really very simple. You will need less time than for drinking a coffee]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">The product information page in osCommerce displays usually, beside the product information it self, various modules: For example the &#8220;also purchased&#8221; module, or &#8220;related products&#8221; in case you have that, or &#8220;slave products&#8221; and various others.</p>
<p style="text-align: justify;">All of that modules have a common css styling: The ui widget styling. The module heading is class &#8220;ui-widget_header&#8221; the content is &#8220;ui-widget-content&#8221;. That&#8217;s all fine and can be styled very nicely using <a title="Themeroller" href="http://jqueryui.com/themeroller/" target="_blank">themeroller</a> and you can read here about how to <a title="Get a new theme for your osCommerce store" href="http://multimixer.gr/02/12/2010/how-to-get-a-new-theme-for-your-oscommerce-store/">change the ui theme of your store</a> easily. But what is in case you have more than one module on the same page? Does it not start to look a little boring?</p>
<p style="text-align: justify;">If you like to change the look of one &#8211; or all &#8211; the modules on your product information page, keep on reading, it&#8217;s really very simple. We are going tho change the look of the &#8220;also purchased&#8221; module, that is the most common, since it exist in each store by default</p>
<p>That is how the module look like on an unmodified store</p>
<p style="text-align: center;"><a href="http://multimixer.gr/wp-content/uploads/2011/07/also_purchased_default.jpg"><img class="size-large wp-image-1007 aligncenter" title="The default look of the also purchased module on the product information page in osCommerce" src="http://multimixer.gr/wp-content/uploads/2011/07/also_purchased_default-540x119.jpg" alt="The default look of the also purchased module on the product information page in osCommerce" width="540" height="119" /></a></p>
<p>Applying and other ui-theme, it looks already much different</p>
<p style="text-align: center;"><a href="http://multimixer.gr/wp-content/uploads/2011/07/also_purchased_ui-widget.jpg"><img class="size-large wp-image-1008 aligncenter" title="After changing the ui-theme it looks already better. Theme in use is &quot;smoothness&quot;" src="http://multimixer.gr/wp-content/uploads/2011/07/also_purchased_ui-widget-540x156.jpg" alt="After changing the ui-theme it looks already better. Theme in use is &quot;smoothness&quot;" width="540" height="156" /></a></p>
<p style="text-align: justify;">Please note that the image above shows a store designed with mini template system, other design changes you see in relation to the default set up are because of that. The ui theme will change the colors of your module, not more</p>
<p>So, what to do to change the look of that module?</p>
<p style="text-align: justify;">First lets go to apply a unique id to the whole module, so we can be sure that any setting we do will affect just this and not anything else too.</p>
<p style="text-align: justify;">The file we need is catalog/includes/modules/also_purchased_products.php. All we do here is to add one id to the wrapping div as follows</p>
<p>Change this</p>
<pre class="brush:xml">  &lt;div class="ui-widget infoBoxContainer"&gt;</pre>
<p>to this</p>
<pre class="brush:xml">  &lt;div id="alsoPurchased" class="ui-widget infoBoxContainer"&gt;</pre>
<p>You can close and upload the file.</p>
<p>Anything else we do in file catalog/stylesheet.css (<strong>for mini template system users the file is catalog/mts/themes/theme_base_001/style_custom.css</strong>)</p>
<p>Here is some css that I used</p>
<pre class="brush:applescript">#alsoPurchased .ui-widget-content{ border:1px solid #7ba6d3; padding-top:30px;  -moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px;}
#alsoPurchased .ui-widget-header{border:none; background:none; margin:0; font-size:14px; font-weight:normal; position:relative; bottom:-10px;}
#alsoPurchased .ui-widget-header span{color:#fff; background:#7ba6d3; padding:10px; border:1px solid #7ba6d3;  -moz-border-radius:10px 3px 3px 0; -webkit-border-radius:3px; border-radius:3px;}</pre>
<p>And that is how the result look like</p>
<p style="text-align: center;"><a href="http://multimixer.gr/wp-content/uploads/2011/07/also_purchased_custom.jpg"><img class="size-large wp-image-1010 aligncenter" title="A totally different look for the module" src="http://multimixer.gr/wp-content/uploads/2011/07/also_purchased_custom-540x182.jpg" alt="A totally different look for the module" width="540" height="182" /></a></p>
<p style="text-align: justify;">The orange separation lines can also be added easily. And of course you can change the css settings completely as you like Here is an other example of styling the &#8220;master slave&#8221; listing module that I added to an other site</p>
<p style="text-align: center;"><a href="http://multimixer.gr/wp-content/uploads/2011/07/master_slave_custom.jpg"><img class="size-large wp-image-1011 aligncenter" title="Same styling for the master slave module of osCommerce" src="http://multimixer.gr/wp-content/uploads/2011/07/master_slave_custom-540x233.jpg" alt="Same styling for the master slave module of osCommerce" width="540" height="233" /></a></p>
<p>Now go on and make your store a little more pretty</p>
<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://multimixer.gr/27/07/2011/styling-the-modules-on-the-product-information-page-in-oscommerce/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Create a google AdSense box for your osCommerce store</title>
		<link>http://multimixer.gr/26/07/2011/create-a-google-adsense-box-for-your-oscommerce-store/</link>
		<comments>http://multimixer.gr/26/07/2011/create-a-google-adsense-box-for-your-oscommerce-store/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 18:28:21 +0000</pubDate>
		<dc:creator>multimixer</dc:creator>
				<category><![CDATA[learn]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[osCommerce v2.3]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://multimixer.gr/?p=978</guid>
		<description><![CDATA[If you like the idea of having a box on your store displaying google ads, then here is the way to do it. But honestly, if your store doesn't make enough money, you should focus on that, or start advertising for the store and not on the store]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I had a client who wanted to display google AdSense adds on the right column of his store. Now I need to say, that I&#8217;m not the greatest fan of such an idea: A store is there to make money by selling its products or services, not through advertising or anything else. Each visitor should be focused on what the store has to offer, any ads or similar displays are just a distraction in my opinion.</p>
<p style="text-align: justify;">Honestly, if your store doesn&#8217;t make enough money, you should focus on that, or start advertising <strong>for</strong> the store and <strong>not on</strong> the store</p>
<p>Anyway, this was the request, so if you like something like this too, here you go</p>
<h3>Step 1: Create the files</h3>
<p style="text-align: justify;">All boxes are in osCommerce in folder <strong>catalog/includes/modules/boxes/</strong></p>
<p>The corresponding language files are in folder <strong>catalog/includes/languages/english/modules/boxes/ </strong>and have exactly the same filename as the box it self</p>
<p style="text-align: justify;">What we do now is to take the most simple box that exist, that is bm_information.php, make a copy and rename it to be bm_adsense.php. Same we do with the corresponding language file. So we have 2 fies now called bm_adsense.php.</p>
<p style="text-align: justify;">Keep them open in your editor, do not upload them and more important do not install and activate them in admin, you will get errors at that stage</p>
<h3>Step 2: Basic setup</h3>
<p style="text-align: justify;">As we know, all boxes are so called &#8220;classes&#8221; and do write configuration values (constants) to the database. That mean that some parts of the content of that files must be unique.</p>
<p style="text-align: justify;">Before doing anything else, we need to make the file contents &#8220;unique&#8221; in that meaning. We do this by replacing class function names and constants as follows:</p>
<p style="text-align: justify;"><strong>1 Box file: class and function names &#8211; 3 replacements</strong></p>
<p style="text-align: justify;">Replace all instances of  &#8221;bm_information&#8221; with &#8220;bm_adnsense&#8221;, so for example, on top of the file, it was</p>
<p style="text-align: justify;">
<pre class="brush:php">  class bm_information {
    var $code = 'bm_information';</pre>
<p>and it will look like</p>
<pre class="brush:php">  class bm_adsense {
    var $code = 'bm_adsense';</pre>
<p><strong>2 Box file: Constants &#8211; 18 replacements</strong></p>
<p style="text-align: justify;">replace all instances of &#8220;MODULE_BOXES_INFORMATION&#8221; with &#8220;MODULE_BOXES_ADSENSE&#8221;  Please note the capital letters.</p>
<p>For example it was</p>
<pre class="brush:php">      if ( defined('MODULE_BOXES_INFORMATION_STATUS') ) {
        $this-&gt;sort_order = MODULE_BOXES_INFORMATION_SORT_ORDER;
        $this-&gt;enabled = (MODULE_BOXES_INFORMATION_STATUS == 'True');</pre>
<p>and now it look like</p>
<pre class="brush:php">      if ( defined('MODULE_BOXES_ADSENSE_STATUS') ) {
        $this-&gt;sort_order = MODULE_BOXES_ADSENSE_SORT_ORDER;
        $this-&gt;enabled = (MODULE_BOXES_ADSENSE_STATUS == 'True');</pre>
<p><strong>3 laguage file: Constants</strong></p>
<p style="text-align: justify;">Same thing you do in the language file, well, ok, you don&#8217;t need all that defines, so you can basically replace the contents of that file with this</p>
<pre class="brush:php">  define('MODULE_BOXES_ADSENSE_TITLE', 'adsense');
  define('MODULE_BOXES_ADSENSE_DESCRIPTION', 'Show adsense box');
  define('MODULE_BOXES_ADSENSE_BOX_TITLE', 'adsense');</pre>
<p>Right now you can upload the files if you like and go and enable them in your admin panel under modules&gt;boxes. What you have now is a clone of the information box. Next step will be to modify the file for our purpose</p>
<h3>Step 3 :File modification</h3>
<p>All we have to do now, is to create and add to that box a new text input field to where we will add our adsense code in the administration panel</p>
<p>We need one more configuration constant for the database, that we create as follows in function install()</p>
<pre class="brush:php">        tep_db_query( "insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ( 'adSense code', 'MODULE_BOXES_ADSENSE_CODE', '', 'Paste the adSense code into here', '6', '4', 'tep_draw_textarea_field(\'configuration[MODULE_BOXES_ADSENSE_CODE]\', false, 35, 20, ', now())" );</pre>
<p>And we need of course to add that constant to the array of keys, as follows</p>
<pre class="brush:php">    function keys() {
      return array('MODULE_BOXES_ADSENSE_STATUS', 'MODULE_BOXES_ADSENSE_CONTENT_PLACEMENT', 'MODULE_BOXES_ADSENSE_SORT_ORDER', 'MODULE_BOXES_ADSENSE_CODE');
    }</pre>
<p>Last thing to do is, to set our box to display whatever we entered into the text box. This we do in function dataF() that will look after our changes, just like this</p>
<pre class="brush:php">    function dataF() {

      $data = '&lt;div style="text-align:center;"&gt;';
      $data .= MODULE_BOXES_ADSENSE_CODE;
      $data .='&lt;/div&gt;';

	  return $data;
    }</pre>
<p>Please note that if you did not do the changes as described <a title="Separate data from execution in the osCommerce boxes" href="http://multimixer.gr/03/01/2011/separating-data-from-execution-in-oscommerce-boxes/">here</a> you will not find such a function in your box. You will need to do that changes to function execute() accordingly</p>
<p>Guess what?</p>
<p>We are done ! Really !</p>
<p>Lets go to the administration panel to see what we did. We will find our box under modules&gt;boxes, we will need to install it, and by clicking on &#8220;edit&#8221; we have following</p>
<p><img class="aligncenter size-large wp-image-992" title="Add your adsense code in your osCommerce administration" src="http://multimixer.gr/wp-content/uploads/2011/07/adsense_edit-540x283.jpg" alt="Add your adsense code in your osCommerce administration" width="540" height="283" /></p>
<p>and a preview in the admin</p>
<p><img class="aligncenter size-large wp-image-993" title="Live adsense preview in your oscommerce administration" src="http://multimixer.gr/wp-content/uploads/2011/07/adsense_preview-540x283.jpg" alt="Live adsense preview in your oscommerce administration" width="540" height="283" /></p>
<p>And that is how the box look like on my clients site</p>
<p><img class="aligncenter size-large wp-image-994" title="Adsense ads on your osCommerce store" src="http://multimixer.gr/wp-content/uploads/2011/07/adsense_website1-540x283.jpg" alt="Adsense ads on your osCommerce store" width="540" height="283" /></p>
<p>If you like this idea too, then go ahead and do it, and if you ge rich because of your ads, you can buy me a beer :)</p>
<p>In the same way you can create of course any box. Even this bo here can be used for other purposes too, for example to display plain text (just add plain text into the textarea in admin instead of the adsense code) or images or anything like that</p>
]]></content:encoded>
			<wfw:commentRss>http://multimixer.gr/26/07/2011/create-a-google-adsense-box-for-your-oscommerce-store/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>
