Hi, I did what you showed but when I put in the amount it changes to free shipping but the flat rate price still shows in the cart, can you advise how to remove so only the free shipping shows and not both. Thanks
@Art-01 Жыл бұрын
Thank u for sharing, u are a life saver. I have a question, i havnt see tutorials about Crocoblock plugins, like Jet Engine, Jet Booking etc. i hope u make tutorials about their plugins too. Thank u again✌️
@soliderofAlmighty5 ай бұрын
Thanks but what if i want to free shipping on 1000 dollar to perticular state only
@Melissa_Lawrence Жыл бұрын
I seem to be struggling with trying to make my shipping have certain items free shipping and certain items charge. For example:I need to have it so that if a customer orders plants, they get that free, but if they also have fish in their cart, that has a shipping fee. For whatever reason I can't seem to get it to work, been driving myself mad for awhile trying to get this working now lol
@websquadron Жыл бұрын
Do the plants all have product ids as in just one product or many?
@Melissa_Lawrence Жыл бұрын
@@websquadron I cant believe I didn't see your response until now :( So yes, they all have their own product ID. I'll be super specific here, we have plants, aquatic snails and then fish. The fish all need to have a shipping charge (which I do currently have set up), but then everything else (plants, snails) need to be free shipping. Right now if you add live fish and snails to the cart, it charges the proper shipping of the 19.99, then if it's only the fish same thing, but when you have only the snails or plants which should be free shipping, it still wants to charge the 19.99. I have tried to watch so many videos and read alot of instructions but can't seem to find a fix for this specifically - now perhaps I'm just going crazy at this point and missing the answer/FIX because I have been trying for so long lol
@websquadron Жыл бұрын
Take a backup as I have not tested this ChatGPT Code: add_filter('woocommerce_package_rates', 'custom_shipping_rates', 10, 2 ); function custom_shipping_rates($rates, $package) { $has_fish_or_rabbit = false; $has_plants_or_trees = false; // Check if the package contains any products with the Fish or Rabbit categories foreach ( $package['contents'] as $item ) { if ( has_term( array('fish', 'rabbit'), 'product_cat', $item['product_id'] ) ) { $has_fish_or_rabbit = true; } } // Check if the package contains any products with the Plants or Trees categories foreach ( $package['contents'] as $item ) { if ( has_term( array('plants', 'trees'), 'product_cat', $item['product_id'] ) ) { $has_plants_or_trees = true; } } // If the package contains Fish or Rabbit, charge for shipping if ( $has_fish_or_rabbit ) { $rates['flat_rate']->cost = 5.00; // Set the shipping cost to $5.00 } // If the package contains Plants or Trees, offer free shipping if ( $has_plants_or_trees ) { $rates['free_shipping']->cost = 0.00; // Set the shipping cost to $0.00 } return $rates; }
@Melissa_Lawrence Жыл бұрын
@@websquadron you are amazing! I hadn;t even thought to check with ChatGPT to be honest, but even if I had thought about it, I have no clue what prompts to even use to come up with that lol I may have missed you answering this from missing the live videos lately, but have you opted in for the ChatGPT Pro at this point? I was considering doing it but haven't made my mind up yet. Thank you for taking the time to do this Imran! So where it says "If the package contains Plants or Trees, offer free shipping" I'm assuming I would change that to say the items that I have on this particular shop/website?