Code Monkey home page Code Monkey logo

Comments (5)

chocolata avatar chocolata commented on June 3, 2024 1

Hi Tobias, this works perfectly! This solves it completely. Thanks for your great work, appreciate it!

from oc-mall-plugin.

tobias-kuendig avatar tobias-kuendig commented on June 3, 2024

@chocolata the tax calculation is pretty complex and differs from country to country. You'll find sources that tell you to use the shipping address for tax calculations, others recommend to use the billing address.

If you change to using the billing address here and here, does it work for you?

from oc-mall-plugin.

chocolata avatar chocolata commented on June 3, 2024

Hi @tobias-kuendig ,

Thanks for your insights about taxes being dependent on shipping / billing country. I guess that setting is fine as it is then.

I've did some more digging and I found out that when a user is not logged in and is ordering for the first time, i.e. enters his billing / shipping address for the first time on the quick checkout page, there is no Ajax request that refreshes the page to recalculate the taxes. Whatever shipping or billing country I choose, the taxes stay the same...

Might this be something we missed? Or did I overwrite too much in my custom partial?

from oc-mall-plugin.

chocolata avatar chocolata commented on June 3, 2024

Hi, I've done some more digging and I've found this:

  1. Changing the shipping adress to the billing address for the tax calculation doesn't resolve the issue unfortunately.

  2. In the partial quickcheckout/countrystate.htm, there does seem to be an Ajax request tied to the country dropdown:

{% set id = type ~ '_country_id' %}
<div class="mall-form-control">
    <label for="{{ id }}">{{ 'offline.mall::frontend.form.country' | trans }}</label>
    {{ form_select_country(id, countryId, {
        id: id,
        emptyOption: ('offline.mall::frontend.select' | trans ),
        'data-request': 'onInit',
        'data-request-data' : ("type: '" ~ type ~ "'"),
        'data-request-success': '$.publish("mall.address.update")',
        'data-request-update': {
            (__SELF__ ~ '::countrystate'): ('#countryState_' ~ type)
        }
    }) }}>
    <div data-validate-for="{{ id }}"></div>
</div>

When I investigate the sourcecode though, it seems that the output might be malformed:

image

Do you think that expressions like &quot;quickCheckout::countrystate&quot;:&quot;#countryState_billing&quot; might be the cause?

I've reverted to the default quickCheckout partials that are shipped with Mall, but I am getting the same results.

  1. When users are logged in or have an active session after checking out as a guest and make a second purchase, everything works as it should and the appropriate taxes are applied.

Could you kindly have another look? Most people are running into this issue now, as most don't yet have an account...

P.S.: One important thing to mention. The product in my cart does not require shipping, as it is a virtual product, but as stated the tax is applied correctly when the users are logged in.

from oc-mall-plugin.

tobias-kuendig avatar tobias-kuendig commented on June 3, 2024

Hey @chocolata, give version v3.0.28 a try. I have added a workaround to calculate taxes for unregistered users based on their QuickCheckout country selection.

See 47c3455

from oc-mall-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.