Custom Tax calculation on checkout
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.
Comments
-
After shipment you have the payment step. You could register a plugin on
src/Pyz/Yves/CheckoutPage/CheckoutPageDependencyProvider.php
in the methodprotected 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.0 -
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?0 -
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 Step0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 92 Spryker News
- 1K Developer Corner
- 855 Spryker Development
- 93 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 36 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 35 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 34 Product & Business Questions
- 70 Spryker Safari Questions
- 51 Random