shipping

Magento 2 event/observer for create shipment

半城伤御伤魂 提交于 2021-02-19 06:05:32
问题 I'm trying to send an SMS notification to the client after creating a shipment. In M1 I can do that with this event: <sales_order_shipment_save_after> But in Magento 2 there is no event triggering after creating the shipment. Can anyone advise me, please? 回答1: you can use sales_order_shipment_save_after event for this you need to create etc/events.xml file to define your event <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=

Magento 2 event/observer for create shipment

自古美人都是妖i 提交于 2021-02-19 06:04:58
问题 I'm trying to send an SMS notification to the client after creating a shipment. In M1 I can do that with this event: <sales_order_shipment_save_after> But in Magento 2 there is no event triggering after creating the shipment. Can anyone advise me, please? 回答1: you can use sales_order_shipment_save_after event for this you need to create etc/events.xml file to define your event <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=

Magento 2 event/observer for create shipment

六眼飞鱼酱① 提交于 2021-02-19 06:04:56
问题 I'm trying to send an SMS notification to the client after creating a shipment. In M1 I can do that with this event: <sales_order_shipment_save_after> But in Magento 2 there is no event triggering after creating the shipment. Can anyone advise me, please? 回答1: you can use sales_order_shipment_save_after event for this you need to create etc/events.xml file to define your event <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=

Set all shipping methods cost to zero for a Free shipping coupon in Woocommerce

故事扮演 提交于 2021-02-19 05:31:19
问题 I have 3 shipping methods in my cart that should become zero prices as soon as your customer enters Free Shipping coupon. I know how to add a filter in functions.php to detect the coupon but is someone know a snippet to set shipping methods visibles in cart (radio button) to ZERO for this order? My deliveries methods are companies like UPS, FedEx... I activated the free shipping option in order it can be managed with coupon. The list of choice of deliveries methods for the customers is

Set all shipping methods cost to zero for a Free shipping coupon in Woocommerce

孤人 提交于 2021-02-19 05:31:17
问题 I have 3 shipping methods in my cart that should become zero prices as soon as your customer enters Free Shipping coupon. I know how to add a filter in functions.php to detect the coupon but is someone know a snippet to set shipping methods visibles in cart (radio button) to ZERO for this order? My deliveries methods are companies like UPS, FedEx... I activated the free shipping option in order it can be managed with coupon. The list of choice of deliveries methods for the customers is

Set cart shipping total amount issue after Woocommerce update

无人久伴 提交于 2021-02-18 19:33:02
问题 After the update my custom shipping amount rules are not working. Before the update I was using the following code to update shipping amount. add_action('woocommerce_calculate_totals', 'mysite_box_discount'); function mysite_box_discount($cart ) { $cart->shipping_total=100; return $cart; } After the update the structure of $cart array has changed and the above code has stopped working. Now the data coming in form of a protected array. I found that $cart->get_shipping_total(); can fetch me

Calculate a rough estimate for shipping box size

守給你的承諾、 提交于 2021-02-16 08:37:56
问题 I'm trying to find the best way to calculate the box size needed for shipping. I have 3 shipping containers with different sizes. I have the product's width, length, depth, and mass defined in the database. I would like to know how to find the smallest amount of boxes needed to ship, and also the smallest dimensions of those boxes given the number of items in the cart. My current 'idea' is to find the maximum width of the entire products array, the select a box according to it, and then split

how to add shipping cost with product actual price?

时间秒杀一切 提交于 2021-02-11 14:21:46
问题 I am using woocommerce plugin v2.2.8 for my eCommerce site. I am using weight based shipping method. Is there is any possibility to add shipping cost with products actual price which is displaying in product page? For Eg.. Product1 = Rs 800/- & shipping cost of this product is Rs 50/- Product1 price in shop page should be displayed as Rs 850/- (Actual price + shipping cost) Note: shipping cost calculated from weight based shipping method. Is this possible? Any idea regarding this??? 回答1:

WooCommerce check if free shipping is activated

倖福魔咒の 提交于 2021-02-10 19:49:36
问题 I want to show if free shipping is activated on my WooCommerce cart, to tell people "Hey, you've got free shipping!". Free shipping can be activated by either order amount or a coupon. I have tried this code, but it returns an empty array. global $woocommerce; $woocommerce->shipping->get_shipping_methods(); Otherwise I could have checked if free_shipping was set. Hope you all have some great ideas how to get this working :) 回答1: global $woocommerce; $shipping_methods = $woocommerce->shipping-