Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore General Questions › Override Button Image
- This topic has 12 replies, 3 voices, and was last updated 10 years ago by Russell58.
April 8, 2010 at 12:30 am #1036
Is there a way to locally override the Button Image URL setting for a particular product in a BIN link?
For example: I’ve specified a Button Image URL for a BIN link on my product pages and it works well.
Now I want to construct a summary page with text links for every product. If I use the shortcode as the linking mechanism, I reason it will show the button image, which is overriding the default Paypal button.
How can I use the shortcode (so I won’t have to define all my products again as separate products without the Button image URL) and create a text only Paypal link?
I hope that all makes sense!
garyApril 8, 2010 at 8:31 am #19471
You can use the following shortcode that allows your to specify the button image or text in the shortcode (locally):
1 is the product ID and The text “Buy Now” can be an URL for button image.
This method of usage is deprecated and not supported as people will eventually start to ask me for a shortcode that allows theme to override every aspect of the product locally but you can use it.April 8, 2010 at 8:31 pm #19472
garyApril 8, 2010 at 11:42 pm #19473
Tested the shortcode and does not work. Still inserts the Button Image URL defined with the product, rather than the text “Buy Now”.
garyApril 9, 2010 at 5:25 am #19474
Use this PHP code if you have a PHP executable plugin enabled on your site:
echo print_wp_eStore_buy_now_button($id, $button);
?>April 9, 2010 at 5:53 am #19475
Scratch that… I will add a new shortcode that will allow you to override the button image locally when you use the shortcode. For example:
[wp_eStore_buy_now_custom_button id=4 button=http://images.tipsandtricks-hq.com/my-product-banner/eMember-banner-125.gif]
Please request an update tomorrow and this feature should be in by then.April 9, 2010 at 11:14 am #19476
garyApril 17, 2010 at 7:49 pm #19477
I’m circling around back to this issue.
I requested and installed the update, and tried using the shortcode above with a locally-hosted image.
WP still only displays the actual text of the shortcode.
I don’t really want to use a PHP executable plugin — seems a great way to break the site.
Is there a more recent version of WP eStore even than 3.02?
My text only links are working now through ejunkie.com, but not tied into the WP eStore and WP eMember plugins to accomplish the post-processing I want to do on orders.
garyApril 18, 2010 at 1:23 am #19478
1) Where did you place the shortcode? If you placed the shortcode on the sidebar then please note that WordPress do not support shortcode on the sidebar widgets.
2) Can you please post the shortcode you used?
“I don’t really want to use a PHP executable plugin” – it’s entirely upto you to decide what plugin you want to use or not. Remember you can use a plugin that only enables PHP execution on the widget (e.g. http://wordpress.org/extend/plugins/php-code-widget) so it doesn’t mess up your post content.April 18, 2010 at 2:23 am #19479
To answer your questions:
1) The shortcode is placed on a Page.
2) I used this code, from above:
[wp_eStore_buy_now_custom_button id=4 button=http://URL_TO_MY_IMAGE]
Not criticizing your suggestion about the php executor; just seems all such plugins come with dire warning about using them in posts or pages. Widgets do seem to be more stable.April 18, 2010 at 11:07 pm #19480
You just needed to update the plugin so it has the shortcode functionality. Please have a look now and it should work fine.April 20, 2010 at 4:28 am #19481
Amin, it worked like a charm. Now I can get rid of all that clunky Paypal HTML button code!
garyMay 14, 2013 at 5:48 am #19482Russell58Member
Just saying thanks for this post.
I used the shortcode override to display a unique Add to Cart button instead of the default text from cart settings and it works beautifully!
[wp_eStore_buy_now_custom_button id=4 button=http://localbizvortex.com/wp-content/uploads/2013/05/buttonVadd.png]
Being shortcode, I did not need to install and run and PHP execute plugin (not keen on doing so due to php exploitation possibilities). Nice work,.. thanks again!
EDIT TO ABOVE: Just realized that in the current version of wp-store that I can nominate a custom cart image for each product which is even better because the shortcode method above works great for direct manual PayPal Buy Now buttons but the custom cart image per product option retains the cart process which is much better for my purposes as I’m using the Coupon option too. Love this plugin!
- You must be logged in to reply to this topic.