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

Shipping Method cannot calculate shippingcosts based on "tax_subtotal" of the quote #3407

Open
EliasKotlyar opened this issue Jul 25, 2023 · 10 comments · May be fixed by #3408
Open

Shipping Method cannot calculate shippingcosts based on "tax_subtotal" of the quote #3407

EliasKotlyar opened this issue Jul 25, 2023 · 10 comments · May be fixed by #3408

Comments

@EliasKotlyar
Copy link
Contributor

Preconditions (*)

  1. OpenMage 19.4.*

Steps to reproduce (*)

  1. Create some custom module
  2. Custom Module should contain a Shipping Method
  3. Shipping Method should calculate Shipping based on "tax_subtotal" of the quote

Expected result (*)

It should behave like in Magento 1.9.4.x. Tax-Subtotal should be usable in the shipping calculation

Actual result (*)

You cannot use "tax-subtotal" in shipping method, as its not initialized yet with a value.

Dev-Info

In the Magento 1.9.4.4 there are following code in app/code/core/Mage/Tax/etc/config.xml, which is responsible for the sort order of total calculation:

                    <tax_subtotal>
                        <class>tax/sales_total_quote_subtotal</class>
                        <after>freeshipping</after>
                        <before>tax,discount</before>
                    </tax_subtotal>

(see https://github.com/OpenMage/magento-mirror/blob/magento-1.9/app/code/core/Mage/Tax/etc/config.xml#L165)

In Openmage, the code was changed to:

                    <tax_subtotal>
                        <class>tax/sales_total_quote_subtotal</class>
                       <after>subtotal,nominal,shipping,freeshipping</after>
                        <before>tax,discount</before>
                    </tax_subtotal>

Its unclear why it was done, but it seems to be some "upstream" upload from 1.9.3.x:
d92a24a

EliasKotlyar pushed a commit to EliasKotlyar/magento-lts that referenced this issue Jul 25, 2023
@ADDISON74
Copy link
Contributor

If I remember well we discussed about this issue before in PR #1104

@EliasKotlyar
Copy link
Contributor Author

I read the PR #1104 but for me its unclear what exactly is the outcome. Will it be left as it is, or is someone willing to merge the any of the PRs which are resolving this issue?

@fballiano
Copy link
Contributor

as I commented #1104 (comment) it is an extremely delicate change that should be tested extensively so, at this point in the release cycle, IMHO it is impossible to merge such a change.

also, from the description of the issue, it's really hard for us to replicate the problem and understand it completely.

@fballiano
Copy link
Contributor

This is the commit that introduced the change: d92a24a from 2018

@ADDISON74
Copy link
Contributor

ADDISON74 commented Jul 25, 2023

Please read my comment that I made here #1104 (comment).

There is a problem with the applied taxes in OpenMage and it should have been solved long time ago, especially the one related to the free delivery. Because it was not fixed I use only the <after>freeshipping</after> option in the config.xml file. This fix is from Magento 1.9.4.5.

An elegant solution would be that in the Backend to exist the possibility that in a multiselect field one or more options can be selected from the subtotal | nominal | shipping | freeshipping. I would leave the default version with all four options selected as before.

@fballiano
Copy link
Contributor

I really don't know much about this subject, I never had problems with this with my customers so I'll leave the discussion to somebody else.

@ADDISON74
Copy link
Contributor

This issue #1813 will help you understand what is going wrong and why we need to customize the options.

PR #1104 was supposed to solve the reported issues #80 and #1813 but it was closed without solid arguments.

@ADDISON74
Copy link
Contributor

I am evaluating to integrate this fix in OpenMage https://github.com/ikonoshirt/TopologicalSearch. It seems it was never fixed before.

@fballiano
Copy link
Contributor

@ADDISON74 it seems a great find and totally worth including it in the core!

@fballiano
Copy link
Contributor

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