Grab and display product thumbnail.

Discussion in 'PHP' started by oxplode, Feb 28, 2014.

  1. #1
    Hello, I want to grab the thumbnail associated with the product. e.g. I link to an amazon product or a homebase product and it shows the thumbnail image before the user clicks through to buy. How would I go about doing this?

    At the moment I can assigns an affiliate tag automatically to url's listed, depending on the merchant but fear I will have to scrap that and instead have to search a product feed to grab the product info including the thumbnail and assign my aff tag. It would be great if I didnt have to do this, so if there is any way? That would a great help!

    Thank you
     
    oxplode, Feb 28, 2014 IP
  2. progammer

    progammer Greenhorn

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #2
    I am not sure if I understood the question, it would be better if you show the code or provide a demo of what you are trying to achieve.

    You can add an attribute to your html tag like "data-thumb='url-to-product-thumb.tld/image.png'" and use jquery to display the thumb.
     
    progammer, Mar 2, 2014 IP
  3. oxplode

    oxplode Member

    Messages:
    52
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #3
    That actually looks perfect. Thank you for your reply! Something to work with.
     
    oxplode, Mar 2, 2014 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    Take a note that "data-thumb" is a HTML5 only attribute - it will probably work on other versions as well, but will throw errors. Just FYI
     
    PoPSiCLe, Mar 2, 2014 IP