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 14 years, 7 months ago by amin007.
-
AuthorPosts
-
April 22, 2010 at 2:25 pm #1111VelmaGMember
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.
Thanks.
Velma
April 22, 2010 at 8:14 pm #20018VelmaGMemberI 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.
http://www.parse-error-unexpected-t-string.com/
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.
Velma
April 22, 2010 at 8:46 pm #20019VelmaGMemberTried using the Shortcode Widget too, and that didn’t work.
I’ve used up all my ideas for a workaround.
Velma
April 23, 2010 at 1:47 am #20020amin007ParticipantFirst 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 #20021VelmaGMemberYeah! 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!
Warmly,
Velma
April 23, 2010 at 8:49 am #20022amin007ParticipantYou 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)
-
AuthorPosts
- You must be logged in to reply to this topic.