| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Use custom image for specific buttons? | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Use custom image for specific buttons?
I'm trying to change the 'ask a question about this product' link into an image. How can I do this?
The default code is: Code:
If I change the style to 'image', I get a small arrow button but not sure how to change that to my own image.
__________________
X-Cart 4.4.2 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Use custom image for specific buttons?
I am not going to test this one, but it looks like any image with a link that references:
"javascript: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid=`$product.productid`')" is going to work. So a standard setup for a linked image should be fine. ie: <a name="mypopuplink" id="mypopuplink" href="javascript: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid=`$product.productid`')"><i mg src="{ImagesDir}/mypopupimage.jpg" /></a> Then upload your image to skins/common_files/images or skins/images on older x-carts. The name and id attributes I defined may not be necessary, but it is a good practice to always assign something.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#3
|
|||||||
|
|||||||
Re: Use custom image for specific buttons?
I had already tried that, but the javascript didn't work.
__________________
X-Cart 4.4.2 |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Use custom image for specific buttons?
Sorry it was late, and I was tired....
<a name="mypopuplink" id="mypopuplink" href="javascript:void(0);" onclick="javascript: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid=2'); return false;"><img src="{ImagesDir}/mypopupimage.jpg" /></a> Still haven't tested it, but it should work fine. Edit: I have since tested this and it does work in at least IE9.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#5
|
|||||||
|
|||||||
Re: Use custom image for specific buttons?
Hi Mike,
After adding these codes the popup is not open.How to resolve this issue? Thanks. |
|||||||
#6
|
|||||||||
|
|||||||||
Re: Use custom image for specific buttons?
Hi Learner! I just tested this in my test site, and it works perfectly.
<a name="mypopuplink" id="mypopuplink" href="javascript:void(0);" onclick="javascript: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid=2'); return false;"><img src="{ImagesDir}/mypopupimage.jpg" /></a> I used the code you provided back to me so I can't imagine why this isn't working for you. Of course this link references "productid=2" and it is only going to work on the product page with that product id. Try: productid=`$product.productid` Hope that helps. Feel free to send me a coffee.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#7
|
|||||||
|
|||||||
Re: Use custom image for specific buttons?
Hi Mike,
Thanks for your help.After adding this code the pop up opens for sometime and after that it vanishes...Is it any java script error ?? How to resolve this issue? Kindly help me... |
|||||||
#8
|
|||||||||
|
|||||||||
Re: Use custom image for specific buttons?
Hi Learner, in response to your Pm:
You can see the code working on my test site: http://trainingpen.com/product.php?productid=17513&cat=0&page=&featured=Y Click the Xcart logo in the description. Here is the complete code from the template: <a name="mypopuplink" id="mypopuplink" href="javascript:void(0);" onclick="javascript: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid=17513'); return false;"> <img src="{ImagesDir}/admin_xlogo.gif" /> </a> Okay I think I see why this isn't working for you. It all has to do with the right productid not being assigned. See how I included the productid hard coded? Try: <a name="mypopuplink" id="mypopuplink" href="javascript:void(0);" onclick="javascript: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid={$product.productid}'); return false;"> <img src="{$ImagesDir}/admin_xlogo.gif" /> </a> That should do it. Sorry this was so difficult.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#9
|
|||||||
|
|||||||
Re: Use custom image for specific buttons?
Hi Mike,
Have you seen this in my site??click http://www.health-shoppe.com/TURMERIC-SKIN-and-ALLERGY-CARE/ and see Ask a question image and you will see that pop open and certain time it vanishes. I have added <a name="mypopuplink" id="mypopuplink" href="javascript:void(0);" onclick="javascript: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid={$product.productid}'); return false;"> <img src="{$ImagesDir}/myimage.jpg" /> </a> this code but not solved. How to resolve my issue? Thanks. |
|||||||
#10
|
|||||||||
|
|||||||||
Re: Use custom image for specific buttons?
Learner, look again at the code I posted. You appear to be missing the productid like I said. When I look at the source of the page, I see:
<a name="mypopuplink" id="mypopuplink" href="javascript:void(0);" onclick="javascript: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid=`$product.productid`'); return false;"><img src="skin/artistictunes_business/images/custom/ask02.jpg"></a> Change this to: <a name="mypopuplink" id="mypopuplink" href="javascript:void(0);" onclick="javascript: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid={$product.productid}'); return false;"><img src="skin/artistictunes_business/images/custom/ask02.jpg"></a> Remove the`` and add the{} around $product.productid What is happening, is the popup cannot figure out which product this is about. If you removed $product.productid and put the right productid for that product directly it will work as well. Like my original code: <a name="mypopuplink" id="mypopuplink" href="javascript:void(0);" onclick="javascript: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid=2'); return false;"><img src="{ImagesDir}/mypopupimage.jpg" /></a> This will work only if the productid is 2. If you change that number to your productid, it should work. I am simply telling you this so you will understand, obviously you want this to work on every product page, and you need to use the {$product.productid} to make that happen. But try it with the actual number put in if you need to test. Your site looks nice BTW.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
|||
X-Cart forums © 2001-2020
|