Free Shipping based on the Cart Price Total - Code Snippets - CodeSnippets, Wordpress

  Рет қаралды 1,214

Web Squadron

Web Squadron

Күн бұрын

Пікірлер: 10
@visualmodo
@visualmodo Жыл бұрын
Really good work!
@StevanOvich61
@StevanOvich61 Жыл бұрын
Nice, thanks ...
@tfanudecor_more
@tfanudecor_more 2 ай бұрын
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
@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✌️
@soliderofAlmighty
@soliderofAlmighty 5 ай бұрын
Thanks but what if i want to free shipping on 1000 dollar to perticular state only
@Melissa_Lawrence
@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
@websquadron Жыл бұрын
Do the plants all have product ids as in just one product or many?
@Melissa_Lawrence
@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
@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
@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?
Elementor's NEW Site Planner - First-Look Hands-On Review!
16:05
Web Squadron
Рет қаралды 7 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
I don't care if they can't afford it!
2:26
Web Squadron
Рет қаралды 1,4 М.
The Juicy Screenshots/Teasers - Elementor V4
14:41
Web Squadron
Рет қаралды 3,2 М.
How this LED Tech MADE IN CHINA is impacting the whole WORLD
15:54
Rafa Goes Around!
Рет қаралды 931
Redirect to a Custom Thank You Page After Checkout
3:16
Davis Senei
Рет қаралды 387
Swap Images with a Click
9:46
Web Squadron
Рет қаралды 2,2 М.
Elementor web.frwd Event 2025 - Live Reaction
9:42
Web Squadron
Рет қаралды 1,1 М.
Do this before asking any question.
2:18
Web Squadron
Рет қаралды 556
The Greatest One Page Shop - Cart - Checkout for Elementor
10:30
Web Squadron
Рет қаралды 1,9 М.
i launched a fake business in under an hour using AI agents
5:02
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН