Changeset 1545049
- Timestamp:
- 12/03/2016 12:25:59 PM (9 years ago)
- Location:
- wc-return-product/trunk
- Files:
-
- 3 edited
-
includes/wc_functions.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
wc_return_product.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-return-product/trunk/includes/wc_functions.php
r1452033 r1545049 70 70 $order->add_order_note($note, 0); 71 71 } 72 73 /** 74 * 75 * Filter button return form 76 * 77 */ 78 add_filter( 'wc_return_order_button', 'wc_return_order_button_callback', 10, 1 ); 79 function wc_return_order_button_callback( $button ) 80 { 81 return $button; 82 } 83 84 /** 85 * 86 * Filter HTML form 87 * 88 */ 89 add_filter( 'wc_return_order_form', 'wc_return_order_form_callback', 10, 1 ); 90 function wc_return_order_form_callback( $form ) 91 { 92 return $form; 93 } -
wc-return-product/trunk/readme.txt
r1452034 r1545049 4 4 Requires at least: 3.8.1 5 5 Tested up to: 4.4.2 6 Stable tag: 1. 3.46 Stable tag: 1.4.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 17 17 18 18 You can specify order statuses for the WC Return form will be available. 19 20 Filter for return button: 'wc_return_order_button' 21 Filter for return form: 'wc_return_order_form' 22 23 Action before send email: 'wc_before_send_email' 24 19 25 20 26 **If you find a bug or want to make an upgrade fill free to do it at [GitHub](https://github.com/pacocastillo/WC-Return-Products)** … … 34 40 35 41 == Changelog == 42 43 = 1.4.0 = 44 * Added textfield in form 45 * Added WP filters 36 46 37 47 = 1.3.4 = -
wc-return-product/trunk/wc_return_product.php
r1452034 r1545049 8 8 * Plugin URL: http://castillogomez.com/ 9 9 * Description: Adds a form to order for return product 10 * Version: 1. 3.410 * Version: 1.4.0 11 11 * Author: Paco Castillo 12 12 * Author URI: http://castillogomez.com/ … … 57 57 58 58 $products = $order->get_items(); 59 echo '<a class="button return-form-product" href="#">' . __('Return order','wc_return') . '</a>'; 59 echo apply_filters( 'wc_return_order_button', '<a class="button return-form-product" href="#">' . __('Return order','wc_return') . '</a>' ); 60 ob_start(); 60 61 ?> 61 62 <form id="wc-form-return" action="" method="post"> … … 72 73 </select> 73 74 <small><?php _e('You can select multiple by holding down the CMD or Ctrl key.','wc_return'); ?></small> 75 <textarea name="wc_message" id="wc_message" cols="30" rows="10" placeholder="<?php _e('Explain the reasons for your return', 'wc_return') ?>"></textarea> 74 76 <input type="hidden" name="order" value="<?php echo $order->id; ?>" /> 75 77 <input type="hidden" name="customer" value="<?php echo $order->billing_email; ?>" /> … … 78 80 <div class="message"></div> 79 81 <?php 82 $form = ob_get_clean(); 83 echo apply_filters( 'wc_return_order_form', $form ); 80 84 } 81 85 … … 89 93 { 90 94 global $woocommerce; 95 91 96 $customer = $woocommerce->customer; 92 97 $json = array(); … … 134 139 } 135 140 include_once(dirname(__FILE__) . "/template/email_items.php"); 141 142 if ( $_POST['wc_message'] != '' ) { 143 $note .= '<br><br>'; 144 $note .= '<p>'.__('And the explanation:', 'wc_return').'</p>'; 145 $not .= apply_filters( 'the_content', $_POST['wc_message'] ); 146 } 136 147 137 148 include_once(dirname(__FILE__) . "/template/email_footer.php");
Note: See TracChangeset
for help on using the changeset viewer.