Tips and Tricks HQ Support Portal › Forums › Simple PayPal Shopping Cart › Simple Shopping Cart Tweaks › Is there a way to always show the shopping cart on a page?
Tagged: display cart, print_wp_shopping_cart, shortcode
- This topic has 6 replies, 3 voices, and was last updated 14 years, 9 months ago by rjd2.
-
AuthorPosts
-
January 10, 2010 at 6:14 pm #645rjd2Member
I want the shopping cart area to be shown on my merchandise page even if there is nothing in it. How can I do this?
I understand that by default the actual cart is only shown once something is added but I want it to be shown all the time.
January 10, 2010 at 7:14 pm #17140TinkBDMemberYou can add the short code <?php echo eStore_shopping_cart(); ?> to a PHP widget and put it in the sidebar.
I just ran a quick test with the PHP Widgetify Plugin and it worked well.
Here is a link to the plugin page:
http://wordpress.org/extend/plugins/php-widgetify/
HTH,
Tink
January 10, 2010 at 7:33 pm #17141rjd2MemberThanks for the tip! I think I need to re clarify what I am trying to do.
Non-Widget Solution
On my “Merchandise” page I have some T-shirts shown. I want the “Shopping Cart” area shown at all times below the shirts. This means it is shown whether there is anything in it or not. Is there a way to do this without showing the cart in a sidebar widget?
As for the widget solution, I am still having some trouble.
I downloaded the PHP Widgetify Plugin and am able to add the widget to the sidebar. I get the following error shown in the sidebar widget when looking at the page,
Fatal error: Call to undefined function eStore_shopping_cart() in /Users/user_name/Sites/wordpress/wp-content/plugins/php-widgetify/execphp.php(26) : eval()’d code on line 1
The function “eStore_shopping_cart()” doesn’t seem to work. Is there another function the widget should be calling to show the cart?
Thanks!
January 10, 2010 at 9:21 pm #17142TinkBDMemberHi – Can’t you just put the short code on the page?
<?php echo eStore_shopping_cart(); ?>
Also, that is the code I used with the PHP Widgetify Plugin…
Tink
PS – The Plugin page says:!IMPORTANT! You must use tags for the code to be recognized.
so be sure that you are using
<?php echo eStore_shopping_cart(); ?>
not just:
eStore_shopping_cart()
January 10, 2010 at 10:06 pm #17143amin007ParticipantPlease use the following shortcode on the post or page to display the cart even when it’s empty:
[wp_eStore_cart]
Also note that all the shortcodes and PHP references are listed on the documentation site:
http://www.tipsandtricks-hq.com/ecommerce/wp-estore-shortcodes-and-functions-reference-460
January 10, 2010 at 10:10 pm #17144amin007ParticipantI take it back… just realized you are using the Simple PayPal shopping cart and not the WP eStore.
You need to use the following function for the simple paypal shopping cart:
<?php echo print_wp_shopping_cart(); ?>
There is no available shortcode for it as of now.
January 10, 2010 at 10:41 pm #17145rjd2MemberThankyou both so much for the advise. I got it to work as I wanted.
I ended up downloading Exec-PHP (http://wordpress.org/extend/plugins/exec-php/) to allow for PHP in my page below my products. I entered this php code to show the cart, empty or full.
<?php echo print_wp_shopping_cart(); ?>
My question has been answered.
-
AuthorPosts
- You must be logged in to reply to this topic.