shipping

How to add a custom working Shipping Method in WooCommerce 3

不羁岁月 提交于 2019-12-05 04:11:23
I have successfully created a new shipping method and given it support for shipping zones. However when I come to select the method from the dropdown to add it to the zone it does not appear in the 'selected methods list'. I recorded a screencast gif to demonstrate: I can't for the life of me figure out why it's not working. It works fine if I select one of the standard methods ( Screencast GIF ) Anyone know what's going on here and how to get it to work? Here's the code that I have from this official thread: Shipping Method API : if ( in_array( 'woocommerce/woocommerce.php', apply_filters(

WooCommerce 2.6 - Hiding paid shipping when free shipping is triggered by reaching specific amount

两盒软妹~` 提交于 2019-12-05 00:38:23
问题 I recently updated to WooCommerce 2.6 on my shop and they have updated their shipping system. Before I used this to hide the paid shipping option when an specific order value was reached and free shipping was triggered: /** * woocommerce_package_rates is a 2.1+ hook */ add_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 10, 2 ); /** * Hide shipping rates when free shipping is available * * @param array $rates Array of rates found for the package * @param array

Change Woocommerce Order Status based on Shipping Method

北城余情 提交于 2019-12-04 18:34:47
The idea here is that when an order comes in with an "express delivery" as Shipping Method, the order status is updated to On-Hold. As there I have some different "express delivery" Shipping Method rates I thought that by using stristr() to see if the word 'express' appears anywhere in the formatted shipping method title. But I seem to be missing something as I don't get anything. How can I check if the Order shipping method is an "express delivery" to be able to update the order status? Here is the code that I have: add_action( 'woocommerce_thankyou', 'express_orders_4865', 10, 1 ); function

Add states for shipping zones instead of postcodes in Woocommerce

北慕城南 提交于 2019-12-04 04:48:47
问题 I have a woocommerce website. by default in woocommerce i can limit shipping zones by zipcode.... But How can I add states of my country in shipping zones so that customers can choose the state they live by a "dropdown menu" in checkout page instead of entering zip code ? I'm new to coding, so can someone pls tell me where to enter the codes as well. Please... 回答1: If states are not defined for your country in woocommerce, you should need to defined them all with a letter code (2 or 3

Magento - OnePage Checkout - Hide Payment method depending on Shipping Method

﹥>﹥吖頭↗ 提交于 2019-12-04 03:07:13
问题 I have asked this question on Magento Stackexchange without any success, hence me now asking here. I'm using Magento Community Edition 1.9.0.1 and have correctly created and registered my module, but I can't seem to detect the shipping methods. Basically, I want to hide Cash on Delivery if Flat Rate or Free Shipping is chosen. Here is the code I have for my observer class: class Kol_PaymentToggle_Model_Observer { public function paymentMethodIsActive(Varien_Event_Observer $observer) { $event

magento charge shipping as percentage of subtotal

给你一囗甜甜゛ 提交于 2019-12-03 22:44:53
Wanted to calculate a shipping cost on basis of percentage which is also manageable from admin. For E.g :- Shipping cost [ADMIN] : 10 If subtotal = 100. Then Shipping cost = 10. Thanks in advance. Alas got the answer. File copy from app/code/core/Mage/Shipping/Model/Carrier/Flatrate.php to --> local/Mage/Shipping/Model/Carrier/Flatrate.php About line 96 edit accordingly: if ($request->getFreeShipping() === true || $request->getPackageQty() == $this->getFreeBoxes()) { $shippingPrice = '0.00'; } //code starts here if ($this->getConfigData('shipper_type') == 'P') { $session = Mage::getSingleton(

Integrating Shipping with Ruby on Rails

血红的双手。 提交于 2019-12-03 21:58:25
What is the best method to include shipping quotes in my cart? The basic flow of my site is that 1.) User selects products 2.) User is shown cart 3.) repeat 1 and 2 until User wants to pay 4.) collect user details ( email, address where items will be shipped to ) 5.) make payment via active merchant 6.) order is submitted to distributor. I would like to insert a shipping information, so that the user can pay for his purchase + shipping costs via active merchant. 1.) User selects products 2.) User is shown cart 3.) repeat 1 and 2 until User wants to pay 4.) collect user details ( email, address

Display shipping cost on product page - WooCommerce

人盡茶涼 提交于 2019-12-03 17:29:17
I'm trying to make a custom page on Wordpress that display 2 subscription types in a form with 3 variations each (monthly, 6 month, 12 month). Each variation gets a radio button and I have a total price that is live updated when user clicks on the radio buttons. This part is working. But now, I want to add 3 other radio buttons to choose the shipment method. (When user select one, it'll live update the total price too). I've been searching a long time how to get shipping cost for a product but nothing has worked. Anyone knows :) ? This question is too broad. So I can answer partially as you

Finding the optimal 3D box sizes for a group of 3D rectangular items

你离开我真会死。 提交于 2019-12-03 16:17:14
When I say box I am talking about shipping boxes. I have a number of random sized, small items that I need to pack into as few boxes as possible. I need to know what box sizes are optimal. All items are rectangular prisms . It's easy to exclude a box size for an item which is too large to fit. I know the box sizes (they are the available box sizes which I have in-stock) Items can be positioned horizontally or vertically, not diagonal. As many boxes as required can be used. The goal is to use as few boxes as possible. Multiple box sizes may be used to optimally fit the varying-sized items. What

Customize Tax amount in “woocommerce_package_rates” hook

女生的网名这么多〃 提交于 2019-12-03 09:01:22
I recently tried to modify all my shipping rates with hook to apply discount. Here's my code : add_filter( 'woocommerce_package_rates', 'woocommerce_package_rates' ); function woocommerce_package_rates( $rates ) { $user_id = get_current_user_id(); if ( ! wc_memberships_is_user_active_member( $user_id, 'silver' ) ) { return $rates; } $discount_amount = 30; // 30% foreach($rates as $key => $rate ) { $rates[$key]->cost = $rates[$key]->cost - ( $rates[$key]->cost * ( $discount_amount/100 ) ); } return $rates; } But one more step is the tax ! I got wrong tax. For example I have my shipping rate who