mirror of
https://github.com/retailcrm/opencart-module.git
synced 2024-11-25 22:56:07 +03:00
Merge pull request #153 from sergeygw1990/v3.1
Удаление типа цены товара для неустановленных акционных цен
This commit is contained in:
commit
0b478bc596
@ -1,3 +1,7 @@
|
|||||||
|
## v.3.1.4
|
||||||
|
* Добавлено удаление типа цены для неустановленных акционных цен
|
||||||
|
|
||||||
|
|
||||||
## v.3.1.3
|
## v.3.1.3
|
||||||
* Добавлена возможность передачи акционных цен для нескольких групп пользователей
|
* Добавлена возможность передачи акционных цен для нескольких групп пользователей
|
||||||
* Добавлена передача нулевой цены для неустановленных акционных цен
|
* Добавлена передача нулевой цены для неустановленных акционных цен
|
||||||
|
@ -120,7 +120,8 @@ class ModelExtensionRetailcrmPrices extends Model
|
|||||||
if (isset($settings[\Retailcrm\Retailcrm::MODULE . '_special_' . $k])) {
|
if (isset($settings[\Retailcrm\Retailcrm::MODULE . '_special_' . $k])) {
|
||||||
$price[] = array(
|
$price[] = array(
|
||||||
'code' => $settings[\Retailcrm\Retailcrm::MODULE . '_special_' . $k],
|
'code' => $settings[\Retailcrm\Retailcrm::MODULE . '_special_' . $k],
|
||||||
'price' => $v == 0 ? $v : $v + $optionsValues['price']
|
'price' => !$v['remove'] ? $v['price'] + $optionsValues['price'] : 0,
|
||||||
|
'remove' => $v['remove']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -146,7 +147,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;
|
||||||
@ -173,12 +174,14 @@ 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'];
|
||||||
|
$productPrice[$special['customer_group_id']]['remove'] = false;
|
||||||
$groupId = $special['customer_group_id'];
|
$groupId = $special['customer_group_id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -188,7 +191,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,9 @@ class ModelRetailcrmPricesAdminTest extends OpenCartTest
|
|||||||
$this->assertSame('special1', $price['prices'][0]['code']);
|
$this->assertSame('special1', $price['prices'][0]['code']);
|
||||||
$this->assertSame('special2', $price['prices'][1]['code']);
|
$this->assertSame('special2', $price['prices'][1]['code']);
|
||||||
$this->assertSame('special3', $price['prices'][2]['code']);
|
$this->assertSame('special3', $price['prices'][2]['code']);
|
||||||
$this->assertSame(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 getSites()
|
private function getSites()
|
||||||
|
Loading…
Reference in New Issue
Block a user