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