- This topic has 0 replies, 1 voice, and was last updated 14 years, 1 month ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore F.A.Q/Instructions › How to display buttons or shopping cart in the sidebar widget
WP eStore comes with many shortcodes that you can use in a Text Widget. Simply add a “Text Widget” to your sidebar from the widgets menu and place the shortcode in it.
Some of the shortcodes may NOT WORK when used in a text widget but not to worry as eStore has corresponding functions for most shortcodes that you can use.
All the available shortcodes and functions are documented here:
http://www.tipsandtricks-hq.com/ecommerce/wp-estore-shortcodes-and-functions-reference-460
If you are calling the PHP function from the theme’s template file (sidebar.php, header.php, footer.php etc) then you are fine but if you need to use the functions from the widget then the text widget option won’t work as the text widget cannot execute PHP code. Fortunately, there is a nice workaround:
1. Download and activate the Executable PHP code plugin if you don’t have it already (any other PHP executable plugin will work too):
http://wordpress.org/extend/plugins/php-code-widget/
This plugin lets you call php functions from the widgets (it’s similar to the Text widget but it allows you execute PHP code too).
2. Go to the widgets menu and add a ‘PHP Code’ widget to the sidebar (where you want to display the ‘Add to Cart’ buttons or shopping cart). Now you can enter HTML and PHP code here to display whatever you want to show. For example, entering the following line will display the shopping cart:
<?php echo eStore_shopping_cart_fancy1(); ?>
You can also place custom text/message above or below this PHP function call.