Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work if use date as condition for Catalog Price Rules #16855

Merged
merged 1 commit into from
Aug 10, 2018

Conversation

GlennCheng
Copy link
Member

@GlennCheng GlennCheng commented Jul 16, 2018

Description

Fix following issue:
Doesn't work if use date as condition for Catalog Price Rules.

Manual testing scenarios

  1. This problem happened when I go to Admin Panel -> MARKETING -> Catalog Price Rule,
    add or edit a Rule, then if use date as a condition, that condition doesn't work.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @GlennCheng. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me {$VERSION} instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@VladimirZaets
Copy link
Contributor

Hi @GlennCheng. Thanks for collaboration. Please provide more details and steps to reproduce this issue.

@miguelbalparda miguelbalparda self-assigned this Jul 16, 2018
@miguelbalparda
Copy link
Contributor

+1 to what @VladimirZaets said, the use of the template is mandatory.

@GlennCheng
Copy link
Member Author

@miguelbalparda @VladimirZaets
This problem happened when I go to Admin Panel -> MARKETING -> Catalog Price Rule,
add or edit a Rule, then if use date as a condition, that condition doesn't work.

In Rule/Model/Condition/AbstractCondition.php#Line:694
seems the function validateAttribute $value didn't strtotime, but that $validatedValue already, so have problem in the comparison.

In CatalogRule/Model/Rule/Condition/Product.php#Line:37:
$result = $this->validateAttribute($model->getData($attrCode));
"$model->getData($attrCode)" it's already setData by $model->setData($this->getAttribute(), $value) in Line:86 and that $value is strtotime form Line:102.
But in Rule/Model/Condition/AbstractCondition.php#Line:703:
$value = $this->getValueParsed(); this $value didn't strtotime.

@GlennCheng
Copy link
Member Author

@miguelbalparda
Hi, how is the progress now? did i need add information anymore?

@magento-engcom-team
Copy link
Contributor

Hi @GlennCheng. Thank you for your contribution.
We will aim to release these changes as part of 2.2.7.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants