Jump to content

How to redirect Add to cart button to external urls in an elegant way?


Recommended Posts

Hello Presta expert,

 

I 've just started using prestashop for my online store. Can any expert help me on the way to get my Add to cart buttons redirect the user to external urls? How can I do it in an elegant way?

 

Thanks.

 

Joey

Link to comment
Share on other sites

Hello tomerg3,

 

My meaning of elegant way in term of implementation is actually achieving it with minimum of code change.

 

No, I would want different product Add to cart button redirect to different url.

 

Thanks for pointing the right way to do it in advance.

Link to comment
Share on other sites

There is no quick way of doing it.

We built a module for that for a certain client, it lets you set a URL for each product, you will need to edit each tpl file where you want to replace it (IE product-list , product.tpl).

 

The other option would be to use one of the existing Prestashop fields (IE location) for entering a link (this would mean you have to edit each product rather than do them in bulk), and you will still need to edit the tpl files and replace the add to cart button with the value from $product->location

  • Like 1
Link to comment
Share on other sites

Appreciate if you could share the portion of the .tpl that need to change in order to achieve the redirection.

 

If not I would want someone to help me to built this module. I will pay for this gig.

 

Thanks Joe.

Link to comment
Share on other sites

  • 7 months later...
×
×
  • Create New...