Jump to content

How to use external product image links in presta 1.6.1.6 (standard theme)?


Markus H.

Recommended Posts

Hello,

 

our shop sells among other some magazines and therefore we need to display the actual coverimage of the magazine as product image.

The magazin publisher provides us an link to an extern image of his magazin cover.

 

How we can use this link instead of an static image as product image? Some of the cover images will changed every week, so updating the static product image is not an option for us.

 

Thank you very much for tips and hints.

 

Markus

Link to comment
Share on other sites

Hi,

in order to achieve this, you can do the following:

import or update the external link of the product image into a custom column for the product in the database(create a new column in the database for product table), or in a feature(and hide that feature from the product page), and then override the getImageLink function in the Link class to return that specific link only for the products that have that external link defined(saved).

Regards, Leo

Link to comment
Share on other sites

Hi Leo,

 

thank you for your suggestion.

 

Someone in the german forum wrote a very simple, but useful solution for my problem. Using a redirect within the htaccess file of the webserver to redirect the image links to the external URL:

 

redirect /25-cart_default/test.jpg https://www.... the extern link to the coverimage

redirect /25-home_default/test.jpg https://www.... the extern link to the coverimage
redirect /25-large_default/test.jpg https://www.... the extern link to the coverimage
redirect /25-medium_default/test.jpg https://www.... the extern link to the coverimage
redirect /25-small_default/test.jpg https://www.... the extern link to the coverimage
redirect /25-thickbox_default/test.jpg https://www.... the extern link to the coverimage
 
This works like a charm and PS is scaling the images too, so there is no need to redirect to images in different sizes.
 
I am very happy with this.
 
Have  a nice weekend.
 
Kind regards, Markus
Link to comment
Share on other sites

  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...