If you want to apply a discount by cart amount, this article tells how to do this and gives a snippet. Shortly, if the cart total is bigger than your target value, the cart total will be discounted.
Copy & paste the below code to your function.php:
// Woofocus - Discount snippet starts add_action( 'woocommerce_cart_calculate_fees', 'wf_apply_discount_by_cart_amount' ); function wf_apply_discount_by_cart_amount() { $wf_min_amount = get_option('wf_min_amount'); $wf_min_amount_discount = get_option('wf_min_amount_discount'); if(WC()->cart->subtotal > $wf_min_amount){ WC()->cart->add_fee( 'Fee', -$wf_min_amount_discount ); } } add_action( 'customize_register', 'wf_customizer_register' ); function wf_customizer_register( $wp_customize ) { // Create our panels $wp_customize->add_panel( 'wfdiscountpanel', array( 'title' => __('WooFocus discount Panel', 'wf'), ) ); // Create our sections $wp_customize->add_section( 'wf_discount_by_amount' , array( 'title' => __('Discount by amount', 'wf'), 'priority' => 1, 'panel' => 'wfdiscountpanel', ) ); // Create our settings $wp_customize->add_setting( 'wf_min_amount' , array( 'type' => 'option', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'wf_min_amount_control', array( 'label' => __('Minimum Amount for Discount', 'wf'), 'section' => 'wf_discount_by_amount', 'settings' => 'wf_min_amount', 'priority' => 1, 'type' => 'text', ) ); $wp_customize->add_setting( 'wf_min_amount_discount' , array( 'type' => 'option', 'transport' => 'refresh', ) ); $wp_customize->add_control( 'wf_min_amount_discount_control', array( 'label' => __('Discount Fee', 'wf'), 'section' => 'wf_discount_by_amount', 'settings' => 'wf_min_amount_discount', 'priority' => 1, 'type' => 'text', ) ); } // Woofocus - Discount snippet ends
After paste it, WooFocus Discount Panel will be added to the customizer menu as you can see on the picture.
Click “Discount by amount” buton
You can set your discount rule here.For example,
the subtotal on the image is 762.00, so it is bigger than 20 (Minumum Amount for Discount). It means this cart totals will be affected by discount.
762.00 – 400 ( Discount Fee ) equals the new cart total.
Don’t forget to click on the Save button to apply the discount by cart amount. Otherwise, you lose your changes.
For more WooCommerce Tutorials & Tricks, you can follow WooFocus.com.
What do you think?
Стильные советы по подбору превосходных луков на любой день.
Статьи профессионалов, события, все новинки и мероприятия.
https://mvmedia.ru/novosti/122-gde-luchshe-pokupat-originalnye-brendovye-veshchi-kak-vybrat-nadezhnye-magaziny-i-platformy/
Модные советы по выбору модных луков на любой день.
Мнения экспертов, события, все показы и мероприятия.
https://luxe-moda.ru/chic/564-10-prichin-lyubit-brend-brunello-cucinelli/
Стильные советы по созданию крутых луков на каждый день.
Заметки стилистов, события, все новые коллекции и шоу.
https://urban-moda.ru/all/749-za-chto-my-lyubim-brend-coach-ikona-amerikanskogo-stilya-i-masterstva/
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
very neat thank you,peerjournal
very neat thank you,medicineinsights
very neat thank you,pharmares
very neat thank you,peerreviewedjournals
experience and quality thank you.planetbioplastics
experience and quality thank you.osteriailcapodaglio
experience and quality thank you.lucagnizio
very neat thank you,jukumech
very neat thank you,kimmokakko
experience and quality thank you.ebiketime
experience and quality thank you.hoteldellaspina
experience and quality thank you.honefoss.bolkan
experience and quality thank you.heimdalbygg
experience and quality thank you.gjonnes-bygg
very neat thank you,fourcmanagement
very neat thank you,fourcmanagement
very neat thank you,federalnetworks
very neat thank you,federalnetworks
very neat thank you,fixcarsny
very neat thank you,fixcars
very neat thank you,floorbufferbrush
very neat thank you,greatneckcollision
very neat thank you,greenpowerchemical
very neat thank you,gmstowing
very neat thank you,handfordoil
experience and quality thank you.elgars
experience and quality thank you.pilotexamsdgca
very neat thank you,hamptonssepticservices
very neat thank you,horizonconceptinc
very neat thank you,housatonicpaper
very neat thank you,icsatc
very neat thank you,gritbrush
very neat thank you,goelectricnj
very neat thank you,icsatc
very neat thank you,imperialvendinginc
very neat thank you,industrialfinishings
very neat thank you,harrishardware
very neat thank you,insurancemarketingpros
very neat thank you,ircinc
very neat thank you,gettingerfeathers
experience and quality thank you.iasautomotive
very neat thank you,fninc
very neat thank you,sandvet
very neat thank you,tomscorvetteshop
very neat thank you,ttandlcontracting
very neat thank you,valley-stream-plumber
very neat thank you,blessingconstructionny
На этом ресурсе посетители можете ознакомиться с полезной информацией о лечении депрессии у людей старшего возраста. Здесь собраны советы и описания способов борьбы с данным заболеванием.
http://glazzette.com/uncategorized/hello-world/
Great! Thank you so much for sharing this. Visit my websitee: free stresser
I don’t think the title of your article matches the content lol. Just kidding, mainly because I had some doubts after reading the article.
Программа видеонаблюдения – это современный инструмент для обеспечения безопасности , сочетающий инновации и простоту управления.
На веб-ресурсе вы найдете детальные инструкции по выбору и настройке систем видеонаблюдения, включая облачные решения , их сильные и слабые стороны.
Программа видеонаблюдения
Рассматриваются комбинированные системы, сочетающие облачное и локальное хранилище , что делает систему универсальной и эффективной.
Важной частью является описание передовых аналитических функций , таких как определение активности, идентификация элементов и другие AI-технологии .
This extensive resource serves as an thorough guide to the world of modern video surveillance, offering valuable information for both experienced CCTV installers and business owners seeking to strengthen their security infrastructure.
Video Surveillance
The site offers a detailed analysis of remote video surveillance systems, exploring their advantages, limitations, and practical applications.
На этом сайте размещены свежие события РФ и всего мира.
Здесь можно прочитать значимые новостные материалы по разным темам .
https://ecopies.rftimes.ru/
Следите за ключевых событий ежедневно .
Проверенная информация и актуальность в каждом материале .
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.