Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Regarding print_eStore_buy_now_button
Tagged: Buy Now button
- This topic has 14 replies, 3 voices, and was last updated 13 years, 10 months ago by amin007.
-
AuthorPosts
-
December 23, 2010 at 6:30 am #2419sumeetMember
Hi,
i want ot use the direct buy now button using the above function with custom buy now image.
You have mentioned to put the custom image URL while adding the product but its not possible for me to keep it adding all the times.
I have a fixed custom image that should be displayed for buy now button for all the payments.
Can you provide me help on how can i achieve this ?
** To be clear, does the above function have some parameter to display the custom buy now image instead of the default buy now button ?**
Let me know.
December 23, 2010 at 11:34 pm #27607wpCommerceModeratoreStore shows the normal buy now button based on your theme’s CSS. So you will have to customize the code. But you should be able to show a custom buy now button with the following shortcode –
[wp_eStore_buy_now_custom_button id=1 button=http://your-domain.com/images/buy-now.gif]
Where “id” is the product-id and “button” is the url of the button image.
December 24, 2010 at 7:01 am #27608sumeetMemberHi,
I tried to use the below shortcode.
[wp_eStore_buy_now_custom_button id=1 button=http://your-domain.com/images/buy-now.gif]
But in the output, for src attribute of the image it displays
http://your-domain.com/images/buy-now.gif
because of which the image is not getting displayed.Any thoughts ?
Also, do you have any php function for the above shortcode that would allow me to embed this into the template file itself ?
let me know.
December 24, 2010 at 7:03 am #27609sumeetMemberThe editor has stripped the tags i believe.
in the output, for src attribute of the image it displays
http://your-domain.com/images/buy-now.gif
because of which the image is not getting displayed.
December 24, 2010 at 7:05 am #27610sumeetMemberin the output, for src attribute of the image it displays
<code>http://your-domain.com/images/buy-now.gif<code>
because of which the image is not getting displayed.not sure from where is the extra
<code>
coming from in the path?December 24, 2010 at 11:56 pm #27611wpCommerceModeratorDid you replace the URL with your actual button image URL? Please also post a link to the page where you are using the shortcode.
December 25, 2010 at 12:06 am #27612amin007ParticipantYou do understand that we don’t know the URL of the button image that you are trying to use. This is why the example shows you a dummy URL so you know how to use the shortcode. You need to replace the following URL with the actual URL of your image:
http://your-domain.com/images/buy-now.gif
December 25, 2010 at 9:18 am #27613sumeetMemberHi,
I believe i haven’t been able to post the exact problem.
Ok – yes, i did use the shortcode and i did replace it with actual image URL.Since am working on local system, am not able to show .
I used the following shortcode-
[wp_eStore_buy_now_custom_button id=1 button=http://192.168.1.240/zing/wp-content/uploads/2010/12/pay.gif]
Output of this is as below –
<input type="image" alt="Buy Now" class="eStore_buy_now_button" src="</code>http://192.168.1.240/zing/wp-content/uploads/2010/12/pay.gif<code>">
So as you see above,the src tag has additonal
<code>
tags added because of which the image path is wrong and hence not displayed.Hope this clarifies.
Any Thoughts ?
Also, does this tag have any function that can be used in template directly?
-Sumeet
December 25, 2010 at 2:12 pm #27614wpCommerceModeratorBefore you put that button URL in the shortcode you should always try pasting it in the browser to see if the URL is valid. I tried to check the URL but doesn’t look like it’s a valid URL.
December 27, 2010 at 5:34 am #27615sumeetMemberAs i mentioned..am working on my local server and hence,the URL wont be valid for you.
However,the path and everything else is perfect.
The only thing is the additonal
<code>
tags that are appearing in the src of the img after the shortcode is parsed and replaced.I hope you are getting my problem.This time i have explained it pretty clearly in the above post of mine.
**** I have asked thrice.If you are not getting the above problem atleast let me know if there is a CORRESPONDING TEMPLATE TAG (PHP FUNCTION) FOR ABOVE SHORTCODE THAT I CAN USE IN TEMPLATE FILES*****
December 28, 2010 at 1:17 am #27616amin007ParticipantThis plugin will never place a “code” block inside the src tag of an image. I am pretty sure you have another image manipulation plugin which is placing the code tag there. The problem is that you are working on a local machine so we cannot look at your site and check it to see what could be going wrong. Place it on a proper web site then let us know and we will take a look at it.
December 29, 2010 at 1:27 pm #27617sumeetMemberOk Fine.
Could you let me know if there is an equivalent php function for the shortcode
[wp_eStore_buy_now_custom_button id=1 button=http://your-domain.com/images/buy-now.gif]
that i could use directly in the template tag ?
December 29, 2010 at 8:38 pm #27618amin007ParticipantThe equivalent function would be the following:
echo print_eStore_buy_now_button($id,$button);
$id is the variable to hold the product ID number and $button is there for the button image URL.
January 7, 2011 at 7:48 am #27619sumeetMemberHi,
Is it possible by any way or setting in which i could just use
print_eStore_buy_now_button($id)
and a custom pay now image that would appear for all of these?To be more clear –
I have a custom pay now button clicking on which the user will be dircted to PayPal for pyment.(No Cart or anything).
In the backend, i will just mention the
[wp_eStore_buy_now id=1]
instead of passing the same custom image path all the time using the other shortcode[wp_eStore_buy_now_custom_button id=1 button=imagepath]
.So by using the above shortcode, it should display the custom image that i would have set somewhere.
I dont find any setting to set this custom Buy now image.
Any thoughts ?
January 8, 2011 at 3:21 am #27620amin007ParticipantYou can pass the button image URL to this function too. For example you can use the following:
print_eStore_buy_now_button($id,$button);
$button is the variable to hold the button image URL.
Here is an example of how to use it:
<?php
$id = 1;
$button = "http://example.com/some-image-url";
echo print_eStore_buy_now_button($id,$button);
?>You can’t just use “[wp_eStore_buy_now id=1]” which will display the button with the custom image.
-
AuthorPosts
- You must be logged in to reply to this topic.