jd440 Posted August 27, 2013 Share Posted August 27, 2013 (edited) Bonjoru à tous. Je souhaite constituer un eail avec le contenu d'un panier. Mais je n'arrive pas à récupérer l'adresse de l'image ou plus préciusément son id: $panier = $cart->getProducts(); include(dirname(__FILE__).'/../../config/config.inc.php'); require_once(dirname(__FILE__).'/../../init.php'); $id_lang = 5; $cart = new Cart(93); if ($panier) { foreach($panier as $element) { $id_prod = $element['id_product']; $id_img = Image::getCover($element['id_product']); $image = $link->getImageLink($element['link_rewrite'], $id_img, 'large_6_4'); } } Quelqu'un aurais t il une idée? Edited August 28, 2013 by jd440 (see edit history) Link to comment Share on other sites More sharing options...
indesign47 Posted August 27, 2013 Share Posted August 27, 2013 Bonsoir, Peut-être ceci ? foreach ($images as $k => $image) $images[$k]['src'] = $this->context->link->getImageLink($product->link_rewrite[$this->context->language->id], $product->id.'-'.$image['id_image'], 'small_default'); $data->assign('images', $images); $data->assign('imagesTypes', ImageType::getImagesTypes('products')); 1 Link to comment Share on other sites More sharing options...
jd440 Posted August 27, 2013 Author Share Posted August 27, 2013 merci indesign. Le problèmne est que $id_img = Image::getCover($element['id_product']); est vide??? Alors qu'il y a bien est image et une cover de définit. Link to comment Share on other sites More sharing options...
indesign47 Posted August 27, 2013 Share Posted August 27, 2013 (edited) Etonnant ? Tu récupères bien id_product ? Ou alors la function ne te retourne pas la valeur ? /** *Get product cover * * @param integer $id_product Product ID * @return boolean result */ public static function getCover($id_product) { return Db::getInstance()->getRow(' SELECT * FROM `'._DB_PREFIX_.'image` i'. Shop::addSqlAssociation('image', 'i').' WHERE `id_product` = '.(int)$id_product.' AND image_shop.`cover`= 1'); } une petite idée : un autre panier, un autre produit, une autre image > même problème ? Edited August 27, 2013 by indesign (see edit history) Link to comment Share on other sites More sharing options...
jd440 Posted August 28, 2013 Author Share Posted August 28, 2013 Merci à toi. C'est un mystere. Du coup je l'ai intégré dans l'email et avec les histoire de contexte c'est bon. Merci encore à toi 1 Link to comment Share on other sites More sharing options...
indesign47 Posted August 28, 2013 Share Posted August 28, 2013 Ton premier post, sur le même sujet, m’intéresse. Lorsqu'il est complet, peux-tu mettre la solution ? www.prestashop.com/forums/topic/270523-le-contenu-du-panier-envoyer-par-mail/ Link to comment Share on other sites More sharing options...
jd440 Posted August 28, 2013 Author Share Posted August 28, 2013 (edited) ok Edited August 28, 2013 by jd440 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now