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

Magento 2 - discount bases on Payment Method does not work? #5937

Closed
vigoss-ru opened this issue Aug 2, 2016 · 17 comments
Closed

Magento 2 - discount bases on Payment Method does not work? #5937

vigoss-ru opened this issue Aug 2, 2016 · 17 comments
Labels
bug report Event: distributed-cd Distributed Contribution Day Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@vigoss-ru
Copy link

vigoss-ru commented Aug 2, 2016

Preconditions:

  1. Have Magento 2.1.
  2. Install the sample data
  3. I go to Magento 2 Admin > Marketing > Promotions > Cart Price Rules and create a new Rule: Bank Transfer Payment.

Steps to reproduce

  • Tab Rule Information:
    Rule Name: Bank Transfer Payment
    Status: Active
    Websites: Main Website
    Customer Groups: select all
    Coupon: No Coupon
    Uses per Customer: 0
    From: blank
    To: blank
    Priority: 0
    Public in RSS Feed: No
  • Conditions tab:
    If ALL of these conditions are TRUE :
    Payment Method is Bank Transfer Payment
  • Actions Tab:
    Apply: percent of product price discount
    Discount Amount: 2
    Maximum Qty Discount is Applied To: 0
    Discount Qty Step (Buy X): 0
    Apply to Shipping Amount: No
    Discard subsequent rules: No
    Free Shipping: No
    Apply the rule only to cart items matching the following conditions (leave blank for all items): nothing

Then I enable Bank Transfer Payment method, go to checkout page

Expected result

  • When click on option Bank Transfer Payment, Discount Price should show up in Order Summary

Actual result

  • click on Bank Transfer Payment but the Discount Percent Price does not show up in Order Summary.

4

Please give me an advice. How can make a discount on payment method on Magento 2. For Magento 1, it works well.

Thanks very much

@vigoss-ru vigoss-ru changed the title Magento 2 - discount depend on Payment Method does not work Magento 2 - discount bases on Payment Method does not work Aug 2, 2016
@vigoss-ru vigoss-ru changed the title Magento 2 - discount bases on Payment Method does not work Magento 2 - discount bases on Payment Method does not work? Aug 2, 2016
@cizgidekiadam
Copy link

@DJ0815
Copy link

DJ0815 commented Jun 10, 2017

@rbostan it is not a 100% solution, it only works with a single domain.
I have a multi store with multidomains, www.domain.de, www.domain.com ....

when i try to checkout at www.domin.com (which is the standard domain) everything is working great, but when i try to checkout at www.domain.de i get the following script error:

XMLHttpRequest cannot load http://www.domain.com/mycart_updatepayment/checkout/applyPaymentMethod/?SID=52ad6cea0d0b55534a3817a0209639c2. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.domain.de' is therefore not allowed access.

The error is quite logical, but how can i avoid loading the script from standard domain? Any help would be apreciated. Thanks in advance.

@cizgidekiadam
Copy link

@DJ0815,
in server headers, you may set allowed origins something like that:

For apache, you should add to section in .htaccess file

SetEnvIf Origin "http(s)?://(www\.)?(domain.com|domain.de)$" AccessControlAllowOrigin=$0
Header add Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin

ref: https://stackoverflow.com/a/1850482

For nginx:

location /{
    # this will echo back the origin header
    if ($http_origin ~ "domain.de$") {
        add_header "Access-Control-Allow-Origin" $http_origin;
    }
}

ref: https://stackoverflow.com/a/12414239

@DJ0815
Copy link

DJ0815 commented Jun 10, 2017

Thanks for your fast reply, but i still get the error:

Request header field X-Requested-With is not allowed by Access-Control-Allow-Headers in preflight response.

For me with my bad english it sounds like, that there has been a disallowance before?

@cizgidekiadam
Copy link

@DJ0815 we all not Englishman, so could not be perfect in speaking :)
We are Magento people in here. It is fine with your English.

As in https://stackoverflow.com/a/40193633 , you should add more headers to be working.

For example apache

Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"

And nginx of course

add_header "Origin, X-Requested-With, Content-Type, Accept";

But i suggest that, you should do more research about headers. That headers usage might be dependent on your configuration/situation. It may be insecurable or unexpected behaviours for you.

@DJ0815
Copy link

DJ0815 commented Jun 12, 2017

It's getting more curious (for me). As i thought i had set all headers correctly, i have changed all webistes to the same domain, so I could exclude this problem.

But the Disount still was updated only at the default website, although you could see that the price was reloaded on checkout page on all websites.

  • The cart price rule is activated for all websites and all customer groups.
  • When i change the default website at Store->All Stores , the dicsount is working only for the new default webiste
  • All other cart price rules (which are activated in the cart) work as expected.

@mukdam
Copy link

mukdam commented Jun 20, 2017

Getting the same issue when we create for specifying payment method Magento, not recalculated rule which created in backend.

But know I am using http://magento.stackexchange.com/questions/128580/magento-2-discount-depend-on-payment-method-does-not-work but this not Magento Specified solution

@oleg-onufer
Copy link
Contributor

Hi @vigoss-ru.
Thanks for reporting this issue.
Internal ticket MAGETWO-70501 was created.

@veloraven veloraven added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jul 6, 2017
@keinereiner
Copy link

this issue is more than one year old and still not fixed... many other issues too.... why??? because of so many not fixed issues, we have many trouble with our clients.

@magento-engcom-team magento-engcom-team added bug report Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Sep 11, 2017
@EvanRijn
Copy link

EvanRijn commented Oct 2, 2017

In 2.1.8 the option is also not available in backend of magento.

@magento-engcom-team magento-engcom-team added Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Oct 2, 2017
@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed 2.1.x Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 10, 2017
@magento-engcom-team
Copy link
Contributor

@vigoss-ru, thank you for your report.
We've created internal ticket(s) MAGETWO-70501, MAGETWO-81449 to track progress on the issue.

@NikZh
Copy link

NikZh commented Mar 23, 2018

#distributed-cd

@magento-engcom-team
Copy link
Contributor

@NikZh thank you for joining. Please accept team invitation here and self-assign the issue.

@NikZh NikZh self-assigned this Mar 23, 2018
@magento-engcom-team
Copy link
Contributor

@NikZh Thank you for investigating.

@vigoss-ru thank you for your report. Please follow these guidelines for proper tracking of your issue. You can report Commerce-related issues in one of two ways:
You can use the Support portal associated with your account
or
If you are a Partner reporting on behalf of a merchant, use the Partner portal.

GitHub is intended for Magento Open Source users to report on issues related to Open Source only. There are no account management services associated with GitHub.

@shansari25
Copy link

any solution so far

@HendyIvan
Copy link

how about this issues? its happens on magento 2.3.0

@dbashyal
Copy link

sales_rule

Unable to create sales (cart price) rule as value of payment options is blank.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Event: distributed-cd Distributed Contribution Day Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests