srslctv786 Posted January 23, 2017 Share Posted January 23, 2017 (edited) Bonjour à tous, Je suis en Prestashop 1.6.1.10 et en multi-boutique Pour préparer les commandes à expédier, on utilise le bordereau de livraison. Mon problème est le suivant : Je voudrais faire apparaître discrètement la quantité en stock restante pour chaque produit. Ainsi, en même temps, le préparateur pourrait contrôler le stock du produit qu il est entrain de prendre. J ai un peu creusé la question mais je n y arrive pas. Dans /pdf/delivery-slip.product-tab.tpl j ai remplacé : <td class="product center"> {if empty($order_detail.product_reference)} --- {else} {$order_detail.product_reference} {/if} </td> par <td class="product center"> {if empty($order_detail.product_reference)} --- {else} {$order_detail.product_reference} #{$order_detail.product_quantity_in_stock} {/if} </td> ... mais ça ne marche pas, il me retourne la quantité commandée Pouvez-vous m'aider ? Merci d'avance et bonne journée. Edited January 25, 2017 by srslctv786 (see edit history) Link to comment Share on other sites More sharing options...
srslctv786 Posted January 25, 2017 Author Share Posted January 25, 2017 (edited) Alors... je me répond à moi même et à ceux qui sont aussi intéressés. Dans /pdf/delivery-slip.product-tab.tpl j ai remplacé : <td class="product center"> {if empty($order_detail.product_reference)} --- {else} {$order_detail.product_reference} {/if} </td> par <td class="product center"> {if empty($order_detail.product_reference)} --- {else} {$order_detail.product_reference} #{$order_detail.product_quantity_in_stock} {/if} </td> ensuite ce qu'il me manquait Dans classes/PDF/HTMLTemplateDeliverySlip.php j'ai remplacé : if (Configuration::get('PS_PDF_IMG_DELIVERY')) { foreach ($order_details as &$order_detail) { if ($order_detail['image'] != null) { $name = 'product_mini_'.(int)$order_detail['product_id'].(isset($order_detail['product_attribute_id']) ? '_'.(int)$order_detail['product_attribute_id'] : '').'.jpg'; $path = _PS_PROD_IMG_DIR_.$order_detail['image']->getExistingImgPath().'.jpg'; $order_detail['image_tag'] = preg_replace( '/\.*'.preg_quote(__PS_BASE_URI__, '/').'/', _PS_ROOT_DIR_.DIRECTORY_SEPARATOR, ImageManager::thumbnail($path, $name, 45, 'jpg', false), 1 ); if (file_exists(_PS_TMP_IMG_DIR_.$name)) { $order_detail['image_size'] = getimagesize(_PS_TMP_IMG_DIR_.$name); } else { $order_detail['image_size'] = false; } } } } par if (Configuration::get('PS_PDF_IMG_DELIVERY')) { foreach ($order_details as &$order_detail) { if ($order_detail['image'] != null) { $name = 'product_mini_'.(int)$order_detail['product_id'].(isset($order_detail['product_attribute_id']) ? '_'.(int)$order_detail['product_attribute_id'] : '').'.jpg'; $path = _PS_PROD_IMG_DIR_.$order_detail['image']->getExistingImgPath().'.jpg'; $order_detail['image_tag'] = preg_replace( '/\.*'.preg_quote(__PS_BASE_URI__, '/').'/', _PS_ROOT_DIR_.DIRECTORY_SEPARATOR, ImageManager::thumbnail($path, $name, 45, 'jpg', false), 1 ); if (file_exists(_PS_TMP_IMG_DIR_.$name)) { $order_detail['image_size'] = getimagesize(_PS_TMP_IMG_DIR_.$name); } else { $order_detail['image_size'] = false; } } $order_detail['product_quantity_in_stock'] = StockAvailable::getQuantityAvailableByProduct($order_detail['product_id'],$order_detail['product_attribute_id']) ; } } en fait j'ai juste renseigné $order_detail['product_quantity_in_stock'] $order_detail['product_quantity_in_stock'] = StockAvailable::getQuantityAvailableByProduct($order_detail['product_id'],$order_detail['product_attribute_id']) ; Edited January 26, 2017 by srslctv786 (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