Plugin Directory

Changeset 2979054


Ignore:
Timestamp:
10/14/2023 05:09:22 PM (2 years ago)
Author:
pechenki
Message:
  • add chat id from wooccommerce
  • fix error
Location:
telsender/trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • telsender/trunk/clasess/TelegramSend.php

    r2736141 r2979054  
    33namespace pechenki\Telsender\clasess;
    44
     5if ( ! defined( 'ABSPATH' ) ) {
     6    exit;
     7}
    58/**
    69 * curl sender
  • telsender/trunk/clasess/TelsenderCore.php

    r2952090 r2979054  
    77use function Symfony\Component\Translation\t;
    88
     9if ( ! defined( 'ABSPATH' ) ) {
     10    exit;
     11}
    912/**
    1013 * Class TelsenderCore
     
    8083    public function tscfwc_dynamic_button()
    8184    {
    82         add_menu_page('TelSender', 'TelSender', 'manage_options', 'telsender', array($this, 'tscfwc_setting_page'), plugin_dir_url(__FILE__) . '../assets/icon-plugin.png');
     85        add_menu_page('TelSender', 'TelSender 🇺🇦', 'manage_options', 'telsender', array($this, 'tscfwc_setting_page'), plugin_dir_url(__FILE__) . '../assets/icon-plugin.png');
    8386        add_submenu_page('telsender', 'Help', 'Help 🆘', 'manage_options', 'telsender-help', array($this, 'help'),10);
    8487    }
     
    109112
    110113        }
     114
     115
     116
     117        if ($this->tscfwc_setting_setcheck && isset($this->tscfwc_setting_setcheck['wooc_chat_id'])) {
     118            $data['wooc_chat_id'] = $this->tscfwc_setting_setcheck['wooc_chat_id'];
     119        } else {
     120            $data['wooc_chat_id'] = '';
     121
     122        }
     123
    111124
    112125        if ($this->tscfwc_setting_setcheck && isset($this->tscfwc_setting_setcheck['wooc_all_order'])) {
     
    232245
    233246        if (in_array('wc-' . $order->get_status(), $wc_access_status) || !$wc_access_status) {
    234 
    235247            $isSendn = get_post_meta($order->get_id(), 'telsIsm', true);
    236 
    237248            if (!$wc_chek['wooc_check'])  return;
     249            if (!empty($wc_chek['wooc_chat_id'])) {
     250                $this->telegram->Chat_id = $wc_chek['wooc_chat_id'];
     251            }
    238252
    239253            if ($isSendn && $isSendn != '-1') {
     
    294308            'tscfwc_setting_setcheck' => array(
    295309                'wooc_check' => (int)htmlentities($this->post('tscfwc_setting_setcheck')['wooc_check']),
     310                'wooc_chat_id' => htmlentities($this->post('tscfwc_setting_setcheck')['wooc_chat_id']),
    296311                'wooc_all_order' => (int)htmlentities($this->post('tscfwc_setting_setcheck')['wooc_all_order']),
    297312                'tscfwc_key' => (int)htmlentities($this->post('tscfwc_setting_setcheck')['tscfwc_key'])
     
    333348        }
    334349
     350
     351
    335352        if ($validatePost) {
    336353            update_option(TSCFWC_SETTING, serialize($validatePost));
    337354        }
     355
     356
    338357
    339358    }
  • telsender/trunk/clasess/TelsenderEvent.php

    r2952090 r2979054  
    66
    77use pechenki\Telsender\clasess\TelsenderCore;
    8 
     8if ( ! defined( 'ABSPATH' ) ) {
     9    exit;
     10}
    911/**
    1012 * @property mixed|null login_success
     
    2830 * @property array utm_list_val
    2931 */
     32
    3033class TelsenderEvent
    3134{
  • telsender/trunk/clasess/TelsenderWc.php

    r2736141 r2979054  
    33namespace pechenki\Telsender\clasess;
    44
     5if ( ! defined( 'ABSPATH' ) ) {
     6    exit;
     7}
    58/**
    69 * Class TelsenderWc
  • telsender/trunk/clasess/TscfwcSetting.php

    r2867750 r2979054  
    22
    33namespace pechenki\Telsender\clasess;
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6    exit;
     7}
    48/**
    59 * Class TscfwcSetting
  • telsender/trunk/clasess/log.php

    r2736141 r2979054  
    1 <?php
     1<?php
     2
    23namespace pechenki\Telsender\clasess;
    34
     5if ( ! defined( 'ABSPATH' ) ) {
     6    exit;
     7}
    48class log{
    59   
  • telsender/trunk/css/telsender.css

    r2952090 r2979054  
    113113    border-radius: 10px 10px 0 0;
    114114    font-weight: 500;
     115    display: flex;
     116    flex-direction: column;
    115117}
    116118
  • telsender/trunk/index.php

    r2952090 r2979054  
    88Description: Плагін відправляє заявки з форм у телеграм канал
    99Author: Pechenki
    10 Version: 1.14.7
    11 Author URI: https://coder.org.ua/telsender.html
     10Version: 1.14.8
     11Author URI: https://coder.org.ua/dev/wordpress/telsender
    1212*/
    1313//////////////////////////////////
  • telsender/trunk/js/ajax.js

    r2867750 r2979054  
    8484
    8585let tokenstr = document.querySelector('#getUpdates')
    86 const token =  document.querySelector('[name="tscfwc_setting_token"]').value
     86const token =  document.querySelector('[name="tscfwc_setting_token"]')?.value;
    8787
    8888let newurl = tokenstr.outerHTML.replaceAll('{token}',token)
     
    9191
    9292function telsenderInfo(){
    93     const token =  document.querySelector('[name="tscfwc_setting_token"]').value
     93    const token =  document.querySelector('[name="tscfwc_setting_token"]')?.value;
    9494    const url  = `https://api.telegram.org/bot${token}/getUpdates`
    9595    telsenderTestSend()
  • telsender/trunk/readme.md

    r2952090 r2979054  
    4646
    4747== Changelog ==
     48= 1.14.8 =
     49- add chat id from wooccommerce
     50- fix error
     51
    4852= 1.14.7 =
    4953 - add FAQ page
  • telsender/trunk/readme.txt

    r2952090 r2979054  
    55Requires PHP: 5.6
    66Tested up to: 6.3
    7 Stable tag: 1.14.7
     7Stable tag: 1.14.8
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    7474
    7575== Changelog ==
     76= 1.14.8 =
     77 - add chat id from wooccommerce
     78 - fix error
     79
    7680= 1.14.7 =
    7781 - add FAQ page
  • telsender/trunk/template/view.php

    r2952090 r2979054  
    3535                        </p>
    3636
    37                         <label>
     37                        <div>
    3838                            <input value="0" type="hidden" name="tscfwc_enabled" type="checkbox"/>
    3939                            <input value="1" <?php echo checked($this->tscfwc_enabled); ?> name="tscfwc_enabled"
    4040                                   type="checkbox"/>
    41                             <span>Enabled</span></label>
     41                            <span>Enabled</span>
     42                        </div>
    4243                        <div>
    4344                            <label>
     45                                <span><?php _e("Token", "telsender"); ?></span>
    4446                                <input type="text" value="<?php echo esc_attr($this->tscfwc_setting_token); ?>"
    4547                                       name="tscfwc_setting_token" placeholder=""/>
    46                                 <span><?php _e("Token", "telsender"); ?></span>
     48
    4749                            </label>
    4850                        </div>
    4951                        <div>
    50                             <label><input type="text" value="<?php echo esc_attr($this->tscfwc_setting_chatid); ?>"
     52                            <label>
     53                                <span> <?php _e('ChatID', 'telsender'); ?></span>
     54                                <input type="text" value="<?php echo esc_attr($this->tscfwc_setting_chatid); ?>"
    5155                                          name="tscfwc_setting_chatid"
    52                                           placeholder=""/><span> <?php _e('ChatID', 'telsender'); ?></span></label>
     56                                          placeholder=""/></label>
    5357                        </div>
    5458                    </fieldset>
     
    7882                        'is_check_wc' => $is_check_wc,
    7983                        'list_statuse_wc' => $list_statuse_wc,
     84                        'wooc_chat_id' => $wooc_chat_id,
    8085                    ]); ?>
    8186
  • telsender/trunk/template/woocommerce.php

    r2867750 r2979054  
    22    <legend><?php _e("Send out woocommerce", "telsender"); ?></legend>
    33
     4
     5    <p>
    46    <input type="checkbox" name="tscfwc_setting_setcheck[wooc_check]"
    57           value="1" <?php checked($is_check_wc); ?> />
    68    <?php _e("Send out woocommerce", "telsender"); ?></br></p>
     9    <p>
     10        <label>
     11            <span><?php _e("ChatID", "telsender"); ?></span>
     12            <input type="text" value="<?php echo esc_attr($wooc_chat_id); ?>"
     13                   name="tscfwc_setting_setcheck[wooc_chat_id]" placeholder=""/>
     14        </label>
     15    </p>
    716
    817    <?php /* @var string $list_statuse_wc - list statuses */
  • telsender/trunk/template/wp-forms.php

    r2952090 r2979054  
     1
    12<fieldset>
    23    <legend> <?php _e("Wp Form", "telsender"); ?> </legend>
Note: See TracChangeset for help on using the changeset viewer.