Custom Tax calculation on checkout

dipen.vyas
dipen.vyas Spryker Solution Partner Posts: 7 🧑🏻‍🚀 - Cadet

My b2b marketplace store. It has 4 stores and I want to integrate Tax calculation for my stores through ERP API calls.

On checkout page after shipment step, I want to make API call to ERP by providing customer and their region. Based on this, ERP will provide me the Tax values. which will be visible to customer.

How do I start implementing this for the checkout page? Any help would be appreciated.

Tagged:

Comments

  • Hidran Arias
    Hidran Arias Senior Technical Trainer Sprykee Posts: 110 ⚖️ - Guardians (admin)

    After shipment you have the payment step. You could register a plugin on
    src/Pyz/Yves/CheckoutPage/CheckoutPageDependencyProvider.php
    in the method

    protected function getCheckoutPaymentStepEnterPreCheckPlugins(): array
    {
    return [
    new QuoteApprovalCheckerCheckoutPaymentStepEnterPreCheckPlugin(),
    ];
    }

    You could also do it on the post conditions plugins of shipment step.
    You could then inject your data to the quoteTransfer.
    Try to cache the data to avoid unecessary calls to the ERP.
    If you want to do it by using Ajax in your view, then you have to extend the CheckPageController and add a method which would then call your service.

  • dipen.vyas
    dipen.vyas Spryker Solution Partner Posts: 7 🧑🏻‍🚀 - Cadet
    edited October 27

    Thanks for your reply. Doing this is enough? it will start displaying the custom tax we receive from the ERP?
    Did you mean to say I should make API call to ERP in this payment step Enter pre check plugin?

    In summary section it will start displaying automatically? Or setting the quote transfer would set the tax?

    Is it possible for you to share any small example?

  • Hidran Arias
    Hidran Arias Senior Technical Trainer Sprykee Posts: 110 ⚖️ - Guardians (admin)

    It depends on your business needs or how you handle that data.
    Does it depend on the shipping address? then you can can get that data after the execution of the Shipment Step