Jump to content

Show second image of a product


giulym

Recommended Posts

Hello,

there is a way to show the second (or the last one) image of a product (not the main cover)? 
I found this but it isn't for the 1.7.5.1 version:
 

 public static function geImagesByID($id_product, $limit = 2){
        $id_image = Db::getInstance()->ExecuteS('SELECT `id_image` FROM `'._DB_PREFIX_.'image` WHERE `id_product` = '.(int)($id_product) . ' ORDER BY position ASC LIMIT 1, ' . $limit);
        $toReturn = array();
        if(!$id_image)
           return;
        else
           foreach($id_image as $image)
              $toReturn[] = $id_product . '-' . $image['id_image'];
        return $toReturn;
    } 

 

Link to comment
Share on other sites

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...