clunky
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce Advanced Free Shipping] Virtual productsHi Jeroen
I think this is the bit that I am confused with…
Woo seems to be adding the total cart cost and using it to calculate shipping.
I thought that it would ignore the virtual and therefore not count towards the shipping costs, but it doesn’t.
I understand the minimum spend bit but the shipping bit is causing me a problem.
If I create a virtual product (which is set in woo to not include any shipping), why does it add shipping in the cart if there is another physical product in there?
A customer did just this recently and ended up with free shipping for a physical item that should have cost him an extra £10?? (because the virtual item took him over the free shipping threshold).
Confused to say the least.Cheers
Forum: Plugins
In reply to: [WooCommerce Advanced Free Shipping] Virtual productsHi Jeroen
How would I adjust this to work with your plugin so that it could be used with all my AFS options?add_filter('woocommerce_package_rates', 'custom_free_shipping_option', 10, 2 ); function custom_free_shipping_option($rates, $package){ // HERE set the "minimum order amount" for free shipping $limit = 500; $free_total = 0; // Get the cart content total excluding virtual products foreach( WC()->cart->get_cart() as $cart_item ) if( ! $cart_item['data']->is_virtual( ) ) $free_total += $cart_item['line_total']; // Disabling free shipping method based on specific cart content total if( $free_total < $limit ) foreach ( $rates as $rate_key => $rate ) if( 'free_shipping' == $rate->method_id ) unset( $rates[ $rate_key ] ); return $rates; }
Cheers
Forum: Plugins
In reply to: [WooCommerce Advanced Free Shipping] Virtual productsHi Jeroen
I have another test woocommerce setup running, I have added a virtual product and a physical product to the cart.
There is a flat rate and free shipping level and can confirm that this too adds the virtual product cost to the shipping. (when you add more virtuals to the cart to attain the free shipping level, it kicks in)
Just curious…
How is it that it doesn’t exclude the virtual cost?
It seems that the virtual product is being ignored, is this a woo issue that no one has noticed?
I have searched the web but can’t find an answer.
CheersForum: Plugins
In reply to: [WooCommerce Advanced Free Shipping] Virtual productsHi Jeroen
I will speak to my client about this.
Just wanted to know, if the default woo setup, without your plugin, would add virtual costs to the cart?
CheersForum: Plugins
In reply to: [WooCommerce Advanced Free Shipping] Virtual productsHi Jeroen
Much appreciate you taking the time to go through this with me.
I have played about with one of my free shipping rates to see what this would do.
I can confirm that by adding a condition “category”-“not equal to”-“cat x” allows the user to add the virtual products along with physical products to the cart, but the subtotals don’t ever trigger the free shipping at all.It would be really great if your plugin had a tickbox to “ignore virtual products”.
Be really cool if there was a snippet which did this, but after trawling the web it doesn’t appear to look good.
In fact I have only found one other discussion; Exclude WooCommerce virtual product from counting towards free delivery, but it didn’t have a solution for me as its plugin specific.https://stackoverflow.com/questions/47781984/exclude-woocommerce-virtual-product-from-counting-towards-free-delivery
Cheers
Forum: Plugins
In reply to: [WooCommerce Advanced Free Shipping] Virtual productsHi Jeroen
You say “I’d recommend creating a custom condition though”…
I have currently 5 free shipping rates set up for different user roles, this custom condition would need to relate to each one of these.
Creating a new one which encompasses these would seem to be rather a lot of work.
As it doesn’t seem possible that the virtual product cost can be deducted from the subtotal to allow free shipping with mixed products in the cart….
Would adding a condition say “Category”-“not equal to”-“virtual category”, actually prevent the customer buying the virtual product along with a physical one, therefore not benefiting from the free shipping?
i.e. will it just ignore the virtual product?
Rather confused now ??
CheersForum: Plugins
In reply to: [WooCommerce Advanced Free Shipping] Virtual productsHi Jeroen
Does this link that I found in an older support post do what I’m really after?- https://gist.github.com/JeroenSormani/777fbfa3a4f4ccf4a0dd
I suppose that it boils down to woocommerce adding the virtual product cost to the physical cost at subtotal, and it’s not a conditional issue at all.
Cheers
Forum: Plugins
In reply to: [Booster for WooCommerce] Custom ShippingHi
Is there a way to get ‘left to free shipping’ working with my custom zones, ‘shipping by user role’ and ‘advanced free shipping’ ?
I have enabled the module and for the cart but nothing is displayed at any of the selected positions.
cheersForum: Plugins
In reply to: [Booster for WooCommerce] Custom Shippingadd_filter( 'woocommerce_package_rates', 'bbloomer_unset_shipping_when_free_is_available_in_zone', 10, 2 ); function bbloomer_unset_shipping_when_free_is_available_in_zone( $rates, $package ) { // Only unset rates if cheaper_shipping is available if ( isset( $rates['booster_custom_shipping_w_zones:6'] ) ) { unset( $rates['booster_custom_shipping_1'] ); } return $rates; }
This fixed it. ??
Forum: Plugins
In reply to: [Booster for WooCommerce] Custom ShippingHi @tom
Many thanks for you explanation, greatly appreciated.
I did discover the option to add Booster Custom shipping quite by accident.Maybe you can advise please…
I have user 3 roles
I need to use Shipping Methods by User Role and have set them all up.
Now my client has asked that an additional method be added.
The Guest role is set up with a rate set by rules in Custom Shipping and controlled by Shipping Methods by User Role.
To enable a ceiling for free shipping I have set up Advanced Free Shipping which takes care of that.So now my client wants to use UK postcodes to add extra shipping costs for postcodes included, but only for 1 user role.
I have added a Booster Custom shipping instance with all the postcodes, and added the required role, Guest, in Shipping Methods by User Role.The problem is this…
A guest adds items to their cart which is controlled accordingly by Booster: Custom Shipping Method #1, and also by Advanced Free Shipping.
The default flat rate for shipping shows correctly until the guest enters their postcode.
Once the postcode is entered the associated rate is displayed.
This behavior is correct, however the other shipping option is also displayed for the role, and being a cheaper option, open to misuse.I would like to know how to hide or remove the standard flat guest rate once the postcode is entered and Calculated shipping is complete.
I have been on this day and my head hurts…
I look forward to hearing back if you can help.
Cheers ??
- This reply was modified 7 years, 5 months ago by clunky.
And you, cheers.
If it helps anyone…<?php // calculate total weight & total qty $order_weight = 0; $order_total_qty = 0; $items = $this->order->get_items(); if( sizeof( $items ) > 0 ) { foreach( $items as $item ) { $order_total_qty += $item['qty']; $product = $wpo_wcpdf->export->order->get_product_from_item( $item ); if ( $product ) { $order_weight += $product->get_weight() * $item['qty']; } } } ?> <tr class="<?php echo apply_filters( 'wpo_wcpdf_item_row_class', $item_id, $wpo_wcpdf->export->template_type, $wpo_wcpdf->export->order, $item_id ); ?>"> <td class="product">Weight: <?php echo $order_weight; ?> <?php echo get_option('woocommerce_weight_unit'); ?><br/> </td><td class="quantity">Total <?php echo $order_total_qty; ?> items</td> </tr>
Hi figured it out.
Had to set upa new tr and td with the classes to get it to work.
CheersHi
I don’t wish to hijack this thread but I have tried to follow this and no matter what I get a 500 error.
As soon as I echo weight and qty it fails.
Debug shows this:
[03-Aug-2016 21:35:24 UTC] PHP Fatal error: Call to undefined method DOMText::getAttribute() in /home/chestnut/public_html/wp/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/lib/dompdf/include/cellmap.cls.php on line 437I have tried both invoice and slip in my custom templatebut neither example work.
Latest wordpress, woocommerce and your plugin.All I’m trying to get is the total weight of an order.
I look forward to hearing back if you can assist.
Cheers.