Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit dc80432

Browse files
committed
Save the price 0 as price in custom options
1 parent 373bd01 commit dc80432

File tree

1 file changed

+3
-3
lines changed
  • app/code/Magento/Catalog/Model/ResourceModel/Product/Option

1 file changed

+3
-3
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Option/Value.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected function _saveValuePrices(\Magento\Framework\Model\AbstractModel $obje
101101
$price = (double)sprintf('%F', $formattedPrice);
102102
$priceType = $object->getPriceType();
103103

104-
if ($object->getPrice() && $priceType) {
104+
if (isset($price) && $priceType) {
105105
//save for store_id = 0
106106
$select = $this->getConnection()->select()->from(
107107
$priceTable,
@@ -143,7 +143,7 @@ protected function _saveValuePrices(\Magento\Framework\Model\AbstractModel $obje
143143

144144
if ($scope == \Magento\Store\Model\Store::PRICE_SCOPE_WEBSITE
145145
&& $priceType
146-
&& $object->getPrice()
146+
&& isset($price)
147147
&& $object->getStoreId() != \Magento\Store\Model\Store::DEFAULT_STORE_ID
148148
) {
149149
$baseCurrency = $this->_config->getValue(
@@ -199,7 +199,7 @@ protected function _saveValuePrices(\Magento\Framework\Model\AbstractModel $obje
199199
}
200200
} else {
201201
if ($scope == \Magento\Store\Model\Store::PRICE_SCOPE_WEBSITE
202-
&& !$object->getPrice()
202+
&& !isset($price)
203203
&& !$priceType
204204
) {
205205
$storeIds = $this->_storeManager->getStore($object->getStoreId())->getWebsite()->getStoreIds();

0 commit comments

Comments
 (0)