Changeset 3352802
- Timestamp:
- 08/29/2025 05:13:14 PM (7 months ago)
- Location:
- notification-for-telegram
- Files:
-
- 1 deleted
- 7 edited
- 4 copied
-
tags/3.4.6 (copied) (copied from notification-for-telegram/trunk)
-
tags/3.4.6/include/nftb_optionpage.php (modified) (4 diffs)
-
tags/3.4.6/index.php (copied) (copied from notification-for-telegram/trunk/index.php) (5 diffs)
-
tags/3.4.6/readme.txt (modified) (2 diffs)
-
tags/xx (copied) (copied from notification-for-telegram/trunk)
-
tags/xx/assets (deleted)
-
tags/xx/include/nftb_optionpage.php (modified) (4 diffs)
-
tags/xx/index.php (copied) (copied from notification-for-telegram/trunk/index.php) (5 diffs)
-
tags/xx/readme.txt (modified) (2 diffs)
-
trunk/include/nftb_optionpage.php (modified) (4 diffs)
-
trunk/index.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
notification-for-telegram/tags/3.4.6/include/nftb_optionpage.php
r3337166 r3352802 26 26 27 27 //TAB3 28 if ($field == "ORDERS" || $field == "notify_woocomerce_order" || $field == "order_trigger" || $field == "price_with_tax" || $field == "hide_bill" || $field == "hide_ship" || $field == "hide_phone" || $field == "WOO PREFERENCES" || $field == "notify_woocomerce_checkoutfield" || $field == "notify_woocomerce_checkoutext" || $field == "notify_woocomerce_order_change" || $field == "notify_woocomerce_addtocart_item" || $field == "notify_woocomerce_remove_cart_item" || $field == "hide_edit_link" ) {28 if ($field == "ORDERS" || $field == "notify_woocomerce_order" || $field == "order_trigger" || $field == "price_with_tax" || $field == "hide_bill" || $field == "hide_ship" || $field == "hide_phone" || $field == "WOO PREFERENCES" || $field == "notify_woocomerce_checkoutfield" || $field == "notify_woocomerce_checkoutext" || $field == "notify_woocomerce_order_change" || $field == "notify_woocomerce_addtocart_item" || $field == "notify_woocomerce_remove_cart_item" || $field == "hide_edit_link" || $field == "hide_prods_list" ) { 29 29 $prefname = "telegram_notify_option_name_tab3"; 30 30 } … … 536 536 __('Show prices including tax ', 'notification-for-telegram'), // title 537 537 array($this, 'price_with_tax_callback'), // callback 538 'telegram-notify-admin_tab3', // page 539 'telegram_notify_setting_section_tab3' // section 540 ); 541 542 add_settings_field( 543 'hide_prods_list', // id 544 __('Hide products list.', 'notification-for-telegram'), // title 545 array($this, 'hide_prods_list_callback'), // callback 538 546 'telegram-notify-admin_tab3', // page 539 547 'telegram_notify_setting_section_tab3' // section … … 973 981 } 974 982 983 if (isset($input['hide_prods_list'])) { 984 $sanitary_values['hide_prods_list'] = $input['hide_prods_list']; 985 } 986 975 987 if (isset($input['hide_phone'])) { 976 988 $sanitary_values['hide_phone'] = $input['hide_phone']; … … 1637 1649 } 1638 1650 } 1651 1652 1653 public function hide_prods_list_callback() 1654 { 1655 printf( 1656 '<label class="telegram-notify-switch"><input type="checkbox" name="telegram_notify_option_name_tab3[hide_prods_list]" id="hide_prods_list" value="hide_prods_list" %s><span class="telegram-notify-slider"></span> 1657 </label><label for="hide_prods_list">' . __('Hide the product list in the notification message and only display the item count. 1658 1659 ', 'notification-for-telegram') . '</label>', 1660 (isset($this->telegram_notify_options_tab3['hide_prods_list']) && $this->telegram_notify_options_tab3['hide_prods_list'] === 'hide_prods_list') ? 'checked' : '' 1661 ); 1662 if (is_plugin_active('woocommerce/woocommerce.php')) { 1663 ?><script> 1664 document.getElementById("hide_prods_list").enable = true; 1665 </script><?php 1666 } else { ?><script> 1667 document.getElementById("hide_prods_list").disabled = true; 1668 document.querySelector("label[for=hide_prods_list]").innerHTML = "<?php _e('Plug not Active or Installed', 'notification-for-telegram') ?>"; 1669 </script><?php 1670 } 1671 } 1672 1639 1673 1640 1674 public function hide_bill_callback() -
notification-for-telegram/tags/3.4.6/index.php
r3337653 r3352802 4 4 * Plugin URI: https://www.reggae.it/my-wordpress-plugins 5 5 * Description: Sends notifications to Telegram when events occur in WordPress. 6 * Version: 3.4. 56 * Version: 3.4.6 7 7 * Author: Andrea Marinucci 8 8 * Author URI: … … 539 539 get_woocommerce_currency_symbol(); 540 540 $linea = ""; 541 541 $numprod = 0; 542 542 foreach ($order->get_items() as $item_id => $item) { 543 $numprod = $numprod +1; 543 544 $extrafiledhook = ""; 544 545 $lineatemp = ""; … … 654 655 $defmessage = $defmessage . $order_count; 655 656 656 //retrocompatibilta per vecchia funziome 657 if (function_exists('nftb_order_before_items')) { 658 659 $defmessage = $defmessage . "\r\n"; 660 $defmessage = $defmessage . nftb_order_before_items($order_id); 661 $defmessage = $defmessage . "\r\n"; 662 } 663 664 // HOOKS nftb_order_before_items_hook 665 $nftb_order_before_items_hook = apply_filters('nftb_order_before_items_hook', $order_id); 666 if (has_filter('nftb_order_before_items_hook')) { 667 $defmessage = $defmessage . $nftb_order_before_items_hook; 668 } 669 670 671 672 673 $defmessage .= "\r\n\r\n------ " . __('ITEMS', 'notification-for-telegram') . " ------\r\n"; 674 675 $defmessage = $defmessage . $linea; 676 $defmessage = $defmessage . "-------------------"; 677 678 679 //retrocompatibilta per vecchia funziome 680 if (function_exists('nftb_order_after_items')) { 681 682 $defmessage = $defmessage . "\r\n\r\n"; 683 $defmessage = $defmessage . nftb_order_after_items($order_id); 684 $defmessage = $defmessage . "\r\n"; 685 } 686 687 // HOOKS nftb_order_after_items_hook 688 $nftb_order_after_items_hook = apply_filters('nftb_order_after_items_hook', $order_id); 689 if (has_filter('nftb_order_after_items_hook')) { 690 $defmessage = $defmessage . $nftb_order_after_items_hook; 691 } 692 693 657 658 if (!$TelegramNotify2->getValuefromconfig('hide_prods_list')) { 659 660 //retrocompatibilta per vecchia funziome 661 if (function_exists('nftb_order_before_items')) { 662 663 $defmessage = $defmessage . "\r\n"; 664 $defmessage = $defmessage . nftb_order_before_items($order_id); 665 $defmessage = $defmessage . "\r\n"; 666 } 667 668 // HOOKS nftb_order_before_items_hook 669 $nftb_order_before_items_hook = apply_filters('nftb_order_before_items_hook', $order_id); 670 if (has_filter('nftb_order_before_items_hook')) { 671 $defmessage = $defmessage . $nftb_order_before_items_hook; 672 } 673 674 675 676 677 $defmessage .= "\r\n\r\n------ " . __('ITEMS', 'notification-for-telegram') . " ------\r\n"; 678 679 $defmessage = $defmessage . $linea; 680 $defmessage = $defmessage . "-------------------"; 681 682 683 //retrocompatibilta per vecchia funziome 684 if (function_exists('nftb_order_after_items')) { 685 686 $defmessage = $defmessage . "\r\n\r\n"; 687 $defmessage = $defmessage . nftb_order_after_items($order_id); 688 $defmessage = $defmessage . "\r\n"; 689 } 690 691 // HOOKS nftb_order_after_items_hook 692 $nftb_order_after_items_hook = apply_filters('nftb_order_after_items_hook', $order_id); 693 if (has_filter('nftb_order_after_items_hook')) { 694 $defmessage = $defmessage . $nftb_order_after_items_hook; 695 } 696 697 } else { 698 $defmessage = $defmessage . "\r\n". __('🧺 Number of products in the order: ', 'notification-for-telegram'). $numprod."\r\n"; 699 } 694 700 695 701 $hidebilll = ""; … … 864 870 865 871 $product = wc_get_product( $product_id); 872 // Get the SKU 873 $sku = $product->get_sku(); 874 875 // Check if SKU is empty 876 if ( empty( $sku ) ) { 877 $skuuu = ""; 878 } else { 879 $skuuu = " | " . esc_html( $sku ). ""; 880 } 866 881 867 882 868 883 $myprodname = $product->get_name(); 869 nftb_send_teleg_message(__("NEW product in the cart", "notification-for-telegram") . " " . $bloginfo . ". | " . $myprodname . " " . __("Qty", "notification-for-telegram") . " " . $quantity);884 nftb_send_teleg_message(__("NEW product in the cart", "notification-for-telegram") . " " . $bloginfo . ".". $skuuu ." | " . $myprodname . " " . __("Qty", "notification-for-telegram") . " " . $quantity); 870 885 871 886 } … … 902 917 // Get the product name 903 918 $myprodname= $product->get_name(); 904 905 906 nftb_send_teleg_message(__("removed from the cart", "notification-for-telegram") . " " . $bloginfo . ". | " . $myprodname ); 919 920 // Get the SKU 921 $sku = $product->get_sku(); 922 923 // Check if SKU is empty 924 if ( empty( $sku ) ) { 925 $skuuu = ""; 926 } else { 927 $skuuu = " | " . esc_html( $sku ). ""; 928 } 929 930 931 nftb_send_teleg_message(__("removed from the cart", "notification-for-telegram") . " " . $bloginfo . ".". $skuuu . " | " . $myprodname ); 907 932 908 933 } -
notification-for-telegram/tags/3.4.6/readme.txt
r3337644 r3352802 5 5 Requires at least: 4.0 6 6 Tested up to: 6.8.1 7 Stable tag: 3.4. 57 Stable tag: 3.4.6 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 276 276 == Changelog == 277 277 278 = 3.4.6 = 279 Added product sku in the notification when a product is added to the cart (maxivillus request) 280 Added product sku in the notification when a product is removed fromn the cart (maxivillus request) 281 Added option to hide the product list in notification messages and display only the item count. (mouring request) 282 278 283 = 3.4.5 = 279 284 Removed ver stripping from asset URLs for better cache handling and plugin compatibility. -
notification-for-telegram/tags/xx/include/nftb_optionpage.php
r3337166 r3352802 26 26 27 27 //TAB3 28 if ($field == "ORDERS" || $field == "notify_woocomerce_order" || $field == "order_trigger" || $field == "price_with_tax" || $field == "hide_bill" || $field == "hide_ship" || $field == "hide_phone" || $field == "WOO PREFERENCES" || $field == "notify_woocomerce_checkoutfield" || $field == "notify_woocomerce_checkoutext" || $field == "notify_woocomerce_order_change" || $field == "notify_woocomerce_addtocart_item" || $field == "notify_woocomerce_remove_cart_item" || $field == "hide_edit_link" ) {28 if ($field == "ORDERS" || $field == "notify_woocomerce_order" || $field == "order_trigger" || $field == "price_with_tax" || $field == "hide_bill" || $field == "hide_ship" || $field == "hide_phone" || $field == "WOO PREFERENCES" || $field == "notify_woocomerce_checkoutfield" || $field == "notify_woocomerce_checkoutext" || $field == "notify_woocomerce_order_change" || $field == "notify_woocomerce_addtocart_item" || $field == "notify_woocomerce_remove_cart_item" || $field == "hide_edit_link" || $field == "hide_prods_list" ) { 29 29 $prefname = "telegram_notify_option_name_tab3"; 30 30 } … … 536 536 __('Show prices including tax ', 'notification-for-telegram'), // title 537 537 array($this, 'price_with_tax_callback'), // callback 538 'telegram-notify-admin_tab3', // page 539 'telegram_notify_setting_section_tab3' // section 540 ); 541 542 add_settings_field( 543 'hide_prods_list', // id 544 __('Hide products list.', 'notification-for-telegram'), // title 545 array($this, 'hide_prods_list_callback'), // callback 538 546 'telegram-notify-admin_tab3', // page 539 547 'telegram_notify_setting_section_tab3' // section … … 973 981 } 974 982 983 if (isset($input['hide_prods_list'])) { 984 $sanitary_values['hide_prods_list'] = $input['hide_prods_list']; 985 } 986 975 987 if (isset($input['hide_phone'])) { 976 988 $sanitary_values['hide_phone'] = $input['hide_phone']; … … 1637 1649 } 1638 1650 } 1651 1652 1653 public function hide_prods_list_callback() 1654 { 1655 printf( 1656 '<label class="telegram-notify-switch"><input type="checkbox" name="telegram_notify_option_name_tab3[hide_prods_list]" id="hide_prods_list" value="hide_prods_list" %s><span class="telegram-notify-slider"></span> 1657 </label><label for="hide_prods_list">' . __('Hide the product list in the notification message and only display the item count. 1658 1659 ', 'notification-for-telegram') . '</label>', 1660 (isset($this->telegram_notify_options_tab3['hide_prods_list']) && $this->telegram_notify_options_tab3['hide_prods_list'] === 'hide_prods_list') ? 'checked' : '' 1661 ); 1662 if (is_plugin_active('woocommerce/woocommerce.php')) { 1663 ?><script> 1664 document.getElementById("hide_prods_list").enable = true; 1665 </script><?php 1666 } else { ?><script> 1667 document.getElementById("hide_prods_list").disabled = true; 1668 document.querySelector("label[for=hide_prods_list]").innerHTML = "<?php _e('Plug not Active or Installed', 'notification-for-telegram') ?>"; 1669 </script><?php 1670 } 1671 } 1672 1639 1673 1640 1674 public function hide_bill_callback() -
notification-for-telegram/tags/xx/index.php
r3337653 r3352802 4 4 * Plugin URI: https://www.reggae.it/my-wordpress-plugins 5 5 * Description: Sends notifications to Telegram when events occur in WordPress. 6 * Version: 3.4. 56 * Version: 3.4.6 7 7 * Author: Andrea Marinucci 8 8 * Author URI: … … 539 539 get_woocommerce_currency_symbol(); 540 540 $linea = ""; 541 541 $numprod = 0; 542 542 foreach ($order->get_items() as $item_id => $item) { 543 $numprod = $numprod +1; 543 544 $extrafiledhook = ""; 544 545 $lineatemp = ""; … … 654 655 $defmessage = $defmessage . $order_count; 655 656 656 //retrocompatibilta per vecchia funziome 657 if (function_exists('nftb_order_before_items')) { 658 659 $defmessage = $defmessage . "\r\n"; 660 $defmessage = $defmessage . nftb_order_before_items($order_id); 661 $defmessage = $defmessage . "\r\n"; 662 } 663 664 // HOOKS nftb_order_before_items_hook 665 $nftb_order_before_items_hook = apply_filters('nftb_order_before_items_hook', $order_id); 666 if (has_filter('nftb_order_before_items_hook')) { 667 $defmessage = $defmessage . $nftb_order_before_items_hook; 668 } 669 670 671 672 673 $defmessage .= "\r\n\r\n------ " . __('ITEMS', 'notification-for-telegram') . " ------\r\n"; 674 675 $defmessage = $defmessage . $linea; 676 $defmessage = $defmessage . "-------------------"; 677 678 679 //retrocompatibilta per vecchia funziome 680 if (function_exists('nftb_order_after_items')) { 681 682 $defmessage = $defmessage . "\r\n\r\n"; 683 $defmessage = $defmessage . nftb_order_after_items($order_id); 684 $defmessage = $defmessage . "\r\n"; 685 } 686 687 // HOOKS nftb_order_after_items_hook 688 $nftb_order_after_items_hook = apply_filters('nftb_order_after_items_hook', $order_id); 689 if (has_filter('nftb_order_after_items_hook')) { 690 $defmessage = $defmessage . $nftb_order_after_items_hook; 691 } 692 693 657 658 if (!$TelegramNotify2->getValuefromconfig('hide_prods_list')) { 659 660 //retrocompatibilta per vecchia funziome 661 if (function_exists('nftb_order_before_items')) { 662 663 $defmessage = $defmessage . "\r\n"; 664 $defmessage = $defmessage . nftb_order_before_items($order_id); 665 $defmessage = $defmessage . "\r\n"; 666 } 667 668 // HOOKS nftb_order_before_items_hook 669 $nftb_order_before_items_hook = apply_filters('nftb_order_before_items_hook', $order_id); 670 if (has_filter('nftb_order_before_items_hook')) { 671 $defmessage = $defmessage . $nftb_order_before_items_hook; 672 } 673 674 675 676 677 $defmessage .= "\r\n\r\n------ " . __('ITEMS', 'notification-for-telegram') . " ------\r\n"; 678 679 $defmessage = $defmessage . $linea; 680 $defmessage = $defmessage . "-------------------"; 681 682 683 //retrocompatibilta per vecchia funziome 684 if (function_exists('nftb_order_after_items')) { 685 686 $defmessage = $defmessage . "\r\n\r\n"; 687 $defmessage = $defmessage . nftb_order_after_items($order_id); 688 $defmessage = $defmessage . "\r\n"; 689 } 690 691 // HOOKS nftb_order_after_items_hook 692 $nftb_order_after_items_hook = apply_filters('nftb_order_after_items_hook', $order_id); 693 if (has_filter('nftb_order_after_items_hook')) { 694 $defmessage = $defmessage . $nftb_order_after_items_hook; 695 } 696 697 } else { 698 $defmessage = $defmessage . "\r\n". __('🧺 Number of products in the order: ', 'notification-for-telegram'). $numprod."\r\n"; 699 } 694 700 695 701 $hidebilll = ""; … … 864 870 865 871 $product = wc_get_product( $product_id); 872 // Get the SKU 873 $sku = $product->get_sku(); 874 875 // Check if SKU is empty 876 if ( empty( $sku ) ) { 877 $skuuu = ""; 878 } else { 879 $skuuu = " | " . esc_html( $sku ). ""; 880 } 866 881 867 882 868 883 $myprodname = $product->get_name(); 869 nftb_send_teleg_message(__("NEW product in the cart", "notification-for-telegram") . " " . $bloginfo . ". | " . $myprodname . " " . __("Qty", "notification-for-telegram") . " " . $quantity);884 nftb_send_teleg_message(__("NEW product in the cart", "notification-for-telegram") . " " . $bloginfo . ".". $skuuu ." | " . $myprodname . " " . __("Qty", "notification-for-telegram") . " " . $quantity); 870 885 871 886 } … … 902 917 // Get the product name 903 918 $myprodname= $product->get_name(); 904 905 906 nftb_send_teleg_message(__("removed from the cart", "notification-for-telegram") . " " . $bloginfo . ". | " . $myprodname ); 919 920 // Get the SKU 921 $sku = $product->get_sku(); 922 923 // Check if SKU is empty 924 if ( empty( $sku ) ) { 925 $skuuu = ""; 926 } else { 927 $skuuu = " | " . esc_html( $sku ). ""; 928 } 929 930 931 nftb_send_teleg_message(__("removed from the cart", "notification-for-telegram") . " " . $bloginfo . ".". $skuuu . " | " . $myprodname ); 907 932 908 933 } -
notification-for-telegram/tags/xx/readme.txt
r3337644 r3352802 5 5 Requires at least: 4.0 6 6 Tested up to: 6.8.1 7 Stable tag: 3.4. 57 Stable tag: 3.4.6 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 276 276 == Changelog == 277 277 278 = 3.4.6 = 279 Added product sku in the notification when a product is added to the cart (maxivillus request) 280 Added product sku in the notification when a product is removed fromn the cart (maxivillus request) 281 Added option to hide the product list in notification messages and display only the item count. (mouring request) 282 278 283 = 3.4.5 = 279 284 Removed ver stripping from asset URLs for better cache handling and plugin compatibility. -
notification-for-telegram/trunk/include/nftb_optionpage.php
r3337166 r3352802 26 26 27 27 //TAB3 28 if ($field == "ORDERS" || $field == "notify_woocomerce_order" || $field == "order_trigger" || $field == "price_with_tax" || $field == "hide_bill" || $field == "hide_ship" || $field == "hide_phone" || $field == "WOO PREFERENCES" || $field == "notify_woocomerce_checkoutfield" || $field == "notify_woocomerce_checkoutext" || $field == "notify_woocomerce_order_change" || $field == "notify_woocomerce_addtocart_item" || $field == "notify_woocomerce_remove_cart_item" || $field == "hide_edit_link" ) {28 if ($field == "ORDERS" || $field == "notify_woocomerce_order" || $field == "order_trigger" || $field == "price_with_tax" || $field == "hide_bill" || $field == "hide_ship" || $field == "hide_phone" || $field == "WOO PREFERENCES" || $field == "notify_woocomerce_checkoutfield" || $field == "notify_woocomerce_checkoutext" || $field == "notify_woocomerce_order_change" || $field == "notify_woocomerce_addtocart_item" || $field == "notify_woocomerce_remove_cart_item" || $field == "hide_edit_link" || $field == "hide_prods_list" ) { 29 29 $prefname = "telegram_notify_option_name_tab3"; 30 30 } … … 536 536 __('Show prices including tax ', 'notification-for-telegram'), // title 537 537 array($this, 'price_with_tax_callback'), // callback 538 'telegram-notify-admin_tab3', // page 539 'telegram_notify_setting_section_tab3' // section 540 ); 541 542 add_settings_field( 543 'hide_prods_list', // id 544 __('Hide products list.', 'notification-for-telegram'), // title 545 array($this, 'hide_prods_list_callback'), // callback 538 546 'telegram-notify-admin_tab3', // page 539 547 'telegram_notify_setting_section_tab3' // section … … 973 981 } 974 982 983 if (isset($input['hide_prods_list'])) { 984 $sanitary_values['hide_prods_list'] = $input['hide_prods_list']; 985 } 986 975 987 if (isset($input['hide_phone'])) { 976 988 $sanitary_values['hide_phone'] = $input['hide_phone']; … … 1637 1649 } 1638 1650 } 1651 1652 1653 public function hide_prods_list_callback() 1654 { 1655 printf( 1656 '<label class="telegram-notify-switch"><input type="checkbox" name="telegram_notify_option_name_tab3[hide_prods_list]" id="hide_prods_list" value="hide_prods_list" %s><span class="telegram-notify-slider"></span> 1657 </label><label for="hide_prods_list">' . __('Hide the product list in the notification message and only display the item count. 1658 1659 ', 'notification-for-telegram') . '</label>', 1660 (isset($this->telegram_notify_options_tab3['hide_prods_list']) && $this->telegram_notify_options_tab3['hide_prods_list'] === 'hide_prods_list') ? 'checked' : '' 1661 ); 1662 if (is_plugin_active('woocommerce/woocommerce.php')) { 1663 ?><script> 1664 document.getElementById("hide_prods_list").enable = true; 1665 </script><?php 1666 } else { ?><script> 1667 document.getElementById("hide_prods_list").disabled = true; 1668 document.querySelector("label[for=hide_prods_list]").innerHTML = "<?php _e('Plug not Active or Installed', 'notification-for-telegram') ?>"; 1669 </script><?php 1670 } 1671 } 1672 1639 1673 1640 1674 public function hide_bill_callback() -
notification-for-telegram/trunk/index.php
r3337653 r3352802 4 4 * Plugin URI: https://www.reggae.it/my-wordpress-plugins 5 5 * Description: Sends notifications to Telegram when events occur in WordPress. 6 * Version: 3.4. 56 * Version: 3.4.6 7 7 * Author: Andrea Marinucci 8 8 * Author URI: … … 539 539 get_woocommerce_currency_symbol(); 540 540 $linea = ""; 541 541 $numprod = 0; 542 542 foreach ($order->get_items() as $item_id => $item) { 543 $numprod = $numprod +1; 543 544 $extrafiledhook = ""; 544 545 $lineatemp = ""; … … 654 655 $defmessage = $defmessage . $order_count; 655 656 656 //retrocompatibilta per vecchia funziome 657 if (function_exists('nftb_order_before_items')) { 658 659 $defmessage = $defmessage . "\r\n"; 660 $defmessage = $defmessage . nftb_order_before_items($order_id); 661 $defmessage = $defmessage . "\r\n"; 662 } 663 664 // HOOKS nftb_order_before_items_hook 665 $nftb_order_before_items_hook = apply_filters('nftb_order_before_items_hook', $order_id); 666 if (has_filter('nftb_order_before_items_hook')) { 667 $defmessage = $defmessage . $nftb_order_before_items_hook; 668 } 669 670 671 672 673 $defmessage .= "\r\n\r\n------ " . __('ITEMS', 'notification-for-telegram') . " ------\r\n"; 674 675 $defmessage = $defmessage . $linea; 676 $defmessage = $defmessage . "-------------------"; 677 678 679 //retrocompatibilta per vecchia funziome 680 if (function_exists('nftb_order_after_items')) { 681 682 $defmessage = $defmessage . "\r\n\r\n"; 683 $defmessage = $defmessage . nftb_order_after_items($order_id); 684 $defmessage = $defmessage . "\r\n"; 685 } 686 687 // HOOKS nftb_order_after_items_hook 688 $nftb_order_after_items_hook = apply_filters('nftb_order_after_items_hook', $order_id); 689 if (has_filter('nftb_order_after_items_hook')) { 690 $defmessage = $defmessage . $nftb_order_after_items_hook; 691 } 692 693 657 658 if (!$TelegramNotify2->getValuefromconfig('hide_prods_list')) { 659 660 //retrocompatibilta per vecchia funziome 661 if (function_exists('nftb_order_before_items')) { 662 663 $defmessage = $defmessage . "\r\n"; 664 $defmessage = $defmessage . nftb_order_before_items($order_id); 665 $defmessage = $defmessage . "\r\n"; 666 } 667 668 // HOOKS nftb_order_before_items_hook 669 $nftb_order_before_items_hook = apply_filters('nftb_order_before_items_hook', $order_id); 670 if (has_filter('nftb_order_before_items_hook')) { 671 $defmessage = $defmessage . $nftb_order_before_items_hook; 672 } 673 674 675 676 677 $defmessage .= "\r\n\r\n------ " . __('ITEMS', 'notification-for-telegram') . " ------\r\n"; 678 679 $defmessage = $defmessage . $linea; 680 $defmessage = $defmessage . "-------------------"; 681 682 683 //retrocompatibilta per vecchia funziome 684 if (function_exists('nftb_order_after_items')) { 685 686 $defmessage = $defmessage . "\r\n\r\n"; 687 $defmessage = $defmessage . nftb_order_after_items($order_id); 688 $defmessage = $defmessage . "\r\n"; 689 } 690 691 // HOOKS nftb_order_after_items_hook 692 $nftb_order_after_items_hook = apply_filters('nftb_order_after_items_hook', $order_id); 693 if (has_filter('nftb_order_after_items_hook')) { 694 $defmessage = $defmessage . $nftb_order_after_items_hook; 695 } 696 697 } else { 698 $defmessage = $defmessage . "\r\n". __('🧺 Number of products in the order: ', 'notification-for-telegram'). $numprod."\r\n"; 699 } 694 700 695 701 $hidebilll = ""; … … 864 870 865 871 $product = wc_get_product( $product_id); 872 // Get the SKU 873 $sku = $product->get_sku(); 874 875 // Check if SKU is empty 876 if ( empty( $sku ) ) { 877 $skuuu = ""; 878 } else { 879 $skuuu = " | " . esc_html( $sku ). ""; 880 } 866 881 867 882 868 883 $myprodname = $product->get_name(); 869 nftb_send_teleg_message(__("NEW product in the cart", "notification-for-telegram") . " " . $bloginfo . ". | " . $myprodname . " " . __("Qty", "notification-for-telegram") . " " . $quantity);884 nftb_send_teleg_message(__("NEW product in the cart", "notification-for-telegram") . " " . $bloginfo . ".". $skuuu ." | " . $myprodname . " " . __("Qty", "notification-for-telegram") . " " . $quantity); 870 885 871 886 } … … 902 917 // Get the product name 903 918 $myprodname= $product->get_name(); 904 905 906 nftb_send_teleg_message(__("removed from the cart", "notification-for-telegram") . " " . $bloginfo . ". | " . $myprodname ); 919 920 // Get the SKU 921 $sku = $product->get_sku(); 922 923 // Check if SKU is empty 924 if ( empty( $sku ) ) { 925 $skuuu = ""; 926 } else { 927 $skuuu = " | " . esc_html( $sku ). ""; 928 } 929 930 931 nftb_send_teleg_message(__("removed from the cart", "notification-for-telegram") . " " . $bloginfo . ".". $skuuu . " | " . $myprodname ); 907 932 908 933 } -
notification-for-telegram/trunk/readme.txt
r3337644 r3352802 5 5 Requires at least: 4.0 6 6 Tested up to: 6.8.1 7 Stable tag: 3.4. 57 Stable tag: 3.4.6 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 276 276 == Changelog == 277 277 278 = 3.4.6 = 279 Added product sku in the notification when a product is added to the cart (maxivillus request) 280 Added product sku in the notification when a product is removed fromn the cart (maxivillus request) 281 Added option to hide the product list in notification messages and display only the item count. (mouring request) 282 278 283 = 3.4.5 = 279 284 Removed ver stripping from asset URLs for better cache handling and plugin compatibility.
Note: See TracChangeset
for help on using the changeset viewer.