Changeset 3430475
- Timestamp:
- 01/01/2026 11:23:16 AM (3 months ago)
- Location:
- taxonomy-discounts-woocommerce
- Files:
-
- 6 added
- 2 deleted
- 4 edited
- 1 copied
-
tags/7.0 (copied) (copied from taxonomy-discounts-woocommerce/trunk)
-
tags/7.0/.git (added)
-
tags/7.0/.github (added)
-
tags/7.0/.wordpress-org (added)
-
tags/7.0/includes/class-wc-taxonomy-discounts-webdados.php (modified) (6 diffs)
-
tags/7.0/languages (deleted)
-
tags/7.0/taxonomy-discounts-woocommerce.php (modified) (1 diff)
-
trunk/.git (added)
-
trunk/.github (added)
-
trunk/.wordpress-org (added)
-
trunk/includes/class-wc-taxonomy-discounts-webdados.php (modified) (6 diffs)
-
trunk/languages (deleted)
-
trunk/taxonomy-discounts-woocommerce.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
taxonomy-discounts-woocommerce/tags/7.0/includes/class-wc-taxonomy-discounts-webdados.php
r3404819 r3430475 79 79 $this->pro_addon_link = 'https://nakedcatplugins.com/product/taxonomy-term-and-role-based-discounts-for-woocommerce-pro-add-on/'; 80 80 81 // Load textdomain82 add_action( 'init', array( &$this, 'set_languages' ) );83 84 81 if ( is_admin() ) { 85 82 … … 110 107 public static function plugin_url() { 111 108 return plugins_url( '/', WCTD_FREE_PLUGIN_FILE ); 112 }113 114 /**115 * Load plugin text domain for translations116 *117 * Loads the plugin's translation files for internationalization support118 */119 public function set_languages() {120 load_plugin_textdomain( 'taxonomy-discounts-woocommerce' );121 109 } 122 110 … … 716 704 || 717 705 apply_filters( 'tdw_custom_product_loop', false ) 718 || 706 // || 707 // Not working if permalinks are enabled for this feed, for example https://wordpress.local/woocommerce_gpf/309edb4b77b4ed20/ 708 // Moved to PRO add-on 719 709 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 720 isset( $_GET['woocommerce_gpf'] ) // WooCommerce Google Product Feed - https://woocommerce.com/products/google-product-feed/710 // isset( $_GET['woocommerce_gpf'] ) // WooCommerce Google Product Feed - https://woocommerce.com/products/google-product-feed/ 721 711 ) { 722 712 if ( $this->debug ) { … … 912 902 if ( count( $discount_rules ) ) { 913 903 foreach ( $cart->cart_contents as $cart_item_key => $cart_item ) { 904 // Shop as Client Cart Price Changer compatibility - Set custom price, skip our calculations 905 if ( isset( $cart_item['sac_custom_price_to_set'] ) ) { 906 WC()->cart->cart_contents[ $cart_item_key ]['data']->set_price( $cart_item['sac_custom_price_to_set'] ); 907 continue; 908 } 909 // Go on 914 910 $applied_rule = false; 915 911 $_product = $cart->cart_contents[ $cart_item_key ]['data']; … … 1458 1454 */ 1459 1455 private function discount_information( $location ) { 1456 global $product; 1460 1457 $info = ''; 1461 1458 $found = false; 1462 1459 $discount_rules = self::get_discount_rules( true ); 1460 $product_id = $product->get_id(); 1463 1461 if ( count( $discount_rules ) ) { 1464 global $product; 1465 $product_id = $product->get_id(); 1466 $rule = self::get_product_applied_rule( $product ); 1462 $rule = self::get_product_applied_rule( $product ); 1467 1463 if ( ! empty( $rule ) ) { 1468 1464 ob_start(); … … 1530 1526 <?php 1531 1527 } 1532 echo wp_kses_post( apply_filters( 'tdw_discount_information_' . $product->get_id(), apply_filters( 'tdw_discount_information', ob_get_clean(), $product, $rule, $location ), $product, $rule, $location ) ); 1533 } 1528 // Echo passing through filters 1529 echo wp_kses_post( 1530 apply_filters( 1531 'tdw_discount_information_' . $product->get_id(), 1532 apply_filters( 1533 'tdw_discount_information', 1534 ob_get_clean(), 1535 $product, 1536 $rule, 1537 $location 1538 ), 1539 $product, 1540 $rule, 1541 $location 1542 ) 1543 ); 1544 } 1545 } 1546 // No rule found - Try to add to non-taxonomy discounts 1547 if ( ! $found ) { 1548 // Echo passing through filter 1549 echo wp_kses_post( 1550 apply_filters( 1551 'tdw_discount_information', 1552 '', 1553 $product, 1554 $rule, 1555 $location 1556 ) 1557 ); 1534 1558 } 1535 1559 } -
taxonomy-discounts-woocommerce/tags/7.0/taxonomy-discounts-woocommerce.php
r3404819 r3430475 3 3 * Plugin Name: Taxonomy/Term and Role based Discounts for WooCommerce 4 4 * Description: "Taxonomy/Term based Discounts for WooCommerce" lets you configure discount/pricing rules for products based on any product taxonomy terms and WordPress user roles 5 * Version: 6.25 * Version: 7.0-beta.1 6 6 * Author: Naked Cat Plugins (by Webdados) 7 7 * Author URI: https://nakedcatplugins.com -
taxonomy-discounts-woocommerce/trunk/includes/class-wc-taxonomy-discounts-webdados.php
r3404819 r3430475 79 79 $this->pro_addon_link = 'https://nakedcatplugins.com/product/taxonomy-term-and-role-based-discounts-for-woocommerce-pro-add-on/'; 80 80 81 // Load textdomain82 add_action( 'init', array( &$this, 'set_languages' ) );83 84 81 if ( is_admin() ) { 85 82 … … 110 107 public static function plugin_url() { 111 108 return plugins_url( '/', WCTD_FREE_PLUGIN_FILE ); 112 }113 114 /**115 * Load plugin text domain for translations116 *117 * Loads the plugin's translation files for internationalization support118 */119 public function set_languages() {120 load_plugin_textdomain( 'taxonomy-discounts-woocommerce' );121 109 } 122 110 … … 716 704 || 717 705 apply_filters( 'tdw_custom_product_loop', false ) 718 || 706 // || 707 // Not working if permalinks are enabled for this feed, for example https://wordpress.local/woocommerce_gpf/309edb4b77b4ed20/ 708 // Moved to PRO add-on 719 709 // phpcs:ignore WordPress.Security.NonceVerification.Recommended 720 isset( $_GET['woocommerce_gpf'] ) // WooCommerce Google Product Feed - https://woocommerce.com/products/google-product-feed/710 // isset( $_GET['woocommerce_gpf'] ) // WooCommerce Google Product Feed - https://woocommerce.com/products/google-product-feed/ 721 711 ) { 722 712 if ( $this->debug ) { … … 912 902 if ( count( $discount_rules ) ) { 913 903 foreach ( $cart->cart_contents as $cart_item_key => $cart_item ) { 904 // Shop as Client Cart Price Changer compatibility - Set custom price, skip our calculations 905 if ( isset( $cart_item['sac_custom_price_to_set'] ) ) { 906 WC()->cart->cart_contents[ $cart_item_key ]['data']->set_price( $cart_item['sac_custom_price_to_set'] ); 907 continue; 908 } 909 // Go on 914 910 $applied_rule = false; 915 911 $_product = $cart->cart_contents[ $cart_item_key ]['data']; … … 1458 1454 */ 1459 1455 private function discount_information( $location ) { 1456 global $product; 1460 1457 $info = ''; 1461 1458 $found = false; 1462 1459 $discount_rules = self::get_discount_rules( true ); 1460 $product_id = $product->get_id(); 1463 1461 if ( count( $discount_rules ) ) { 1464 global $product; 1465 $product_id = $product->get_id(); 1466 $rule = self::get_product_applied_rule( $product ); 1462 $rule = self::get_product_applied_rule( $product ); 1467 1463 if ( ! empty( $rule ) ) { 1468 1464 ob_start(); … … 1530 1526 <?php 1531 1527 } 1532 echo wp_kses_post( apply_filters( 'tdw_discount_information_' . $product->get_id(), apply_filters( 'tdw_discount_information', ob_get_clean(), $product, $rule, $location ), $product, $rule, $location ) ); 1533 } 1528 // Echo passing through filters 1529 echo wp_kses_post( 1530 apply_filters( 1531 'tdw_discount_information_' . $product->get_id(), 1532 apply_filters( 1533 'tdw_discount_information', 1534 ob_get_clean(), 1535 $product, 1536 $rule, 1537 $location 1538 ), 1539 $product, 1540 $rule, 1541 $location 1542 ) 1543 ); 1544 } 1545 } 1546 // No rule found - Try to add to non-taxonomy discounts 1547 if ( ! $found ) { 1548 // Echo passing through filter 1549 echo wp_kses_post( 1550 apply_filters( 1551 'tdw_discount_information', 1552 '', 1553 $product, 1554 $rule, 1555 $location 1556 ) 1557 ); 1534 1558 } 1535 1559 } -
taxonomy-discounts-woocommerce/trunk/taxonomy-discounts-woocommerce.php
r3404819 r3430475 3 3 * Plugin Name: Taxonomy/Term and Role based Discounts for WooCommerce 4 4 * Description: "Taxonomy/Term based Discounts for WooCommerce" lets you configure discount/pricing rules for products based on any product taxonomy terms and WordPress user roles 5 * Version: 6.25 * Version: 7.0-beta.1 6 6 * Author: Naked Cat Plugins (by Webdados) 7 7 * Author URI: https://nakedcatplugins.com
Note: See TracChangeset
for help on using the changeset viewer.