Changeset 3265731
- Timestamp:
- 04/02/2025 02:43:31 PM (12 months ago)
- Location:
- cartlink-generator
- Files:
-
- 6 edited
-
tags/1.0.2/cartlink-generator.php (modified) (2 diffs)
-
tags/1.0.2/includes/hooks.php (modified) (1 diff)
-
tags/1.0.2/readme.txt (modified) (2 diffs)
-
trunk/cartlink-generator.php (modified) (2 diffs)
-
trunk/includes/hooks.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cartlink-generator/tags/1.0.2/cartlink-generator.php
r3264731 r3265731 3 3 * Plugin Name: CartLink Generator for WooCommerce 4 4 * Description: Create dynamic cart links with pre-filled products, quantities, and custom prices, perfect for businesses interacting via chat to reduce purchase steps and drive faster conversions. 5 * Version: 1.0.2 5 * Version: 1.0.2.1 6 6 * Author: Guaven Labs 7 7 * Text Domain: cartlink-generator … … 18 18 define( 'GUAVEN_CARTLINK_GENERATOR_PATH', plugin_dir_path( __FILE__ ) ); 19 19 define( 'GUAVEN_CARTLINK_GENERATOR_URL', plugin_dir_url( __FILE__ ) ); 20 define( 'GUAVEN_CARTLINK_GENERATOR_VERSION', '1.0.2. 0');20 define( 'GUAVEN_CARTLINK_GENERATOR_VERSION', '1.0.2.1'); 21 21 22 22 -
cartlink-generator/tags/1.0.2/includes/hooks.php
r3264731 r3265731 55 55 56 56 57 add_action( 'woocommerce_after_calculate_totals', 'gvnclg_apply_fixed_subtotal_adjustment' );58 57 59 function gvnclg_apply_fixed_subtotal_adjustment( $cart ) { 58 add_action('woocommerce_cart_calculate_fees', 'gvnclg_apply_fixed_subtotal_adjustment', 20); 59 function gvnclg_apply_fixed_subtotal_adjustment($cart) { 60 if (is_admin() && !defined('DOING_AJAX')) return; 61 62 60 63 $fixed_subtotal = WC()->session->get( 'fixed_subtotal' ); 61 64 65 // Check if fee already exists to prevent multiple additions 66 $fees = $cart->get_fees(); 67 foreach ($fees as $fee) { 68 if ($fee->id === 'fixed-adjustment') { 69 return; // Fee already exists, don't add again 70 } 71 } 62 72 if ( $fixed_subtotal > 0 ) { 63 $cart->add_fee( __( 'Fixed Adjustment', 'cartlink-generator' ), -1 * $fixed_subtotal);73 $cart->add_fee(__('Fixed Adjustment', 'cartlink-generator'), -1*$fixed_subtotal, false); 64 74 } 65 75 } -
cartlink-generator/tags/1.0.2/readme.txt
r3264731 r3265731 8 8 WC tested up to: 9.8 9 9 Requires Plugins: woocommerce 10 Stable tag: 1.0.2 10 Stable tag: 1.0.2.1 11 11 License: GPLv2 or later 12 12 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 97 97 == Changelog == 98 98 99 = 1.0.2.1 = 100 * Fixing "Fixed Adjustment is always zero" bug. 101 99 102 = 1.0.2 = 100 103 * "Expire-dates are always 1 hour" bug fix -
cartlink-generator/trunk/cartlink-generator.php
r3264731 r3265731 3 3 * Plugin Name: CartLink Generator for WooCommerce 4 4 * Description: Create dynamic cart links with pre-filled products, quantities, and custom prices, perfect for businesses interacting via chat to reduce purchase steps and drive faster conversions. 5 * Version: 1.0.2 5 * Version: 1.0.2.1 6 6 * Author: Guaven Labs 7 7 * Text Domain: cartlink-generator … … 18 18 define( 'GUAVEN_CARTLINK_GENERATOR_PATH', plugin_dir_path( __FILE__ ) ); 19 19 define( 'GUAVEN_CARTLINK_GENERATOR_URL', plugin_dir_url( __FILE__ ) ); 20 define( 'GUAVEN_CARTLINK_GENERATOR_VERSION', '1.0.2. 0');20 define( 'GUAVEN_CARTLINK_GENERATOR_VERSION', '1.0.2.1'); 21 21 22 22 -
cartlink-generator/trunk/includes/hooks.php
r3264731 r3265731 55 55 56 56 57 add_action( 'woocommerce_after_calculate_totals', 'gvnclg_apply_fixed_subtotal_adjustment' );58 57 59 function gvnclg_apply_fixed_subtotal_adjustment( $cart ) { 58 add_action('woocommerce_cart_calculate_fees', 'gvnclg_apply_fixed_subtotal_adjustment', 20); 59 function gvnclg_apply_fixed_subtotal_adjustment($cart) { 60 if (is_admin() && !defined('DOING_AJAX')) return; 61 62 60 63 $fixed_subtotal = WC()->session->get( 'fixed_subtotal' ); 61 64 65 // Check if fee already exists to prevent multiple additions 66 $fees = $cart->get_fees(); 67 foreach ($fees as $fee) { 68 if ($fee->id === 'fixed-adjustment') { 69 return; // Fee already exists, don't add again 70 } 71 } 62 72 if ( $fixed_subtotal > 0 ) { 63 $cart->add_fee( __( 'Fixed Adjustment', 'cartlink-generator' ), -1 * $fixed_subtotal);73 $cart->add_fee(__('Fixed Adjustment', 'cartlink-generator'), -1*$fixed_subtotal, false); 64 74 } 65 75 } -
cartlink-generator/trunk/readme.txt
r3264731 r3265731 8 8 WC tested up to: 9.8 9 9 Requires Plugins: woocommerce 10 Stable tag: 1.0.2 10 Stable tag: 1.0.2.1 11 11 License: GPLv2 or later 12 12 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 97 97 == Changelog == 98 98 99 = 1.0.2.1 = 100 * Fixing "Fixed Adjustment is always zero" bug. 101 99 102 = 1.0.2 = 100 103 * "Expire-dates are always 1 hour" bug fix
Note: See TracChangeset
for help on using the changeset viewer.