mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-25 06:36:06 +03:00
Merge pull request #152 from sergeygw1990/master
Удаление типа цены товара для неустановленных акционных цен
This commit is contained in:
commit
a69c4be480
@ -1,3 +1,6 @@
|
||||
## v.3.3.3
|
||||
* Добавлено удаление типа цены товара для неустановленных акционных цен
|
||||
|
||||
## v.3.3.2
|
||||
* Добавлен возврат остатка товара при отмене заказа
|
||||
|
||||
|
@ -129,10 +129,12 @@ class ModelExtensionRetailcrmPrices extends Model
|
||||
$price = array();
|
||||
|
||||
foreach($productPrice as $k => $v) {
|
||||
|
||||
if (isset($this->settings[$this->moduleTitle . '_special_' . $k])) {
|
||||
$price[] = array(
|
||||
'code' => $this->settings[$this->moduleTitle . '_special_' . $k],
|
||||
'price' => $v == 0 ? $v : $v + $optionsValues['price']
|
||||
'price' => !$v['remove'] ? $v['price'] + $optionsValues['price'] : 0,
|
||||
'remove' => $v['remove']
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -168,13 +170,15 @@ class ModelExtensionRetailcrmPrices extends Model
|
||||
if ((isset($priority) && $priority > $special['priority'])
|
||||
|| !isset($priority)
|
||||
) {
|
||||
$productPrice[$special['customer_group_id']] = $special['price'];
|
||||
$productPrice[$special['customer_group_id']]['price'] = $special['price'];
|
||||
$productPrice[$special['customer_group_id']]['remove'] = false;
|
||||
$priority = $special['priority'];
|
||||
$groupId = $special['customer_group_id'];
|
||||
}
|
||||
} else {
|
||||
$productPrice[$special['customer_group_id']] = $special['price'];
|
||||
$productPrice[$special['customer_group_id']]['price'] = $special['price'];
|
||||
$groupId = $special['customer_group_id'];
|
||||
$productPrice[$special['customer_group_id']]['remove'] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -183,7 +187,7 @@ class ModelExtensionRetailcrmPrices extends Model
|
||||
|
||||
foreach ($customerGroups as $customerGroup) {
|
||||
if (!isset($productPrice[$customerGroup['customer_group_id']])){
|
||||
$productPrice[$customerGroup['customer_group_id']] = 0;
|
||||
$productPrice[$customerGroup['customer_group_id']]['remove'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,7 +205,7 @@ class ModelExtensionRetailcrmPrices extends Model
|
||||
$productPrice = array();
|
||||
|
||||
foreach ($customerGroups as $customerGroup) {
|
||||
$productPrice[$customerGroup['customer_group_id']] = 0;
|
||||
$productPrice[$customerGroup['customer_group_id']]['remove'] = true;
|
||||
}
|
||||
|
||||
return $productPrice;
|
||||
|
@ -62,7 +62,9 @@ class ModelRetailcrmPricesAdminTest extends OpenCartTest
|
||||
$this->assertEquals('special1', $price['prices'][0]['code']);
|
||||
$this->assertEquals('special2', $price['prices'][1]['code']);
|
||||
$this->assertEquals('special3', $price['prices'][2]['code']);
|
||||
$this->assertEquals(0, $price['prices'][2]['price']);
|
||||
$this->assertFalse($price['prices'][0]['remove']);
|
||||
$this->assertFalse($price['prices'][1]['remove']);
|
||||
$this->assertNotFalse($price['prices'][2]['remove']);
|
||||
}
|
||||
|
||||
private function sites(){
|
||||
|
Loading…
Reference in New Issue
Block a user