fix tests
This commit is contained in:
@@ -86,6 +86,7 @@ class Product extends BaseI18nLoop
|
||||
Argument::createBooleanTypeArgument('current_category'),
|
||||
Argument::createIntTypeArgument('depth', 1),
|
||||
Argument::createBooleanOrBothTypeArgument('visible', 1),
|
||||
Argument::createIntTypeArgument('currency'),
|
||||
new Argument(
|
||||
'order',
|
||||
new TypeCollection(
|
||||
@@ -136,7 +137,16 @@ class Product extends BaseI18nLoop
|
||||
*/
|
||||
public function exec(&$pagination)
|
||||
{
|
||||
$currency = $this->request->getSession()->getCurrency();
|
||||
$currencyId = $this->getCurrency();
|
||||
if(null !== $currencyId) {
|
||||
$currency = CurrencyQuery::create()->findOneById($currencyId);
|
||||
if(null === $currency) {
|
||||
throw new \InvalidArgumentException('Cannot found currency id: `' . $currency . '` in product_sale_elements loop');
|
||||
}
|
||||
} else {
|
||||
$currency = $this->request->getSession()->getCurrency();
|
||||
}
|
||||
|
||||
$defaultCurrency = CurrencyQuery::create()->findOneByByDefault(1);
|
||||
$defaultCurrencySuffix = '_default_currency';
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ class ProductSaleElements extends BaseLoop
|
||||
* @param $pagination
|
||||
*
|
||||
* @return \Thelia\Core\Template\Element\LoopResult
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function exec(&$pagination)
|
||||
{
|
||||
@@ -115,7 +116,7 @@ class ProductSaleElements extends BaseLoop
|
||||
}
|
||||
|
||||
$currencyId = $this->getCurrency();
|
||||
if(null !== $currency) {
|
||||
if(null !== $currencyId) {
|
||||
$currency = CurrencyQuery::create()->findOneById($currencyId);
|
||||
if(null === $currency) {
|
||||
throw new \InvalidArgumentException('Cannot found currency id: `' . $currency . '` in product_sale_elements loop');
|
||||
|
||||
Reference in New Issue
Block a user