OpenCart 1.5 DB Diagrams

November 25th, 2011 | Posted by ChrisG in OpenCart - (Comments Off)

This page contains database diagrams for the open source application OpenCart 1.5.
Click here to view OpenCart 1.5 DB Diagrams

How to select an OpenCart Tab

November 25th, 2011 | Posted by ChrisG in OpenCart - (4 Comments)

OpenCart supports jQuery tabs. An example of this is when editing products in the admin area. The problem I was having was how to open a page with a tab (other than the first tab) already selected.

For example to open the page with the Colour Definitions tab selected…

After a lot of messing around in jQuery and not having much luck I went old school and just used some javascript to activate the tab links once the page loads. This has the same affect as the user clicking the jQuery tab link.

So to do this, in the template (.tpl) file

1. Give the tab links ids.

<!-- Menu Tabs --> <div id="tabs" class="htabs"> <a id="tab_general" href="#tab-general">General Settings</a>  <a id="tab_definitions" href="#tab-definitions">Colour Definitions</a>  <a id="tab_categories" href="#tab-categories">Colour Categories</a>  <a id="tab_image" href="#tab-image">Image Colour Data</a> </div> <!-- End Menu Tabs -->

2. At the bottom after

$('#tabs a').tabs();

add the line

document.getElementById('tab_definitions').click();

now when the page opens it opens with the Colour Definitions tab selected