About Club osCommerce

Showcasing osCommerce…the good, the bad and the ugly!

Follow osc_pro on Twitter

Category Manufacturer Tabs jQuery and osCommerce

Written By Gary on Sep 01 2010 · Comments (0) Follow osc_pro on Twitter

At the official osCommerce forum this question was posed;

my client wants her website to have the same menu as website below

link removed! But here is a screenshot:

now is there a way that we can show brand which is manufactures in osc with a tab of category just like in the website above is there a addon or do i have to start from scratch.

And the question was answered like this:

the best way is to use jQuery tabs.

Now, as I like experimenting with jQuery and osCommerce, I decided to have a go at it - within 5 minutes I have it working, using the tutorial and demo at jquery for designers.

Step 1:
Set your manufacturers to show a list instead of a dropdown. This is an admin setting.

Step 2:
Open up the file /includes/column_left.php and get rid of everything in it. Then add only this code:

PHP:
  1. <div class="tabs"><!-- tabs -->
  2. <ul class="tabNavigation">
  3.     <li><a href="#categories">Categories</a></li>
  4.     <li><a href="#manufacturers">Manufacturers</a></li>
  5. </ul>
  6. <!-- tab containers -->
  7. <div id="categories"></div>
  8. <div id="manufacturers"></div>
  9. </div>

Step 3:
Add the css contained in the example tutorial to the oscommerce stylesheet.

Step 4:
Add the jquery as per the example tutorial to all the pages in your site.

Step 5:
Open up the files /includes/boxes/categories.php and /includes/boxes/manufacturers.php and remove the tr and td tags. Also comment out the infoBoxHeading in both files as so;

PHP:
  1. //new infoBoxHeading($info_box_contents, false, false);

Also, simply echo the strings at the end rather than place them in an infobox. As so;

PHP:
  1. echo $manufacturers_list;

Step 5 is a bit complicated, but I can package something up if anyone is interested and there is a beer or two involved ;)

In the end it looks like this, obviously you would play with the .css to make it better suit the design of your site.

What I might do in my next makeover is use this method as it is a great way of saving space in a design.


Buy Gary A Beer?
Buying me a "beer" helps me to keep my contributions updated and keep this blog alive - and you get a link from my homepage to your site. Cheers!


No Comments

No comments yet.

Leave a comment

RSS feed for comments on this post

Hot 100 osCommerce Shops

View the osCommerce HOT 100These are the best looking, most exceptional osCommerce Stores as voted for by you.

New to osCommerce - get inspiration from these beautiful shops. Reckon your site has what it takes to become a member of the HOT 100? Submit it!