[-] BO: Fix #PSCFV-7995 countries/groups/currencies refreshment when selecting a shop in specific price form

This commit is contained in:
Rémi Gaillard
2013-02-25 18:45:28 +01:00
parent ecd2fb0659
commit 95f43d3ac6
2 changed files with 76 additions and 1 deletions
+49 -1
View File
@@ -360,6 +360,54 @@ class AdminProductsControllerCore extends AdminController
return $result;
}
public function ajaxProcessGetCountriesOptions()
{
if (!$res = Country::getCountriesByIdShop((int)Tools::getValue('id_shop'), (int)$this->context->language->id))
return ;
$tpl = $this->createTemplate('specific_prices_shop_update.tpl');
$tpl->assign(array(
'option_list' => $res,
'key_id' => 'id_country',
'key_value' => 'name'
)
);
$this->content = $tpl->fetch();
}
public function ajaxProcessGetCurrenciesOptions()
{
if (!$res = Currency::getCurrenciesByIdShop((int)Tools::getValue('id_shop')))
return ;
$tpl = $this->createTemplate('specific_prices_shop_update.tpl');
$tpl->assign(array(
'option_list' => $res,
'key_id' => 'id_currency',
'key_value' => 'name'
)
);
$this->content = $tpl->fetch();
}
public function ajaxProcessGetGroupsOptions()
{
if (!$res = Group::getGroups((int)$this->context->language->id, (int)Tools::getValue('id_shop')))
return ;
$tpl = $this->createTemplate('specific_prices_shop_update.tpl');
$tpl->assign(array(
'option_list' => $res,
'key_id' => 'id_group',
'key_value' => 'name'
)
);
$this->content = $tpl->fetch();
}
public function ajaxProcessDeleteVirtualProduct()
{
if (!($id_product_download = ProductDownload::getIdFromIdProduct((int)Tools::getValue('id_product'))))
@@ -4251,4 +4299,4 @@ class AdminProductsControllerCore extends AdminController
}
}
}
}
}