Changeset 2786611
- Timestamp:
- 09/18/2022 04:46:52 PM (4 years ago)
- Location:
- wp-line-notify
- Files:
-
- 1 deleted
- 6 edited
-
assets/screenshot-1.png (modified) (previous)
-
assets/screenshot-2.png (deleted)
-
trunk/includes/class-woo.php (modified) (4 diffs)
-
trunk/includes/page-setup.php (modified) (1 diff)
-
trunk/languages/wp-line-notify.pot (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-line-notify.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-line-notify/trunk/includes/class-woo.php
r2617598 r2786611 7 7 $fields = array( 8 8 'billing' => array( 9 'billing_first_name' => __( 'Billing First Name', 'w oocommerce' ),10 'billing_last_name' => __( 'Billing Last Name', 'w oocommerce' ),11 'billing_company' => __( 'Billing Company', 'w oocommerce' ),12 'billing_address_1' => __( 'Billing Address 1', 'w oocommerce' ),13 'billing_address_2' => __( 'Billing Address 2', 'w oocommerce' ),14 'billing_city' => __( 'Billing City', 'w oocommerce' ),15 'billing_state' => __( 'Billing State', 'w oocommerce' ),16 'billing_postcode' => __( 'Billing Postal/Zip Code', 'w oocommerce' ),17 'billing_country' => __( 'Billing Country / Region', 'w oocommerce' ),18 'billing_email' => __( 'Email Address', 'w oocommerce' ),19 'billing_phone' => __( 'Billing Phone Number', 'w oocommerce' ),9 'billing_first_name' => __( 'Billing First Name', 'wp-line-notify' ), 10 'billing_last_name' => __( 'Billing Last Name', 'wp-line-notify' ), 11 'billing_company' => __( 'Billing Company', 'wp-line-notify' ), 12 'billing_address_1' => __( 'Billing Address 1', 'wp-line-notify' ), 13 'billing_address_2' => __( 'Billing Address 2', 'wp-line-notify' ), 14 'billing_city' => __( 'Billing City', 'wp-line-notify' ), 15 'billing_state' => __( 'Billing State', 'wp-line-notify' ), 16 'billing_postcode' => __( 'Billing Postal/Zip Code', 'wp-line-notify' ), 17 'billing_country' => __( 'Billing Country / Region', 'wp-line-notify' ), 18 'billing_email' => __( 'Email Address', 'wp-line-notify' ), 19 'billing_phone' => __( 'Billing Phone Number', 'wp-line-notify' ), 20 20 ), 21 21 'shipping' => array( 22 'shipping_first_name'=> __( 'Shipping First Name', 'w oocommerce' ),23 'shipping_last_name' => __( 'Shipping Last Name', 'w oocommerce' ),24 'shipping_company' => __( 'Shipping Company', 'w oocommerce' ),25 'shipping_address_1' => __( 'Shipping Address 1', 'w oocommerce' ),26 'shipping_address_2' => __( 'Shipping Address 2', 'w oocommerce' ),27 'shipping_city' => __( 'Shipping City', 'w oocommerce' ),28 'shipping_state' => __( 'Shipping State', 'w oocommerce' ),29 'shipping_postcode' => __( 'Shipping Postal/Zip Code', 'w oocommerce' ),30 'shipping_country' => __( 'Shipping Country / Region', 'w oocommerce' ),31 'shipping_phone' => __( 'Shipping Phone Number', 'w oocommerce' ),22 'shipping_first_name'=> __( 'Shipping First Name', 'wp-line-notify' ), 23 'shipping_last_name' => __( 'Shipping Last Name', 'wp-line-notify' ), 24 'shipping_company' => __( 'Shipping Company', 'wp-line-notify' ), 25 'shipping_address_1' => __( 'Shipping Address 1', 'wp-line-notify' ), 26 'shipping_address_2' => __( 'Shipping Address 2', 'wp-line-notify' ), 27 'shipping_city' => __( 'Shipping City', 'wp-line-notify' ), 28 'shipping_state' => __( 'Shipping State', 'wp-line-notify' ), 29 'shipping_postcode' => __( 'Shipping Postal/Zip Code', 'wp-line-notify' ), 30 'shipping_country' => __( 'Shipping Country / Region', 'wp-line-notify' ), 31 'shipping_phone' => __( 'Shipping Phone Number', 'wp-line-notify' ), 32 32 ), 33 33 'order' => array( 34 ' total' => __( 'Total' , 'wp-line-notify' ),34 'order-id' => __( 'Order id' , 'wp-line-notify' ), 35 35 'order-product' => __( 'Order item' , 'wp-line-notify' ), 36 36 'order-name' => __( 'Order name' , 'wp-line-notify' ), 37 37 'shipping-name' => __( 'Shipping name' , 'wp-line-notify' ), 38 38 'payment-method' => __( 'Payment method' , 'wp-line-notify' ), 39 'total' => __( 'Total' , 'wp-line-notify' ), 39 40 'order-time' => __( 'Order time' , 'wp-line-notify' ), 40 'customer_note' => __( 'Order notes', 'w oocommerce' ),41 'customer_note' => __( 'Order notes', 'wp-line-notify' ), 41 42 ) 42 43 ); … … 49 50 $template = sprintf( 50 51 '%1$s 51 %2$s: [order- name]52 %2$s: [order-id] 52 53 %3$s: [order-product] 53 %4$s: [ payment-method]54 %4$s: [order-name] 54 55 %5$s: [shipping-name] 55 %6$s: [total]', 56 __( 'You have a new order.' , 'wp-line-notify' ), 57 __( 'Order item' , 'wp-line-notify' ), 58 __( 'Order name' , 'wp-line-notify' ), 59 __( 'Shipping name' , 'wp-line-notify' ), 60 __( 'Payment method' , 'wp-line-notify' ), 61 __( 'Total' , 'wp-line-notify' ) 56 %6$s: [payment-method] 57 %7$s: [total]', 58 __( 'You have a new order.' , 'wp-line-notify' ), 59 __( 'Order id' , 'wp-line-notify' ), 60 __( 'Order item' , 'wp-line-notify' ), 61 __( 'Order name' , 'wp-line-notify' ), 62 __( 'Shipping name' , 'wp-line-notify' ), 63 __( 'Payment method' , 'wp-line-notify' ), 64 __( 'Total' , 'wp-line-notify' ) 62 65 ); 63 66 64 return trim( $template );67 return trim( $template ); 65 68 } 66 69 … … 74 77 $fields = THWCFD_Utils::get_fields($type); 75 78 } 76 return $fields;79 return $fields; 77 80 } 78 81 … … 88 91 89 92 $options = get_option(SIG_LINE_NOTIFY_OPTIONS); 90 93 $my_status = (!empty($options['woo_status'])) ? $options['woo_status']:[]; 91 94 ?> 92 95 <input type="checkbox" id="chcek_order" name="<?php echo SIG_LINE_NOTIFY_OPTIONS?>[woocommerce]" value="1" <?php if(isset($options['woocommerce'])) echo checked( 1, $options['woocommerce'], false )?>> 93 94 <label for="chcek_order"><?php _e( 'Add a new order' , 'wp-line-notify' )?></label> 95 96 <label for="chcek_order"><?php _e( 'Add a new order' , 'wp-line-notify' )?></label><br> 97 <hr> 98 99 <?php _e( 'Order status changed:' , 'wp-line-notify' )?> 100 <?php foreach(wc_get_order_statuses() as $type=>$name): ?> 101 <input type="checkbox" id="chcek_order_<?php echo $type?>" name="<?php echo SIG_LINE_NOTIFY_OPTIONS?>[woo_status][]" value="<?php echo $type?>" <?php if( in_array($type,$my_status) ) echo 'checked="checked"';?>> 102 <label for="chcek_order_<?php echo $type?>"><?php echo $name?></label> 103 <?php endforeach;?> 96 104 <hr> 97 105 -
wp-line-notify/trunk/includes/page-setup.php
r2599085 r2786611 109 109 <table class="form-table"> 110 110 <tr valign="top"> 111 <th scope="row"><?php _e( 'WooCommerce' , ' quadric' ); ?></th>111 <th scope="row"><?php _e( 'WooCommerce' , 'wp-line-notify' ); ?></th> 112 112 <td> 113 113 <?php -
wp-line-notify/trunk/languages/wp-line-notify.pot
r2599085 r2786611 1 # Copyright (C) 202 1Simon Chuang1 # Copyright (C) 2022 Simon Chuang 2 2 # This file is distributed under the GPLv2. 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: WordPress LINE Notify 1.3 \n"5 "Project-Id-Version: WordPress LINE Notify 1.3.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/wp-line-notify\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 202 1-09-15T12:11:23+08:00\n"12 "POT-Creation-Date: 2022-09-18T18:17:05+02:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2. 5.0\n"14 "X-Generator: WP-CLI 2.6.0\n" 15 15 "X-Domain: wp-line-notify\n" 16 16 … … 39 39 msgstr "" 40 40 41 #: includes/class-elementor.php:7 241 #: includes/class-elementor.php:73 42 42 msgid "Line notify alert" 43 43 msgstr "" 44 44 45 #: includes/class-elementor.php:8 245 #: includes/class-elementor.php:83 46 46 msgid "Prompt text" 47 47 msgstr "" 48 48 49 #: includes/class-elementor.php:8 549 #: includes/class-elementor.php:86 50 50 msgid "The reminder text is displayed at the beginning of the sent message." 51 51 msgstr "" 52 52 53 #: includes/class-woo.php:9 54 msgid "Billing First Name" 55 msgstr "" 56 57 #: includes/class-woo.php:10 58 msgid "Billing Last Name" 59 msgstr "" 60 61 #: includes/class-woo.php:11 62 msgid "Billing Company" 63 msgstr "" 64 65 #: includes/class-woo.php:12 66 msgid "Billing Address 1" 67 msgstr "" 68 69 #: includes/class-woo.php:13 70 msgid "Billing Address 2" 71 msgstr "" 72 73 #: includes/class-woo.php:14 74 msgid "Billing City" 75 msgstr "" 76 77 #: includes/class-woo.php:15 78 msgid "Billing State" 79 msgstr "" 80 81 #: includes/class-woo.php:16 82 msgid "Billing Postal/Zip Code" 83 msgstr "" 84 85 #: includes/class-woo.php:17 86 msgid "Billing Country / Region" 87 msgstr "" 88 89 #: includes/class-woo.php:18 90 msgid "Email Address" 91 msgstr "" 92 93 #: includes/class-woo.php:19 94 msgid "Billing Phone Number" 95 msgstr "" 96 97 #: includes/class-woo.php:22 98 msgid "Shipping First Name" 99 msgstr "" 100 101 #: includes/class-woo.php:23 102 msgid "Shipping Last Name" 103 msgstr "" 104 105 #: includes/class-woo.php:24 106 msgid "Shipping Company" 107 msgstr "" 108 109 #: includes/class-woo.php:25 110 msgid "Shipping Address 1" 111 msgstr "" 112 113 #: includes/class-woo.php:26 114 msgid "Shipping Address 2" 115 msgstr "" 116 117 #: includes/class-woo.php:27 118 msgid "Shipping City" 119 msgstr "" 120 121 #: includes/class-woo.php:28 122 msgid "Shipping State" 123 msgstr "" 124 125 #: includes/class-woo.php:29 126 msgid "Shipping Postal/Zip Code" 127 msgstr "" 128 129 #: includes/class-woo.php:30 130 msgid "Shipping Country / Region" 131 msgstr "" 132 133 #: includes/class-woo.php:31 134 msgid "Shipping Phone Number" 135 msgstr "" 136 53 137 #: includes/class-woo.php:34 138 #: includes/class-woo.php:59 139 msgid "Order id" 140 msgstr "" 141 142 #: includes/class-woo.php:35 143 #: includes/class-woo.php:60 144 msgid "Order item" 145 msgstr "" 146 147 #: includes/class-woo.php:36 54 148 #: includes/class-woo.php:61 149 msgid "Order name" 150 msgstr "" 151 152 #: includes/class-woo.php:37 153 #: includes/class-woo.php:62 154 msgid "Shipping name" 155 msgstr "" 156 157 #: includes/class-woo.php:38 158 #: includes/class-woo.php:63 159 msgid "Payment method" 160 msgstr "" 161 162 #: includes/class-woo.php:39 163 #: includes/class-woo.php:64 55 164 msgid "Total" 56 165 msgstr "" 57 166 58 #: includes/class-woo.php:35 59 #: includes/class-woo.php:57 60 msgid "Order item" 61 msgstr "" 62 63 #: includes/class-woo.php:36 167 #: includes/class-woo.php:40 168 msgid "Order time" 169 msgstr "" 170 171 #: includes/class-woo.php:41 172 msgid "Order notes" 173 msgstr "" 174 64 175 #: includes/class-woo.php:58 65 msgid "Order name"66 msgstr ""67 68 #: includes/class-woo.php:3769 #: includes/class-woo.php:5970 msgid "Shipping name"71 msgstr ""72 73 #: includes/class-woo.php:3874 #: includes/class-woo.php:6075 msgid "Payment method"76 msgstr ""77 78 #: includes/class-woo.php:3979 msgid "Order time"80 msgstr ""81 82 #: includes/class-woo.php:5683 176 msgid "You have a new order." 84 177 msgstr "" 85 178 86 #: includes/class-woo.php:9 4179 #: includes/class-woo.php:96 87 180 msgid "Add a new order" 88 181 msgstr "" 89 182 90 183 #: includes/class-woo.php:99 184 msgid "Order status changed:" 185 msgstr "" 186 187 #: includes/class-woo.php:107 91 188 msgid "You can use these tags in the message template:" 92 189 msgstr "" 93 190 94 #: includes/class-woo.php:10 0191 #: includes/class-woo.php:108 95 192 msgid "(Click tag to insert into the template)" 96 193 msgstr "" 97 194 98 #: includes/class-woo.php:1 05195 #: includes/class-woo.php:113 99 196 msgid "Default Item" 100 197 msgstr "" 101 198 102 #: includes/class-woo.php:1 16199 #: includes/class-woo.php:124 103 200 msgid "Billing Fields" 104 201 msgstr "" 105 202 106 #: includes/class-woo.php:1 22203 #: includes/class-woo.php:130 107 204 msgid "Shipping Fields" 108 205 msgstr "" 109 206 110 #: includes/class-woo.php:1 28207 #: includes/class-woo.php:136 111 208 msgid "Additional Fields" 112 209 msgstr "" 113 210 114 #: includes/class-woo.php:1 37211 #: includes/class-woo.php:145 115 212 msgid "Buyer Information" 116 213 msgstr "" 117 214 118 #: includes/class-woo.php:1 44215 #: includes/class-woo.php:152 119 216 msgid "Recipient Information" 120 217 msgstr "" 121 218 122 #: includes/class-woo.php:1 56219 #: includes/class-woo.php:164 123 220 msgid "Template" 124 221 msgstr "" 125 222 126 #: includes/class-woo.php:1 67223 #: includes/class-woo.php:175 127 224 msgid "* If you do not enter any text, the system will use the default template." 128 225 msgstr "" 129 226 130 227 #: includes/page-setup.php:9 131 #: wp-line-notify.php:3 21228 #: wp-line-notify.php:333 132 229 msgid "LINE Notify token is required!" 133 230 msgstr "" 134 231 135 232 #: includes/page-setup.php:17 136 #: wp-line-notify.php:11 2233 #: wp-line-notify.php:115 137 234 msgid "Line Notify Setting" 138 235 msgstr "" … … 193 290 #: includes/page-setup.php:103 194 291 msgid "User register" 292 msgstr "" 293 294 #: includes/page-setup.php:111 295 msgid "WooCommerce" 195 296 msgstr "" 196 297 … … 233 334 msgstr "" 234 335 235 #: wp-line-notify.php:11 3336 #: wp-line-notify.php:116 236 337 msgid "WP Line Notify" 237 338 msgstr "" 238 339 239 #: wp-line-notify.php:12 4340 #: wp-line-notify.php:127 240 341 msgid "Settings" 241 342 msgstr "" 242 343 243 #: wp-line-notify.php:1 39344 #: wp-line-notify.php:142 244 345 msgid "Send test ok!" 245 346 msgstr "" 246 347 247 #: wp-line-notify.php:14 2348 #: wp-line-notify.php:145 248 349 msgid "Error on send LINE Notify." 249 350 msgstr "" 250 351 251 #: wp-line-notify.php:1 57352 #: wp-line-notify.php:160 252 353 msgid "publish a post" 253 354 msgstr "" 254 355 255 #: wp-line-notify.php:1 58356 #: wp-line-notify.php:161 256 357 msgid "pending a post" 257 358 msgstr "" 258 359 259 #: wp-line-notify.php:18 3360 #: wp-line-notify.php:186 260 361 msgid "You have a new comment." 261 362 msgstr "" 262 363 263 #: wp-line-notify.php:19 0364 #: wp-line-notify.php:193 264 365 msgid "You have a new user register." 265 366 msgstr "" 266 367 267 #: wp-line-notify.php:19 3368 #: wp-line-notify.php:196 268 369 msgid "Username:" 269 370 msgstr "" 270 371 271 #: wp-line-notify.php:300 372 #: wp-line-notify.php:295 373 msgid "There is an order id %1$d, and the state is changed to %2$s." 374 msgstr "" 375 376 #: wp-line-notify.php:312 272 377 msgid "You have a new contact message." 273 378 msgstr "" 274 379 275 #: wp-line-notify.php:3 03380 #: wp-line-notify.php:315 276 381 msgid "from:" 277 382 msgstr "" 278 383 279 #: wp-line-notify.php:3 07384 #: wp-line-notify.php:319 280 385 msgid "email:" 281 386 msgstr "" 282 387 283 #: wp-line-notify.php:3 11388 #: wp-line-notify.php:323 284 389 msgid "message:" 285 390 msgstr "" 286 391 287 #: wp-line-notify.php:3 23392 #: wp-line-notify.php:335 288 393 msgid "Plase write something !" 289 394 msgstr "" -
wp-line-notify/trunk/readme.txt
r2617598 r2786611 3 3 Tags: notify, plugin, line, WooCommerce, Elementor, Contact Form 4 4 Requires at least: 4.8 5 Tested up to: 5.86 Requires PHP: 5.67 Stable tag: 1.3. 15 Tested up to: 6.0.2 6 Requires PHP: 7.2 7 Stable tag: 1.3.2 8 8 License: GPLv3 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 29 29 30 30 1. screenshot-1.png 31 2. screenshot-2.png32 31 33 32 == Changelog == 33 34 = 1.3.2 - 2022-09-19 = 35 * Fixed some bug. (WooCommerce default template) 36 * Add Order status changed notify. 34 37 35 38 = 1.3.1 - 2021-10-21 = -
wp-line-notify/trunk/wp-line-notify.php
r2617598 r2786611 3 3 * Plugin Name: WordPress LINE Notify 4 4 * Description: This plugin can send a alert message by LINE Notify 5 * Version: 1.3. 15 * Version: 1.3.2 6 6 * Author: Simon Chuang 7 7 * Author URI: https://github.com/mark2me/wp-line-notify … … 41 41 require_once( SIG_LINE_NOTIFY_DIR . '/includes/class-woo.php' ); 42 42 43 44 43 // actions 45 44 add_action( 'plugins_loaded' , array($this, 'load_textdomain' ) ); … … 69 68 70 69 if( isset($this->options['woocommerce']) && $this->options['woocommerce'] == 1 && is_plugin_active( 'woocommerce/woocommerce.php' ) ){ 71 add_action( 'woocommerce_checkout_update_order_meta', array($this,'new_woocommerce_order_alert') , 15, 3 ); 72 } 70 add_action( 'woocommerce_new_order', array($this,'new_woocommerce_order_alert') ,10, 2); 71 } 72 73 if( !empty($this->options['woo_status']) && is_plugin_active( 'woocommerce/woocommerce.php' ) ){ 74 add_action( 'woocommerce_order_status_changed', array($this,'update_woocommerce_order_status') ,10, 4); 75 } 73 76 74 77 if( isset($this->options['wpcf7']) && is_array($this->options['wpcf7']) && count($this->options['wpcf7']) > 0 && is_plugin_active('contact-form-7/wp-contact-form-7.php') ){ … … 195 198 } 196 199 197 public function new_woocommerce_order_alert( $order_get_id ) { 198 199 $order = wc_get_order( $order_get_id ); 200 public function new_woocommerce_order_alert( $order_id, $order ) { 201 200 202 $order_data = $order->get_data(); 201 202 203 203 204 if( isset($this->options['woocommerce_tpl']) && !empty($this->options['woocommerce_tpl']) ){ 204 205 $message = $this->options['woocommerce_tpl']; 205 206 }else{ 206 207 207 $message = WP_LINE_NOTIFY_WOO::form(); 208 208 } 209 209 210 //order211 210 $order_product = ''; 212 211 if(isset($order_data['line_items']) && count($order_data['line_items'])>0){ … … 216 215 $sku = $product->get_sku(); 217 216 if( !empty($sku) ){ 218 $order_product .= "\n {$item['name']} [" . $product->get_sku() . "] x {$item['quantity']}";217 $order_product .= "\n {$item['name']} [" . $product->get_sku() . "] x {$item['quantity']}"; 219 218 }else{ 220 219 $order_product .= "\n {$item['name']} x {$item['quantity']}"; … … 229 228 $shipping_name = (isset($order_data['shipping']['first_name']) && isset($order_data['shipping']['last_name'])) ? ($order_data['shipping']['last_name'].$order_data['shipping']['first_name']) : ''; 230 229 231 232 230 $text = array( 231 '[order-id]' => $order_id, 232 '[order-product]' => $order_product, 233 233 '[order-name]' => $order_name, 234 234 '[shipping-name]' => $shipping_name, 235 '[ order-product]' => $order_product,235 '[payment-method]' => (isset($order_data['payment_method_title'])) ? $order_data['payment_method_title'] : '', 236 236 '[total]' => (isset($order_data['total'])) ? $order_data['total'] : '', 237 '[payment-method]' => (isset($order_data['payment_method_title'])) ? $order_data['payment_method_title'] : '',238 237 '[order-time]' => (isset($order_data['date_created'])) ? $order_data['date_created']->date('Y-m-d H:i:s') : '', 239 238 '[customer_note]' => (isset($order_data['customer_note'])) ? $order_data['customer_note'] : '', … … 287 286 } 288 287 288 public function update_woocommerce_order_status($order_id, $old_status, $new_status, $order) { 289 290 $options = get_option(SIG_LINE_NOTIFY_OPTIONS); 291 if( !empty($options['woo_status']) ) { 292 $my_status = (!empty($options['woo_status'])); 293 if( in_array( 'wc-'.$new_status, $options['woo_status'] ) ){ 294 295 $message = sprintf( __('There is an order id %1$d, and the state is changed to %2$s.', 'wp-line-notify'), $order_id, wc_get_order_status_name($new_status) ); 296 $this->send_msg( $message ); 297 } 298 } 299 } 300 289 301 290 302 public function new_wpcf7_message($cf7) {
Note: See TracChangeset
for help on using the changeset viewer.