Tips and Tricks HQ Support Portal › Forums › Simple PayPal Shopping Cart › Simple shopping Cart Troubleshooting › Want to put Buy Now Buttons in Widget
- This topic has 5 replies, 2 voices, and was last updated 12 years, 11 months ago by amin007.
April 22, 2010 at 2:25 pm #1111
The Buy Now buttons are not compatible with the Table Plugin I’m using, so rather than giving up on either one of them I was thinking it would be best to put the buttons on the sidebar.
I used a text widget with the code and the code showed up…no button.
Is there a way to put the Buy Now buttons in the sidebar? I need 3 buy now buttons, and one of them will have the options dropdown.
The site is http://loveomylife.com in case you need that.
VelmaApril 22, 2010 at 8:14 pm #20018
I tried putting in “Samsarin PHP” plugin, and entered this code in the widget:
<?php echo print_wp_cart_button_for_product(’Emerald Wedding Site’, 1.00); ?>
(The $1 simply for testing purposes.)
I got a parse error.
Parse error: syntax error, unexpected T_STRING in /*****/wp-content/plugins/samsarin-php-widget/samsarin-php-widget.php(96) : eval()’d code on line 1
I tried the PHP Code Widget by Otto, and inserted the same code, and got a parse error as well.
Parse error: syntax error, unexpected T_STRING in /*****/wp-content/plugins/php-code-widget/execphp.php(44) : eval()’d code on line 1
When I look up “unexpected t_string”, it says it’s an error in the code.
So unfortunately I’m back at square one.
Oh, and the table that I was referencing above is at http://loveomylife.com/features … you’ll see the buttons there one on top of the other. Down a column works fine. I wanted them all in a single row, below the prices…so a buy now below each of the prices.
Thanks for your help.
VelmaApril 22, 2010 at 8:46 pm #20019
Tried using the Shortcode Widget too, and that didn’t work.
I’ve used up all my ideas for a workaround.
VelmaApril 23, 2010 at 1:47 am #20020amin007Participant
First of all.. PHP code doesn’t work in normal Text Widget.. you will need to get a PHP executable plugin that allows you to add PHP code (this is just like text widget but lets you execute PHP code) too.
Try the following page (read the “How to Display Button(s) on the Sidebar” secton) that will shed some light on this:
Once you get that plugin mentioned on that page then read the following
There is an error in the PHP line (the quotes around the product name)… try the following:
<?php echo print_wp_cart_button_for_product("Emerald Wedding Site", 1.00); ?>April 23, 2010 at 2:46 am #20021
Yeah! That worked!
By the way…as I shared in my post, I did use the plugin to put PHP in widgets…two of them. Got the parse errors.
And, I copied and pasted the php code I used from your website. http://www.tipsandtricks-hq.com/ecommerce/simple-wp-shopping-cart-installation-usage-290 It had the ‘ there, so that’s what I used.
Also, I’d like to include it in my Table. I’m using WP-Table Reloaded. It may be just a compatibility issue. I wanted to put the cart buttons in the bottom row in each column. It will not let me do that with the short code. The first short code shows up, but the two in the next cells don’t work.
I can do it one on top of the other in a column, but not side-by-side in a row. (I hope I’m explaining that clearly.
Anyway…if it’s a compatibility issue, I’m letting you know about it. If it’s something I’m doing incorrectly, I’d love to know what I’m doing wrong.
Thanks for the help. I truly appreciate it!
VelmaApril 23, 2010 at 8:49 am #20022amin007Participant
You didn’t do anything wrong… when you copied it, the font made the apostrophe weird.
The issue is that, both the pluings are using filter to replace the trigger text which doesn’t work when nested (WordPress introduced the proper shortcode API later)
- You must be logged in to reply to this topic.