Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #448 from Nosto/hotfix/group-prices-variation-with…
Browse files Browse the repository at this point in the history
…-price-zero

Fix Price Variation When Customer Group Variation Has Zero Price
  • Loading branch information
supercid authored Nov 9, 2018
2 parents 30ccbda + 8720cd0 commit 263973b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/code/community/Nosto/Tagging/Helper/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ protected function _getProductPrice(
$finalPrice,
$inclTax
);
if (!$price || $price <= 0) {
if ((!$price && $price !== 0) || $price < 0) {
/** @var Mage_Catalog_Model_Product_Type_Configurable $configurableProduct */
$configurableProduct = Mage::getModel('catalog/product_type_configurable');
$associatedProducts = $configurableProduct->getUsedProducts(null, $product);
Expand Down
7 changes: 7 additions & 0 deletions app/code/community/Nosto/Tagging/Model/Meta/Product/Trait.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ protected function buildProductPrice(Mage_Catalog_Model_Product $product, Mage_C
/** @var Nosto_Tagging_Helper_Price $priceHelper */
$priceHelper = Mage::helper('nosto_tagging/price');

/** @var Nosto_Tagging_Helper_Data $dataHelper */
$dataHelper = Mage::helper('nosto_tagging/data');
if ($dataHelper->isVariationEnabled($store)) {
// We need to set the default customer group here, otherwise Magento will
// return the price for the current user logged in group.
$product->setGroupPrice(Nosto_Tagging_Helper_Variation::DEFAULT_CUSTOMER_GROUP_ID);
}
return $priceHelper->getProductTaggingPrice($product, $store, true);
}

Expand Down

0 comments on commit 263973b

Please sign in to comment.