diff --git a/Service/ProductData/AttributeCollector/Data/Price.php b/Service/ProductData/AttributeCollector/Data/Price.php index ff8d33d..082e837 100755 --- a/Service/ProductData/AttributeCollector/Data/Price.php +++ b/Service/ProductData/AttributeCollector/Data/Price.php @@ -111,22 +111,22 @@ public function execute( foreach ($this->products as $product) { $this->setPrices($product, $this->groupedPriceType, $this->bundlePriceType); - if (array_key_exists($product->getTaxClassId(), $this->taxClasses)) { - $percent = $this->taxClasses[$product->getTaxClassId()]; + + if (array_key_exists((int)$product->getTaxClassId(), $this->taxClasses)) { + $percent = $this->taxClasses[(int)$product->getTaxClassId()]; } else { $priceInclTax = $this->processPrice($product, (float)$this->price, $store); - if ($this->price == 0) { - $percent = 1; - } else { - $percent = $priceInclTax / $this->price; + $percent = $this->price == 0 ? 1 : round($priceInclTax / $this->price, 2); + if ($percent !== 1) { + $this->taxClasses[(int)$product->getTaxClassId()] = $percent; } - $this->taxClasses[$product->getTaxClassId()] = $percent; } + $result[$product->getId()] = [ 'price' => $percent * $this->price, - 'price_ex' => $percent * $this->price, + 'price_ex' => $this->price, 'final_price' => $percent * $this->finalPrice, - 'final_price_ex' => $percent * $this->finalPrice, + 'final_price_ex' => $this->finalPrice, 'sales_price' => $percent * $this->salesPrice, 'min_price' => $percent * $this->minPrice, 'max_price' => $percent * $this->maxPrice, diff --git a/composer.json b/composer.json index c989834..95856f5 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magmodules/magento2-sooqr", "description": "Sooqr integration for Magento 2", "type": "magento2-module", - "version": "2.1.3", + "version": "2.1.4", "license": [ "OSL-3.0", "AFL-3.0" diff --git a/etc/config.xml b/etc/config.xml index 8a549fd..f0b2e5e 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -11,7 +11,7 @@ 1 - v2.1.3 + v2.1.4 production diff --git a/etc/csp_whitelist.xml b/etc/csp_whitelist.xml index efaf769..d7c03f7 100755 --- a/etc/csp_whitelist.xml +++ b/etc/csp_whitelist.xml @@ -4,15 +4,27 @@ - *.sooqr.com - *.spotlersearch.com + *.sooqr.com + *.spotlersearch.com + + + + + *.sooqr.com + *.spotlersearch.com *.sooqr.com - *.spotlersearch.com - spotlersearchanalytics.com + *.spotlersearch.com + spotlersearchanalytics.com + + + + + *.sooqr.com + *.spotlersearch.com