Ecommerce Templates > WordPress > Sidebars & menus with WordPress and Ecommerce Templates

Sidebar widgets & menus in WordPress with Ecommerce Templates

Wordpress shopping cart software

 

After following the integration steps you'll probably want to add some of the store pages to your WordPress menus. You can also add dynamic content via widgets to the sidebar

Adding stores pages to WordPress menus

To add stores pages to your WordPress menus you will need the ECT Custom URLs plugin and make sure that is activated through the plugins screen in your WordPress admin. This is how you would add the products page to a menu for example...

In the WordPress Admin go to Page > Add New

Add page

Enter "Products" in the field and leave all other fields with the default settings and click on update

Add page link

Now go to Edit Page and in the permalinks field add the URL of the products.php page.

You can do this for the other store pages.

Now go to Appearance > Menus

Choose the menu from your theme you want the page added to

On the left hand side you should see a list of your pages, select the page you have just set up, "products" and choose "Add to Menu". You should now see the products page in the menu selected.

Repeat this process for any other links you want adding to the navigation, typically people would add links to the cart,search and products in a main menu and secondary links like order status, tracking client login would go into secondary menus.

Back to top

All widgets

We have made the widgets below available as one simple plugin download. This means you can drag and drop store features such as the dynamic menu, store search or mini cart directly from the widget area of your theme into the sidebar or other widget location of your store.

ECT widgets

These do not require the installation of any other third party plugins to make them work within your store.

The ECT Store Widgets plugin is available from our downloads page and includes the following

  • Store search field
  • Mini cart
  • Mini login
  • Dynamic accordion menu
  • Dynamic pop out menu
  • Dynamic drop down menu
  • Recently viewed products

If you prefer not to use the ECT WP Store Widgets plugin you can still add those features manually by following the steps below...

Back to top

Add a search field to the side bar

You can view the mini search field on our demo store, it's the second widget on the right hand side. It will return results based on text including the product name, product id, product description, sku and extra keywords added through the product admin page

Mini search

In your WordPress admin go Appearance > Widgets, find the text widget and drag that to the sidebar where you want it to appear in the list

Store search

Give the widget a title and enter the following HTML

<form method="post" action="search.php">
<input type="hidden" name="posted" value="1"/>
<input type="text" name="stext" size="16"/><br/>
<input type="submit" name="search"/>
</form>

There are tweaks that can be made to the search box and those are covered on our search help page.

Back to top

Add a minicart to the side bar

The minicart give a summary of the cart contents and can appear on each page of the store. It includes css classes for formatting. There is an example on our demo store.

Minicart

To add the minicart you will need the WordPress executable PHP widget installed.

In your WordPress admin go to Appearance > Widgets, find the PHP code widget and drag that to the sidebar where you want it to appear in the list

Mini cart widget

Give the widget a title and enter the following code

<?php
include "vsadmin/inc/incminicart.php";
?>

There is also a css based mini cart available, including a one line version in our css widgets pack.

Back to top

Add a mini login to the side bar

The mini login is used in conjunction with the customer account feature and will show the customer's login status along with a link to their account / login / logout. It includes the same css classes as the minicart for formatting. There is an example on our demo store.

Mini login

To add the mini login you will need the WordPress executable PHP widget installed.

In your WordPress admin go to Appearance > Widgets, find the PHP code widget and drag that to the sidebar where you want it to appear in the list

Mini login widget

Give the widget a title and enter the following code

<?php
include "vsadmin/inc/incminilogin.php";
?>

There is also a css based mini login available in our css widgets pack.

Back to top

Add a dynamic menu to the side bar

There are three css based dynamic menus available with Ecommerce Templates. These will automatically pull the categories from the admin and display them on your site. They are fully configurable through the css file and full details are available on css menus help page. There is an example of the accordion menu on our demo store.

Dynamic menu

To add the dynamic menu you will need the WordPress executable PHP widget installed.

In your WordPress admin go to Appearance > Widgets, find the PHP code widget and drag that to the sidebar where you want it to appear in the list

Dynamic menu widget

Give the widget a title and enter the following code for the accordion menu

<?php
$GLOBALS['menustyle']='verticalmenu2';
include "vsadmin/inc/incmenu.php";
?>

If you want to add the pop out menu the code would be

<?php
$GLOBALS['menustyle']='verticalmenu3';
include "vsadmin/inc/incmenu.php";
?>

If you want to add the drop down menu the code would be

<?php
$GLOBALS['menustyle']='horizontalmenu1';
include "vsadmin/inc/incmenu.php";
?>

Back to top

Add featured or best selling products to the side bar

You can add recommended or featured products to the side bar using the Ecommerce Templates cross selling feature. Normally used on the cart or products detail pages, they can also be used as a featured product as shown on our demo store.

Features products

To add the dynamic menu you will need the WordPress executable PHP widget installed.

In your WordPress admin go to Appearance > Widgets, find the PHP code widget and drag that to the sidebar where you want it to appear in the list

Featured product widget

Give the widget a title and enter the following code for the featured product

<?php
$GLOBALS['crosssellaction']='recommended';
?>
<?php include "vsadmin/inc/inccrosssell.php" ?>

You can format the display by adding some parameters. Here for example we have set it to show one column and two rows as well as removing the discounts text and title and set a prefix for the associated css classes...

<?php
$GLOBALS['noshowdiscounts']=TRUE;
$GLOBALS['csrecommendedtitle']=' ';
$GLOBALS['crosssellaction']='recommended';
$GLOBALS['csstyleprefix']='rcs';
?>
<?php include "vsadmin/inc/inccrosssell.php" ?>

The full list of parameters available on the store are listed here.

To choose which products to feature go to the product admin page of your store control panel and check the "Recommended" box at the bottom of the product page you would like to feature.

Recommended

It is also possible to show best selling products in the same way. In this case you would need the following code in the PHP widget

<?php
$GLOBALS['crosssellaction']='bestsellers';
?>
<?php include "vsadmin/inc/inccrosssell.php" ?>

The best selling items on your store would then show automatically.

Back to top

Add content regions to the side bar

Content regions are areas that can be set up through your store control panel. These might be news items, contact details, product information, maps...whatever you want to place there really. The details of the set up are available on our content management help page.

Content region

You can add any valid HTML and CSS for formatting and comes with an optional HTML editor. This simple example is shown on our demo store.

Features products

To add content regions you will need the WordPress executable PHP widget installed.

In your WordPress admin go to Appearance > Widgets, find the PHP code widget and drag that to the sidebar where you want it to appear in the list

Content region

Give the widget a title and enter the following code for the content region

<?php $regionid=1; ?>
<?php include "vsadmin/inc/inccontentregion.php" ?>

The identifier of the content region, in this case regionid=1 will change depending on the region you are calling from the store control panel.

You can have as many content regions on the page as you like.

Back to top

Add recently viewed items to the side bar

Recently viewed items show customers the items they have viewed on your store with a link to that product and a note of the category it belongs to. Items should remain in the list for three days, making it a powerful tool for return visitors.

The css classes are the same ones used for the minicart and mini login. This example is shown on our demo store (you will need to view some product detail pages to see the content)

Recently viewed

To add the recently viewed widget you will need the WordPress executable PHP widget installed.

In your WordPress admin go to Appearance > Widgets, find the PHP code widget and drag that to the sidebar where you want it to appear in the list

Recently viewed

Give the widget a title and enter the following code for the recently viewed items

<?php
include "vsadmin/inc/increcentview.php";
?>

Do remember that you have to view a product detail page before seeing any content there.

An overview of adding store widgets through WordPress

  • How to add Ecommerce Templates widgets to WordPress.

Back to top