21 h.
15 h.
Voici le code correct:
CODE
protected function addCarriers($product = null)
{
if(Shop::isFeatureActive()
&& Shop::getContext() != Shop::CONTEXT_SHOP
) {
$check = Tools::getValue('multishop_check', array());
if(empty($check['availableCarriers'])) {
return;
}
}
if(!isset($product)) {
$product = new Product((int)Tools::getValue('id_product'));
}
if(Validate::isLoadedObject($product)) {
$carriers = Tools::getValue('selectedCarriers');
if(!is_array($carriers)) {
$carriers = array();
}
$product->setCarriers($carriers);
}
}