PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, August 23, 2022

[FIXED] How to calculate dynamic shipping amount based on address in Magento 2.4

 August 23, 2022     checkout, magento2, php, postmates, shipping     No comments   

Issue

In my shopping card build using Magento2.4.2 , I need a dynamic calculation of shipping amount after going to next step after entering the shipping address. What I need is to make a third party api call to calculate shipping value based on address entered. I begin with the following URL but It gives a static shipping value only. I have attached the screenshot of step1 and step2 which will make some sense of what I need. I want to customise the module given in the link to achieve this. I have reffed many articles but could not find a solution. Someone please help to achieve this. The code I have added in same as in the link here

Step 1 : After entering address Screen 1

Step 2 : Before finalising payment. Here the shipping should not be 0 it should vary according to the address value enter image description here

Note: I can manage to do the third party call, leave it for me, What I need is to get is where to hook the magento to modify the shipping value.

Thanks in advance


Solution

There is a good module to handle this kind of things that you may want to take a look at. I think it answer perfectly what you are trying to achieve. Owebia Shipping methods : https://owebia.com/doc/en/magento2-module-advanced-shipping

It's allowing you to add a config file that determines all available shipping methods, specify the prices using all the information you want from the cart and much more.



Answered By - Claims
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing