Skip to content

Commit

Permalink
added filter duplicates to set/get config
Browse files Browse the repository at this point in the history
  • Loading branch information
FoulBachelor committed Oct 4, 2022
1 parent 74133bc commit 664001f
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions code/controllers/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,22 @@ public function getconfigAction()
'POWERSTEP_ENABLED' => Mage::helper('clerk')->getSetting('clerk/powerstep/active'),
'POWERSTEP_TYPE' => Mage::helper('clerk')->getSetting('clerk/powerstep/type'),
'POWERSTEP_TEMPLATES' => Mage::helper('clerk')->getSetting('clerk/powerstep/templates'),
'POWERSTEP_FILTER_DUPLICATES' => Mage::helper('clerk')->getSetting('clerk/powerstep/exclude_duplicates_powerstep'),

'EXIT_INTENT_ENABLED' => Mage::helper('clerk')->getSetting('clerk/exit_intent/active'),
'EXIT_INTENT_TEMPLATE' => Mage::helper('clerk')->getSetting('clerk/exit_intent/template'),

'CATEGORY_ENABLED' => Mage::helper('clerk')->getSetting('clerk/category/enabled'),
'CATEGORY_CONTENT' => Mage::helper('clerk')->getSetting('clerk/category/content'),
'CATEGORY_FILTER_DUPLICATES' => Mage::helper('clerk')->getSetting('clerk/category/exclude_duplicates_category'),

'PRODUCT_ENABLED' => Mage::helper('clerk')->getSetting('clerk/product/enabled'),
'PRODUCT_CONTENT' => Mage::helper('clerk')->getSetting('clerk/product/content'),
'PRODUCT_FILTER_DUPLICATES' => Mage::helper('clerk')->getSetting('clerk/product/exclude_duplicates_product'),

'CART_ENABLED' => Mage::helper('clerk')->getSetting('clerk/cart/enabled'),
'CART_CONTENT' => Mage::helper('clerk')->getSetting('clerk/cart/content'),
'CART_FILTER_DUPLICATES' => Mage::helper('clerk')->getSetting('clerk/cart/exclude_duplicates_cart'),

'LOG_ENABLED' => Mage::helper('clerk')->getSetting('clerk/log/enabled'),
'LOG_LEVEL' => Mage::helper('clerk')->getSetting('clerk/log/level'),
Expand Down Expand Up @@ -458,7 +462,12 @@ public function setconfigAction()
Mage::getConfig()->saveConfig($path, $value, 'stores', $storeid);
$count++;
}

if ($key == "POWERSTEP_FILTER_DUPLICATES"){
$path = 'clerk/powerstep/exclude_duplicates_powerstep';
Mage::getConfig()->saveConfig($path, $value, 'stores', $storeid);
$count++;
}

// exit intent
if ($key == "EXIT_INTENT_ENABLED"){
$path = 'clerk/exit_intent/active';
Expand All @@ -482,7 +491,12 @@ public function setconfigAction()
Mage::getConfig()->saveConfig($path, $value, 'stores', $storeid);
$count++;
}

if ($key == "CATEGORY_FILTER_DUPLICATES"){
$path = 'clerk/category/exclude_duplicates_category';
Mage::getConfig()->saveConfig($path, $value, 'stores', $storeid);
$count++;
}

// product
if ($key == "PRODUCT_ENABLED"){
$path = 'clerk/product/enabled';
Expand All @@ -494,7 +508,12 @@ public function setconfigAction()
Mage::getConfig()->saveConfig($path, $value, 'stores', $storeid);
$count++;
}

if ($key == "PRODUCT_FILTER_DUPLICATES"){
$path = 'clerk/product/exclude_duplicates_product';
Mage::getConfig()->saveConfig($path, $value, 'stores', $storeid);
$count++;
}

// cart
if ($key == "CART_ENABLED"){
$path = 'clerk/cart/enabled';
Expand All @@ -506,7 +525,11 @@ public function setconfigAction()
Mage::getConfig()->saveConfig($path, $value, 'stores', $storeid);
$count++;
}

if ($key == "CART_FILTER_DUPLICATES"){
$path = 'clerk/cart/exclude_duplicates_product';
Mage::getConfig()->saveConfig($path, $value, 'stores', $storeid);
$count++;
}
// log
if ($key == "LOG_LEVEL"){
$path = 'clerk/log/level';
Expand Down

0 comments on commit 664001f

Please sign in to comment.