View Single Post
  #1  
Old 12-09-2009, 03:31 AM
 
flamers flamers is offline
 

Advanced Member
  
Join Date: Nov 2004
Posts: 51
 

Default Add Button To Search An External Site

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
Reply With Quote