Open
Description
Summary (*)
Magento 2.4-develop
I do have a module, where I am generating sales rules programatically. This module worked without andy problems in Magento Version 2.3.5.
No I am testing Version 2.4.1 and found, that SetFromDate and SetToDate is not working correct anymore.
Examples (*)
Here the relevant code lines I am using:
` $rule =$this->rule;
$rule->setName($name) // Rules name
->setDescription('Wertgutschein '.$name )
->setIsAdvanced(true)
->setStopRulesProcessing(false)
->setCustomerGroupIds([0, 1, 2, 3])
->setWebsiteIds([1])
->setUseAutoGeneration(0) // If want to auto generate
->setCouponType(RuleInterface::COUPON_TYPE_SPECIFIC_COUPON)
->setSimpleAction(RuleInterface::DISCOUNT_ACTION_FIXED_AMOUNT_FOR_CART)
->setUsesPerCoupon(1)
->setDiscountAmount($amount)
->setFromDate('2020-12-24') //Format YYYY-MM-DD
->setToDate('2039-04-14') //Format YYYY-MM-DD
->setIsActive(true);
$resultRules = $this->RuleRepository->save($rule);
`
The rule is generated, no problem, but the dates does show the following:
Proposed solution
Metadata
Metadata
Assignees
Labels
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmedA defect with this priority could have functionality issues which are not to expectations.Indicates original Magento version for the Issue report.The issue has been reproduced on latest 2.4-develop branchIssue related to Developer Experience and needs help with Triage to Confirm or Reject it