| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Add Button To Search An External Site | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() We have a DVD store, and have just affiliated with a Video on Demand supplier. What we want to do is to add a button to the product page inbetween the Add To Cart and Add To Wish List buttons which, when clicked, goes to the same product on the Video on Demand site.
Making the button is easy, we cloned the existing Add To Cart button and created a new template in Buttons. However, I can't get my head around how I pull the product name off the page to create the external hyperlink. In a nutshell, in customer/main/product.tpl the following code controls adding a product to the cart: {include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"} what we need to do is amend that to something like: {include file="buttons/video_on-demand.tpl" style="button" href="http://www.sitenamehere.com/search/super_search.jhtml?action=newSearch&sources=gl&sea rchTerms=TERM1+TERM2"} where sitenamehere is the external site, and TERM1 and TERM2 are the words in the item name conjoined by +. The code: http://www.sitenamehere.com/search/super_search.jhtml?action=newSearch&sources=gl&sea rchTerms= will never change So the question is: how can I suck the product name from the page and insert it into TERM1+TERM2? Any guidance would be appreciated.
__________________
X-Cart V 4.0.18 |
|||||||
#2
|
|||||||
|
|||||||
![]() Maybe try...
Code:
__________________
xcartmods.co.uk |
|||||||
#3
|
|||||||
|
|||||||
![]() Thanks PhilJ, tried it but I get an invalid attribute name error for this piece of code:
'$product.product|replace:" ":"+"'} The error message is: Fatal error: Smarty error: [in customer/main/product.tpl line 130]: syntax error: invalid attribute name: '":"+' (Smarty_Compiler.class.php, line 1524) I'm getting a bit lost because it's been a long and busy day and my head is swimming!
__________________
X-Cart V 4.0.18 |
|||||||
#4
|
|||||||
|
|||||||
![]() ok this'll work...
Code:
Code:
__________________
xcartmods.co.uk |
|||||||
#5
|
|||||||
|
|||||||
![]() Once again, thanks PhilJ, that works perfectly insofar as it pulls the product name down and inserts it into the hyperlink. However (you probably knew that was coming) the button isn't clickable, so I need to make that part work so it will actually direct the user off to the other site. I'd appreciate your, or anyone else's(!) help in the coding for this, and just to be REALLY demanding I would like it to open in a new window(target=_blank), thus leaving our site open so we don't lose the customer.
Thanks!
__________________
X-Cart V 4.0.18 |
|||||||
|
|||
X-Cart forums © 2001-2020
|