Changeset 1349758
- Timestamp:
- 02/13/2016 12:05:22 PM (10 years ago)
- Location:
- wc-return-product/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wc_return_product.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-return-product/trunk/readme.txt
r1263958 r1349758 4 4 Requires at least: 3.8.1 5 5 Tested up to: 4.2.4 6 Stable tag: 1. 2.26 Stable tag: 1.3 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 35 35 == Changelog == 36 36 37 = 1.3 = 38 * Add new order status 39 * Add note to order when products want to be returned 40 37 41 = 1.2.2 = 38 42 * Fix 4.3 WP update -
wc-return-product/trunk/wc_return_product.php
r1263958 r1349758 8 8 Plugin URL: http://castillogomez.com/ 9 9 Description: Adds a form to order for return product 10 Version: 1. 2.210 Version: 1.3 11 11 Author: Paco Castillo 12 12 Author URI: http://castillogomez.com/ … … 19 19 **/ 20 20 if (!function_exists('is_plugin_active_for_network')) 21 require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 21 require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 22 22 23 if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || is_plugin_active_for_network('woocommerce/woocommerce.php') ) { 23 24 25 require_once( plugin_dir_path( __FILE__ ) . '/includes/wc_functions.php' ); 26 24 27 add_action('wp_head','wc_return_products_ajaxurl'); 25 28 … … 35 38 load_theme_textdomain('wc_return', plugin_dir_path( __FILE__ ) . 'languages'); 36 39 wp_enqueue_script( 'wc_return_form', plugins_url( 'assets/wc_return_form.js', __FILE__ ) , array('jquery'), false, true ); 40 wc_create_custom_order_state(); 37 41 } 38 42 … … 118 122 $products = array(); 119 123 $items = $order->get_items(); 124 // Create note for add to order 125 $note = __('These products want to be returned: ', 'wc_return'); 126 $n_prod = 0; 120 127 foreach ($_POST['wc_products'] as $prod_id) { 121 128 $p = new WC_Product( (int)sanitize_text_field($prod_id) ); 122 129 if ( $p ) { 130 $note .= (!$n_prod) ? $p->get_title() : ', '.$p->get_title(); 131 $n_prod++; 123 132 array_push($products, $p->id ); 124 133 } … … 145 154 $send = 1; 146 155 remove_filter( 'wp_mail_content_type', 'wc_return_form_set_html_content_type' ); 156 157 // Change status and add note to order 158 do_action('wc_before_send_email', $order_id, $note); 147 159 148 160 $json['send'] = $send;
Note: See TracChangeset
for help on using the changeset viewer.