Skip to content

Commit

Permalink
[-] BO : FixBug #PSCSX-642 - Selected carriers not added
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromenadaud committed Feb 7, 2014
1 parent 4988905 commit 8076bb2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions controllers/admin/AdminProductsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1712,7 +1712,7 @@ public function processAdd()
if ($this->object->add())
{
PrestaShopLogger::addLog(sprintf($this->l('%s addition', 'AdminTab', false, false), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id);
$this->addCarriers();
$this->addCarriers($this->object);
$this->updateAccessories($this->object);
$this->updatePackItems($this->object);
$this->updateDownloadProduct($this->object);
Expand Down Expand Up @@ -3676,9 +3676,12 @@ protected function getCarrierList()
return $carrier_list;
}

protected function addCarriers()
protected function addCarriers($product = null)
{
if (Validate::isLoadedObject($product = new Product((int)Tools::getValue('id_product'))))
if (!isset($product))
$product = new Product((int)Tools::getValue('id_product'));

if (Validate::isLoadedObject($product))
{
$carriers = array();

Expand Down

0 comments on commit 8076bb2

Please sign in to comment.