Prestashop 1.7 Update shipping cost programatically through ajax when changing payment method - prestashop

I have created one custom shipping module in Prestashop 1.7 which will list multiple shipping carriers (like DHL, Fedex etc) on checkout page and in-order to fetch their shipping cost, i am calling their respective API by passing parameters of products like Size,,Weight,Length,Width etc.. to fetch their shipping cost. https://prnt.sc/LzQlgXZdPv3W
Now if we select Cash on Delivery payment method then i need to again call shipping carrier api to fetch new shipping price as shipping price will be different based on Cash on Delivery Payment method. Because COD payment method will be having higher shipping price as compare with other payment methods like Credit Card, Debit card etc.
Can anyone know how we can achieve this functionality ? as i need to update shipping price (by calling their API) through ajax when we change payment method on checkout page.

Related

Get Shipping rates for a product - Shopify

I couldn't found an endpoint(Shopify API REST or Shopify GraphQL) to get the shipping rates available for a product, quantity, and zip code.
The idea is a user in the PDP(Product detail page) select a quantity for a product, type a zip code and after that, I need to render the information (name of shipping and price) in PDP. This functionality is using the Shopify Rates not CarrierService custom
The answer to this was to use Draft Orders to simulate the Order and see the cost of Shipping

How does the Offer Quantity and Inventory Quantity change?

I am trying to create an Inventory Management application using the Ebay Sell APIs. When adding a product, I first add some quantity (say 100 T-Shirts) to the Inventory. Next, I make this inventory live by creating an offer and specifying the offer quantity (say 10 T-Shirts).
Now, my question is, when there is a successful sale of some of the inventory via an offer, does either of the offer quantity or inventory quantity change automatically? Or do I have to manually call bulkUpdatePriceQuantity to update the quantities?
PS: I would test this myself on the sandbox, however, I am unable to fetch orders due to some internal error on the eBay APIs

How do I refund a single item and shipping proportional to the item refunded?

I have an order with 3 different line items.
I need to refund 1 of those items (which is heavy and adds to the shipping price). Without this item I can reduce the price of the shipping by X.
How can I refund X? How can I automatically calculate how much I have to refund from the shipping? Does Shopify do that automatically?
The documentation example doesn't go too much in detail, it only states that you can send amount, but not how to figure out what the amount is.
Just refund the price of the item itself. Refunding a percentage of shipping? Who does that. I have never experience any e-commerce where you get shipping refunds. If I pay for shipping, I paid for something non-refundable.

Manually enter shipping costs when placing an order via webservice

Currently I am working on export orders from ebay to prestashop through my local application.
I fetching orders from eBay by API and I prepare the order as XML and send by Presta webservice to my webshop. I do not know how to solve the problem with shipping costs. On eBay I have a different shipping than in my shop, so I do not want to choose a carrier when ordering, but give a "shipping cost" manually. There is a possibility?

Shopify Multiple Shipping Addresses

Does anyone know if there's a way to integrate multiple shipping addresses into a Shopify website? Currently they only support one address per order. The website I'm currently working on is a gift shop so needs to allow customer the option to ship each item to a different address.
So far the only workaround I've come up with is to add shipping address fields as line item properties on the product page and disable/hide shipping fields in the checkout area. However, the concern then becomes sales tax. For this website any items shipped Washington State are subject to tax. So, I either need find a way to integrate multiple shipping addresses into the checkout or figure out how to add some sort of javascript/jQuery to calculate Washington State taxes on the product page and have it included in the product price when added to cart.
Any ideas about how to make this work would be appreciated, whether it's multiple shipping addresses or a product page tax calculation.