This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('cuw_offers_per_campaign', function ($limit, $campaign_type) { | |
| if (in_array($campaign_type, ['checkout_upsells', 'cart_upsells'])) { | |
| $limit = 10; | |
| } | |
| return $limit; | |
| }, 100, 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('cuw_coupon_base_url', function($url) { | |
| $url = 'https://www.example.com'; // here you can change your own url here | |
| return $url; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('cuw_show_upsell_item_text', '__return_false'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('wp_footer', function() { ?> | |
| <style> | |
| .cuw-fbt-products .cuw-product .cuw-product-checkbox { | |
| display: none; | |
| } | |
| </style> | |
| <script type="text/javascript"> | |
| jQuery(".cuw-fbt-products .cuw-product-wrapper .cuw-product-image").on('click', function() { | |
| return false; | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('wp_footer', function() { ?> | |
| <script type="text/javascript"> | |
| jQuery(document).ready(function () { | |
| jQuery(".cuw-fbt-products .cuw-product .cuw-product-checkbox").prop('checked', false); | |
| jQuery(".cuw-fbt-products .is_main .cuw-product-checkbox").prop('checked', true); | |
| jQuery(".cuw-fbt-products .cuw-buy-section .cuw-product:first .cuw-product-checkbox").prop('checked', true); | |
| }); | |
| </script> | |
| <?php | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('woocommerce_add_to_cart_redirect', function ($url) { | |
| if ('yes' === get_option('woocommerce_cart_redirect_after_add')) { | |
| $url = add_query_arg(['cuw_show_popup' => '1'], empty($url) ? wc_get_cart_url() : $url); | |
| } | |
| return $url; | |
| }, 100, 2); | |
| add_action('wp_footer', function () { | |
| if (isset($_GET['cuw_show_popup']) | |
| && method_exists('\CUW\App\Pro\Modules\Campaigns\UpsellPopups', 'getCampaignToDisplay') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global $cuw_offer_max_quantity; | |
| $cuw_offer_max_quantity = 4; // here you can change maximum upsell offer quantity to choose | |
| add_filter('cuw_offer_processed_data', function ($offer) use ($cuw_offer_max_quantity) { | |
| $offer['product']['max_qty'] = empty($offer['product']['max_qty']) || $offer['product']['max_qty'] > $cuw_offer_max_quantity ? $cuw_offer_max_quantity : $offer['product']['max_qty']; | |
| if (!empty($offer['product']['variants'])) { | |
| foreach ($offer['product']['variants'] as $key => $variant) { | |
| if (empty($variant['max_qty']) || $variant['max_qty'] > $cuw_offer_max_quantity) { | |
| $offer['product']['variants'][$key]['max_qty'] = $cuw_offer_max_quantity; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @media only screen and (max-width: 480px) { | |
| .cuw-fbt-products.cuw-mobile-responsive .cuw-gird { | |
| gap: 24px !important; | |
| justify-content: left !important;} | |
| .cuw-fbt-products.cuw-mobile-responsive .cuw-product { | |
| width: 120px !important; } | |
| .cuw-fbt-products.cuw-mobile-responsive .cuw-product-card { | |
| width: 120px !important; } | |
| .cuw-fbt-products.cuw-mobile-responsive .cuw-product-image { | |
| height: 120px !important; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter('cuw_upsell_popup_skip_product_is_already_in_cart', '__return_false'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('plugins_loaded', function () { | |
| if (function_exists('is_ajax') && is_ajax() && method_exists('CUW\App\Pro\Modules\Campaigns\ProductAddons', 'addProductsToCart')) { | |
| add_action('woocommerce_add_to_cart', ['\CUW\App\Pro\Modules\Campaigns\ProductAddons', 'addProductsToCart'], 15); | |
| } | |
| }); |