Skip to content

Commit

Permalink
Merge pull request #339 from mundipagg/bugfix/fixed-timezone-schedule…
Browse files Browse the repository at this point in the history
…d-promotions

🐛 fixed timezone when aplly scheduled promotion
  • Loading branch information
yanpantoja authored Oct 7, 2021
2 parents fa184c5 + 150e682 commit ccdd31f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Concrete/integrityData

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions Observer/CartAddProductAfterObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ public function execute(Observer $observer)
*/
public function addAmountRepetition(Item $item, $price)
{
$defaultTimezone = $this->timeZone->getDefaultTimezone();
date_default_timezone_set($this->timeZone->getConfigTimezone());

$currentRule = $this->getCatalogRule($item->getProduct());

if (
Expand All @@ -145,6 +148,8 @@ public function addAmountRepetition(Item $item, $price)

$discountAmount = $this->ruleModel->calcProductPriceRule($item->getProduct(), $price);

date_default_timezone_set($defaultTimezone);

if ($discountAmount == null) {
$discountAmount = $price;
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mundipagg/mundipagg-magento2-module",
"license": "MIT",
"version": "2.11.4",
"version": "2.11.5",
"type": "magento2-module",
"description": "Magento 2 Module Mundipagg",
"require": {
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="MundiPagg_MundiPagg" setup_version="2.11.4">
<module name="MundiPagg_MundiPagg" setup_version="2.11.5">
<sequence>
<module name="Magento_Sales" />
<module name="Magento_Payment" />
Expand Down

0 comments on commit ccdd31f

Please sign in to comment.