Skip to content

Commit

Permalink
Merge pull request #76 from magmodules/release/2.1.4
Browse files Browse the repository at this point in the history
Release/2.1.4
  • Loading branch information
Marvin-Magmodules authored Jul 9, 2024
2 parents 4659765 + a267af5 commit c9ffdb5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
18 changes: 9 additions & 9 deletions Service/ProductData/AttributeCollector/Data/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<sooqr_general>
<general>
<enable>1</enable>
<version>v2.1.3</version>
<version>v2.1.4</version>
</general>
<credentials>
<environment>production</environment>
Expand Down
20 changes: 16 additions & 4 deletions etc/csp_whitelist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,27 @@
<policies>
<policy id="style-src">
<values>
<value id="sooqr-static" type="host">*.sooqr.com</value>
<value id="spotlersearch-static" type="host">*.spotlersearch.com</value>
<value id="sooqr" type="host">*.sooqr.com</value>
<value id="spotlersearch" type="host">*.spotlersearch.com</value>
</values>
</policy>
<policy id="connect-src">
<values>
<value id="sooqr" type="host">*.sooqr.com</value>
<value id="spotlersearch" type="host">*.spotlersearch.com</value>
</values>
</policy>
<policy id="script-src">
<values>
<value id="sooqr-static" type="host">*.sooqr.com</value>
<value id="spotlersearch-static" type="host">*.spotlersearch.com</value>
<value id="spotlersearchanalytics-static" type="host">spotlersearchanalytics.com</value>
<value id="spotlersearch" type="host">*.spotlersearch.com</value>
<value id="spotlersearchanalytics" type="host">spotlersearchanalytics.com</value>
</values>
</policy>
<policy id="img-src">
<values>
<value id="sooqr" type="host">*.sooqr.com</value>
<value id="spotlersearch" type="host">*.spotlersearch.com</value>
</values>
</policy>
</policies>
Expand Down

0 comments on commit c9ffdb5

Please sign in to comment.