Plugin Directory

Changeset 3352802


Ignore:
Timestamp:
08/29/2025 05:13:14 PM (7 months ago)
Author:
rainafarai
Message:

daje

Location:
notification-for-telegram
Files:
1 deleted
7 edited
4 copied

Legend:

Unmodified
Added
Removed
  • notification-for-telegram/tags/3.4.6/include/nftb_optionpage.php

    r3337166 r3352802  
    2626
    2727        //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" ) {
    2929            $prefname = "telegram_notify_option_name_tab3";
    3030        }
     
    536536            __('Show prices including tax ', 'notification-for-telegram'), // title
    537537            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
    538546            'telegram-notify-admin_tab3', // page
    539547            'telegram_notify_setting_section_tab3' // section
     
    973981        }
    974982
     983        if (isset($input['hide_prods_list'])) {
     984            $sanitary_values['hide_prods_list'] = $input['hide_prods_list'];
     985        }
     986
    975987        if (isset($input['hide_phone'])) {
    976988            $sanitary_values['hide_phone'] = $input['hide_phone'];
     
    16371649                    }
    16381650                }
     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
    16391673
    16401674                public function hide_bill_callback()
  • notification-for-telegram/tags/3.4.6/index.php

    r3337653 r3352802  
    44* Plugin URI: https://www.reggae.it/my-wordpress-plugins
    55 * Description:  Sends notifications to Telegram when events occur in WordPress.
    6  * Version: 3.4.5
     6 * Version: 3.4.6
    77 * Author: Andrea Marinucci
    88 * Author URI:
     
    539539            get_woocommerce_currency_symbol();
    540540            $linea = "";
    541 
     541            $numprod = 0;
    542542            foreach ($order->get_items() as $item_id => $item) {
     543                $numprod = $numprod +1;
    543544                $extrafiledhook = "";
    544545                $lineatemp = "";
     
    654655            $defmessage = $defmessage . $order_count;
    655656
    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            }
    694700
    695701            $hidebilll = "";
     
    864870   
    865871     $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    }
    866881   
    867882
    868883    $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);
    870885
    871886  }
     
    902917    // Get the product name
    903918    $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 );
    907932 
    908933  }
  • notification-for-telegram/tags/3.4.6/readme.txt

    r3337644 r3352802  
    55Requires at least: 4.0
    66Tested up to: 6.8.1
    7 Stable tag: 3.4.5
     7Stable tag: 3.4.6
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    276276== Changelog ==
    277277
     278= 3.4.6 =
     279Added product sku in the notification when a product is added to the cart (maxivillus request)
     280Added product sku in the notification when a product is removed fromn the cart (maxivillus request)
     281Added option to hide the product list in notification messages and display only the item count. (mouring request)
     282
    278283= 3.4.5 =
    279284Removed ver stripping from asset URLs for better cache handling and plugin compatibility.
  • notification-for-telegram/tags/xx/include/nftb_optionpage.php

    r3337166 r3352802  
    2626
    2727        //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" ) {
    2929            $prefname = "telegram_notify_option_name_tab3";
    3030        }
     
    536536            __('Show prices including tax ', 'notification-for-telegram'), // title
    537537            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
    538546            'telegram-notify-admin_tab3', // page
    539547            'telegram_notify_setting_section_tab3' // section
     
    973981        }
    974982
     983        if (isset($input['hide_prods_list'])) {
     984            $sanitary_values['hide_prods_list'] = $input['hide_prods_list'];
     985        }
     986
    975987        if (isset($input['hide_phone'])) {
    976988            $sanitary_values['hide_phone'] = $input['hide_phone'];
     
    16371649                    }
    16381650                }
     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
    16391673
    16401674                public function hide_bill_callback()
  • notification-for-telegram/tags/xx/index.php

    r3337653 r3352802  
    44* Plugin URI: https://www.reggae.it/my-wordpress-plugins
    55 * Description:  Sends notifications to Telegram when events occur in WordPress.
    6  * Version: 3.4.5
     6 * Version: 3.4.6
    77 * Author: Andrea Marinucci
    88 * Author URI:
     
    539539            get_woocommerce_currency_symbol();
    540540            $linea = "";
    541 
     541            $numprod = 0;
    542542            foreach ($order->get_items() as $item_id => $item) {
     543                $numprod = $numprod +1;
    543544                $extrafiledhook = "";
    544545                $lineatemp = "";
     
    654655            $defmessage = $defmessage . $order_count;
    655656
    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            }
    694700
    695701            $hidebilll = "";
     
    864870   
    865871     $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    }
    866881   
    867882
    868883    $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);
    870885
    871886  }
     
    902917    // Get the product name
    903918    $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 );
    907932 
    908933  }
  • notification-for-telegram/tags/xx/readme.txt

    r3337644 r3352802  
    55Requires at least: 4.0
    66Tested up to: 6.8.1
    7 Stable tag: 3.4.5
     7Stable tag: 3.4.6
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    276276== Changelog ==
    277277
     278= 3.4.6 =
     279Added product sku in the notification when a product is added to the cart (maxivillus request)
     280Added product sku in the notification when a product is removed fromn the cart (maxivillus request)
     281Added option to hide the product list in notification messages and display only the item count. (mouring request)
     282
    278283= 3.4.5 =
    279284Removed ver stripping from asset URLs for better cache handling and plugin compatibility.
  • notification-for-telegram/trunk/include/nftb_optionpage.php

    r3337166 r3352802  
    2626
    2727        //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" ) {
    2929            $prefname = "telegram_notify_option_name_tab3";
    3030        }
     
    536536            __('Show prices including tax ', 'notification-for-telegram'), // title
    537537            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
    538546            'telegram-notify-admin_tab3', // page
    539547            'telegram_notify_setting_section_tab3' // section
     
    973981        }
    974982
     983        if (isset($input['hide_prods_list'])) {
     984            $sanitary_values['hide_prods_list'] = $input['hide_prods_list'];
     985        }
     986
    975987        if (isset($input['hide_phone'])) {
    976988            $sanitary_values['hide_phone'] = $input['hide_phone'];
     
    16371649                    }
    16381650                }
     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
    16391673
    16401674                public function hide_bill_callback()
  • notification-for-telegram/trunk/index.php

    r3337653 r3352802  
    44* Plugin URI: https://www.reggae.it/my-wordpress-plugins
    55 * Description:  Sends notifications to Telegram when events occur in WordPress.
    6  * Version: 3.4.5
     6 * Version: 3.4.6
    77 * Author: Andrea Marinucci
    88 * Author URI:
     
    539539            get_woocommerce_currency_symbol();
    540540            $linea = "";
    541 
     541            $numprod = 0;
    542542            foreach ($order->get_items() as $item_id => $item) {
     543                $numprod = $numprod +1;
    543544                $extrafiledhook = "";
    544545                $lineatemp = "";
     
    654655            $defmessage = $defmessage . $order_count;
    655656
    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            }
    694700
    695701            $hidebilll = "";
     
    864870   
    865871     $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    }
    866881   
    867882
    868883    $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);
    870885
    871886  }
     
    902917    // Get the product name
    903918    $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 );
    907932 
    908933  }
  • notification-for-telegram/trunk/readme.txt

    r3337644 r3352802  
    55Requires at least: 4.0
    66Tested up to: 6.8.1
    7 Stable tag: 3.4.5
     7Stable tag: 3.4.6
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    276276== Changelog ==
    277277
     278= 3.4.6 =
     279Added product sku in the notification when a product is added to the cart (maxivillus request)
     280Added product sku in the notification when a product is removed fromn the cart (maxivillus request)
     281Added option to hide the product list in notification messages and display only the item count. (mouring request)
     282
    278283= 3.4.5 =
    279284Removed ver stripping from asset URLs for better cache handling and plugin compatibility.
Note: See TracChangeset for help on using the changeset viewer.