@@ -10,13 +10,13 @@ discard block |
||
| 10 | 10 | ?> |
| 11 | 11 | <ul class="order_notes"> |
| 12 | 12 | <?php |
| 13 | - if ( $notes ) { |
|
| 14 | - foreach ( $notes as $note ) { |
|
| 15 | - $css_class = array( 'note' ); |
|
| 16 | - $css_class[] = $note->customer_note ? 'customer-note' : ''; |
|
| 17 | - $css_class[] = 'system' === $note->added_by ? 'system-note' : ''; |
|
| 18 | - $css_class = apply_filters( 'woocommerce_order_note_class', array_filter( $css_class ), $note ); |
|
| 19 | - ?> |
|
| 13 | + if ( $notes ) { |
|
| 14 | + foreach ( $notes as $note ) { |
|
| 15 | + $css_class = array( 'note' ); |
|
| 16 | + $css_class[] = $note->customer_note ? 'customer-note' : ''; |
|
| 17 | + $css_class[] = 'system' === $note->added_by ? 'system-note' : ''; |
|
| 18 | + $css_class = apply_filters( 'woocommerce_order_note_class', array_filter( $css_class ), $note ); |
|
| 19 | + ?> |
|
| 20 | 20 | <li rel="<?php echo absint( $note->id ); ?>" class="<?php echo esc_attr( implode( ' ', $css_class ) ); ?>"> |
| 21 | 21 | <div class="note_content"> |
| 22 | 22 | <?php echo wpautop( wptexturize( wp_kses_post( $note->content ) ) ); // @codingStandardsIgnoreLine ?> |
@@ -24,25 +24,25 @@ discard block |
||
| 24 | 24 | <p class="meta"> |
| 25 | 25 | <abbr class="exact-date" title="<?php echo esc_attr( $note->date_created->date( 'Y-m-d H:i:s' ) ); ?>"> |
| 26 | 26 | <?php |
| 27 | - /* translators: %1$s: note date %2$s: note time */ |
|
| 28 | - echo esc_html( sprintf( __( '%1$s at %2$s', 'woocommerce' ), $note->date_created->date_i18n( wc_date_format() ), $note->date_created->date_i18n( wc_time_format() ) ) ); |
|
| 29 | - ?> |
|
| 27 | + /* translators: %1$s: note date %2$s: note time */ |
|
| 28 | + echo esc_html( sprintf( __( '%1$s at %2$s', 'woocommerce' ), $note->date_created->date_i18n( wc_date_format() ), $note->date_created->date_i18n( wc_time_format() ) ) ); |
|
| 29 | + ?> |
|
| 30 | 30 | </abbr> |
| 31 | 31 | <?php |
| 32 | - if ( 'system' !== $note->added_by ) : |
|
| 33 | - /* translators: %s: note author */ |
|
| 34 | - echo esc_html( sprintf( ' ' . __( 'by %s', 'woocommerce' ), $note->added_by ) ); |
|
| 35 | - endif; |
|
| 36 | - ?> |
|
| 32 | + if ( 'system' !== $note->added_by ) : |
|
| 33 | + /* translators: %s: note author */ |
|
| 34 | + echo esc_html( sprintf( ' ' . __( 'by %s', 'woocommerce' ), $note->added_by ) ); |
|
| 35 | + endif; |
|
| 36 | + ?> |
|
| 37 | 37 | <a href="#" class="delete_note" role="button"><?php esc_html_e( 'Delete note', 'woocommerce' ); ?></a> |
| 38 | 38 | </p> |
| 39 | 39 | </li> |
| 40 | 40 | <?php |
| 41 | - } |
|
| 42 | - } else { |
|
| 43 | - ?> |
|
| 41 | + } |
|
| 42 | + } else { |
|
| 43 | + ?> |
|
| 44 | 44 | <li class="no-items"><?php esc_html_e( 'There are no notes yet.', 'woocommerce' ); ?></li> |
| 45 | 45 | <?php |
| 46 | - } |
|
| 47 | - ?> |
|
| 46 | + } |
|
| 47 | + ?> |
|
| 48 | 48 | </ul> |
@@ -5,43 +5,43 @@ |
||
| 5 | 5 | * @package WooCommerce\Admin |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -defined( 'ABSPATH' ) || exit; |
|
| 8 | +defined('ABSPATH') || exit; |
|
| 9 | 9 | |
| 10 | 10 | ?> |
| 11 | 11 | <ul class="order_notes"> |
| 12 | 12 | <?php |
| 13 | - if ( $notes ) { |
|
| 14 | - foreach ( $notes as $note ) { |
|
| 15 | - $css_class = array( 'note' ); |
|
| 13 | + if ($notes) { |
|
| 14 | + foreach ($notes as $note) { |
|
| 15 | + $css_class = array('note'); |
|
| 16 | 16 | $css_class[] = $note->customer_note ? 'customer-note' : ''; |
| 17 | 17 | $css_class[] = 'system' === $note->added_by ? 'system-note' : ''; |
| 18 | - $css_class = apply_filters( 'woocommerce_order_note_class', array_filter( $css_class ), $note ); |
|
| 18 | + $css_class = apply_filters('woocommerce_order_note_class', array_filter($css_class), $note); |
|
| 19 | 19 | ?> |
| 20 | - <li rel="<?php echo absint( $note->id ); ?>" class="<?php echo esc_attr( implode( ' ', $css_class ) ); ?>"> |
|
| 20 | + <li rel="<?php echo absint($note->id); ?>" class="<?php echo esc_attr(implode(' ', $css_class)); ?>"> |
|
| 21 | 21 | <div class="note_content"> |
| 22 | - <?php echo wpautop( wptexturize( wp_kses_post( $note->content ) ) ); // @codingStandardsIgnoreLine ?> |
|
| 22 | + <?php echo wpautop(wptexturize(wp_kses_post($note->content))); // @codingStandardsIgnoreLine ?> |
|
| 23 | 23 | </div> |
| 24 | 24 | <p class="meta"> |
| 25 | - <abbr class="exact-date" title="<?php echo esc_attr( $note->date_created->date( 'Y-m-d H:i:s' ) ); ?>"> |
|
| 25 | + <abbr class="exact-date" title="<?php echo esc_attr($note->date_created->date('Y-m-d H:i:s')); ?>"> |
|
| 26 | 26 | <?php |
| 27 | 27 | /* translators: %1$s: note date %2$s: note time */ |
| 28 | - echo esc_html( sprintf( __( '%1$s at %2$s', 'woocommerce' ), $note->date_created->date_i18n( wc_date_format() ), $note->date_created->date_i18n( wc_time_format() ) ) ); |
|
| 28 | + echo esc_html(sprintf(__('%1$s at %2$s', 'woocommerce'), $note->date_created->date_i18n(wc_date_format()), $note->date_created->date_i18n(wc_time_format()))); |
|
| 29 | 29 | ?> |
| 30 | 30 | </abbr> |
| 31 | 31 | <?php |
| 32 | - if ( 'system' !== $note->added_by ) : |
|
| 32 | + if ('system' !== $note->added_by) : |
|
| 33 | 33 | /* translators: %s: note author */ |
| 34 | - echo esc_html( sprintf( ' ' . __( 'by %s', 'woocommerce' ), $note->added_by ) ); |
|
| 34 | + echo esc_html(sprintf(' ' . __('by %s', 'woocommerce'), $note->added_by)); |
|
| 35 | 35 | endif; |
| 36 | 36 | ?> |
| 37 | - <a href="#" class="delete_note" role="button"><?php esc_html_e( 'Delete note', 'woocommerce' ); ?></a> |
|
| 37 | + <a href="#" class="delete_note" role="button"><?php esc_html_e('Delete note', 'woocommerce'); ?></a> |
|
| 38 | 38 | </p> |
| 39 | 39 | </li> |
| 40 | 40 | <?php |
| 41 | 41 | } |
| 42 | 42 | } else { |
| 43 | 43 | ?> |
| 44 | - <li class="no-items"><?php esc_html_e( 'There are no notes yet.', 'woocommerce' ); ?></li> |
|
| 44 | + <li class="no-items"><?php esc_html_e('There are no notes yet.', 'woocommerce'); ?></li> |
|
| 45 | 45 | <?php |
| 46 | 46 | } |
| 47 | 47 | ?> |
@@ -14,15 +14,15 @@ discard block |
||
| 14 | 14 | <label for="grouped_products"><?php esc_html_e( 'Grouped products', 'woocommerce' ); ?></label> |
| 15 | 15 | <select class="wc-product-search" multiple="multiple" style="width: 50%;" id="grouped_products" name="grouped_products[]" data-sortable="true" data-placeholder="<?php esc_attr_e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products" data-exclude="<?php echo intval( $post->ID ); ?>"> |
| 16 | 16 | <?php |
| 17 | - $product_ids = $product_object->is_type( 'grouped' ) ? $product_object->get_children( 'edit' ) : array(); |
|
| 17 | + $product_ids = $product_object->is_type( 'grouped' ) ? $product_object->get_children( 'edit' ) : array(); |
|
| 18 | 18 | |
| 19 | - foreach ( $product_ids as $product_id ) { |
|
| 20 | - $product = wc_get_product( $product_id ); |
|
| 21 | - if ( is_object( $product ) ) { |
|
| 22 | - echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>'; |
|
| 23 | - } |
|
| 24 | - } |
|
| 25 | - ?> |
|
| 19 | + foreach ( $product_ids as $product_id ) { |
|
| 20 | + $product = wc_get_product( $product_id ); |
|
| 21 | + if ( is_object( $product ) ) { |
|
| 22 | + echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>'; |
|
| 23 | + } |
|
| 24 | + } |
|
| 25 | + ?> |
|
| 26 | 26 | </select> <?php echo wc_help_tip( __( 'This lets you choose which products are part of this group.', 'woocommerce' ) ); // WPCS: XSS ok. ?> |
| 27 | 27 | </p> |
| 28 | 28 | </div> |
@@ -32,15 +32,15 @@ discard block |
||
| 32 | 32 | <label for="upsell_ids"><?php esc_html_e( 'Upsells', 'woocommerce' ); ?></label> |
| 33 | 33 | <select class="wc-product-search" multiple="multiple" style="width: 50%;" id="upsell_ids" name="upsell_ids[]" data-placeholder="<?php esc_attr_e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations" data-exclude="<?php echo intval( $post->ID ); ?>"> |
| 34 | 34 | <?php |
| 35 | - $product_ids = $product_object->get_upsell_ids( 'edit' ); |
|
| 35 | + $product_ids = $product_object->get_upsell_ids( 'edit' ); |
|
| 36 | 36 | |
| 37 | - foreach ( $product_ids as $product_id ) { |
|
| 38 | - $product = wc_get_product( $product_id ); |
|
| 39 | - if ( is_object( $product ) ) { |
|
| 40 | - echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>'; |
|
| 41 | - } |
|
| 42 | - } |
|
| 43 | - ?> |
|
| 37 | + foreach ( $product_ids as $product_id ) { |
|
| 38 | + $product = wc_get_product( $product_id ); |
|
| 39 | + if ( is_object( $product ) ) { |
|
| 40 | + echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>'; |
|
| 41 | + } |
|
| 42 | + } |
|
| 43 | + ?> |
|
| 44 | 44 | </select> <?php echo wc_help_tip( __( 'Upsells are products which you recommend instead of the currently viewed product, for example, products that are more profitable or better quality or more expensive.', 'woocommerce' ) ); // WPCS: XSS ok. ?> |
| 45 | 45 | </p> |
| 46 | 46 | |
@@ -48,15 +48,15 @@ discard block |
||
| 48 | 48 | <label for="crosssell_ids"><?php esc_html_e( 'Cross-sells', 'woocommerce' ); ?></label> |
| 49 | 49 | <select class="wc-product-search" multiple="multiple" style="width: 50%;" id="crosssell_ids" name="crosssell_ids[]" data-placeholder="<?php esc_attr_e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations" data-exclude="<?php echo intval( $post->ID ); ?>"> |
| 50 | 50 | <?php |
| 51 | - $product_ids = $product_object->get_cross_sell_ids( 'edit' ); |
|
| 51 | + $product_ids = $product_object->get_cross_sell_ids( 'edit' ); |
|
| 52 | 52 | |
| 53 | - foreach ( $product_ids as $product_id ) { |
|
| 54 | - $product = wc_get_product( $product_id ); |
|
| 55 | - if ( is_object( $product ) ) { |
|
| 56 | - echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>'; |
|
| 57 | - } |
|
| 58 | - } |
|
| 59 | - ?> |
|
| 53 | + foreach ( $product_ids as $product_id ) { |
|
| 54 | + $product = wc_get_product( $product_id ); |
|
| 55 | + if ( is_object( $product ) ) { |
|
| 56 | + echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>'; |
|
| 57 | + } |
|
| 58 | + } |
|
| 59 | + ?> |
|
| 60 | 60 | </select> <?php echo wc_help_tip( __( 'Cross-sells are products which you promote in the cart, based on the current product.', 'woocommerce' ) ); // WPCS: XSS ok. ?> |
| 61 | 61 | </p> |
| 62 | 62 | </div> |
@@ -5,61 +5,61 @@ |
||
| 5 | 5 | * @package WooCommerce\Admin |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -defined( 'ABSPATH' ) || exit; |
|
| 8 | +defined('ABSPATH') || exit; |
|
| 9 | 9 | ?> |
| 10 | 10 | <div id="linked_product_data" class="panel woocommerce_options_panel hidden"> |
| 11 | 11 | |
| 12 | 12 | <div class="options_group show_if_grouped"> |
| 13 | 13 | <p class="form-field"> |
| 14 | - <label for="grouped_products"><?php esc_html_e( 'Grouped products', 'woocommerce' ); ?></label> |
|
| 15 | - <select class="wc-product-search" multiple="multiple" style="width: 50%;" id="grouped_products" name="grouped_products[]" data-sortable="true" data-placeholder="<?php esc_attr_e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products" data-exclude="<?php echo intval( $post->ID ); ?>"> |
|
| 14 | + <label for="grouped_products"><?php esc_html_e('Grouped products', 'woocommerce'); ?></label> |
|
| 15 | + <select class="wc-product-search" multiple="multiple" style="width: 50%;" id="grouped_products" name="grouped_products[]" data-sortable="true" data-placeholder="<?php esc_attr_e('Search for a product…', 'woocommerce'); ?>" data-action="woocommerce_json_search_products" data-exclude="<?php echo intval($post->ID); ?>"> |
|
| 16 | 16 | <?php |
| 17 | - $product_ids = $product_object->is_type( 'grouped' ) ? $product_object->get_children( 'edit' ) : array(); |
|
| 17 | + $product_ids = $product_object->is_type('grouped') ? $product_object->get_children('edit') : array(); |
|
| 18 | 18 | |
| 19 | - foreach ( $product_ids as $product_id ) { |
|
| 20 | - $product = wc_get_product( $product_id ); |
|
| 21 | - if ( is_object( $product ) ) { |
|
| 22 | - echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>'; |
|
| 19 | + foreach ($product_ids as $product_id) { |
|
| 20 | + $product = wc_get_product($product_id); |
|
| 21 | + if (is_object($product)) { |
|
| 22 | + echo '<option value="' . esc_attr($product_id) . '"' . selected(true, true, false) . '>' . esc_html(wp_strip_all_tags($product->get_formatted_name())) . '</option>'; |
|
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 | ?> |
| 26 | - </select> <?php echo wc_help_tip( __( 'This lets you choose which products are part of this group.', 'woocommerce' ) ); // WPCS: XSS ok. ?> |
|
| 26 | + </select> <?php echo wc_help_tip(__('This lets you choose which products are part of this group.', 'woocommerce')); // WPCS: XSS ok. ?> |
|
| 27 | 27 | </p> |
| 28 | 28 | </div> |
| 29 | 29 | |
| 30 | 30 | <div class="options_group"> |
| 31 | 31 | <p class="form-field"> |
| 32 | - <label for="upsell_ids"><?php esc_html_e( 'Upsells', 'woocommerce' ); ?></label> |
|
| 33 | - <select class="wc-product-search" multiple="multiple" style="width: 50%;" id="upsell_ids" name="upsell_ids[]" data-placeholder="<?php esc_attr_e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations" data-exclude="<?php echo intval( $post->ID ); ?>"> |
|
| 32 | + <label for="upsell_ids"><?php esc_html_e('Upsells', 'woocommerce'); ?></label> |
|
| 33 | + <select class="wc-product-search" multiple="multiple" style="width: 50%;" id="upsell_ids" name="upsell_ids[]" data-placeholder="<?php esc_attr_e('Search for a product…', 'woocommerce'); ?>" data-action="woocommerce_json_search_products_and_variations" data-exclude="<?php echo intval($post->ID); ?>"> |
|
| 34 | 34 | <?php |
| 35 | - $product_ids = $product_object->get_upsell_ids( 'edit' ); |
|
| 35 | + $product_ids = $product_object->get_upsell_ids('edit'); |
|
| 36 | 36 | |
| 37 | - foreach ( $product_ids as $product_id ) { |
|
| 38 | - $product = wc_get_product( $product_id ); |
|
| 39 | - if ( is_object( $product ) ) { |
|
| 40 | - echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>'; |
|
| 37 | + foreach ($product_ids as $product_id) { |
|
| 38 | + $product = wc_get_product($product_id); |
|
| 39 | + if (is_object($product)) { |
|
| 40 | + echo '<option value="' . esc_attr($product_id) . '"' . selected(true, true, false) . '>' . esc_html(wp_strip_all_tags($product->get_formatted_name())) . '</option>'; |
|
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | ?> |
| 44 | - </select> <?php echo wc_help_tip( __( 'Upsells are products which you recommend instead of the currently viewed product, for example, products that are more profitable or better quality or more expensive.', 'woocommerce' ) ); // WPCS: XSS ok. ?> |
|
| 44 | + </select> <?php echo wc_help_tip(__('Upsells are products which you recommend instead of the currently viewed product, for example, products that are more profitable or better quality or more expensive.', 'woocommerce')); // WPCS: XSS ok. ?> |
|
| 45 | 45 | </p> |
| 46 | 46 | |
| 47 | 47 | <p class="form-field hide_if_grouped hide_if_external"> |
| 48 | - <label for="crosssell_ids"><?php esc_html_e( 'Cross-sells', 'woocommerce' ); ?></label> |
|
| 49 | - <select class="wc-product-search" multiple="multiple" style="width: 50%;" id="crosssell_ids" name="crosssell_ids[]" data-placeholder="<?php esc_attr_e( 'Search for a product…', 'woocommerce' ); ?>" data-action="woocommerce_json_search_products_and_variations" data-exclude="<?php echo intval( $post->ID ); ?>"> |
|
| 48 | + <label for="crosssell_ids"><?php esc_html_e('Cross-sells', 'woocommerce'); ?></label> |
|
| 49 | + <select class="wc-product-search" multiple="multiple" style="width: 50%;" id="crosssell_ids" name="crosssell_ids[]" data-placeholder="<?php esc_attr_e('Search for a product…', 'woocommerce'); ?>" data-action="woocommerce_json_search_products_and_variations" data-exclude="<?php echo intval($post->ID); ?>"> |
|
| 50 | 50 | <?php |
| 51 | - $product_ids = $product_object->get_cross_sell_ids( 'edit' ); |
|
| 51 | + $product_ids = $product_object->get_cross_sell_ids('edit'); |
|
| 52 | 52 | |
| 53 | - foreach ( $product_ids as $product_id ) { |
|
| 54 | - $product = wc_get_product( $product_id ); |
|
| 55 | - if ( is_object( $product ) ) { |
|
| 56 | - echo '<option value="' . esc_attr( $product_id ) . '"' . selected( true, true, false ) . '>' . esc_html( wp_strip_all_tags( $product->get_formatted_name() ) ) . '</option>'; |
|
| 53 | + foreach ($product_ids as $product_id) { |
|
| 54 | + $product = wc_get_product($product_id); |
|
| 55 | + if (is_object($product)) { |
|
| 56 | + echo '<option value="' . esc_attr($product_id) . '"' . selected(true, true, false) . '>' . esc_html(wp_strip_all_tags($product->get_formatted_name())) . '</option>'; |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | ?> |
| 60 | - </select> <?php echo wc_help_tip( __( 'Cross-sells are products which you promote in the cart, based on the current product.', 'woocommerce' ) ); // WPCS: XSS ok. ?> |
|
| 60 | + </select> <?php echo wc_help_tip(__('Cross-sells are products which you promote in the cart, based on the current product.', 'woocommerce')); // WPCS: XSS ok. ?> |
|
| 61 | 61 | </p> |
| 62 | 62 | </div> |
| 63 | 63 | |
| 64 | - <?php do_action( 'woocommerce_product_options_related' ); ?> |
|
| 64 | + <?php do_action('woocommerce_product_options_related'); ?> |
|
| 65 | 65 | </div> |
@@ -1,55 +1,55 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | if ( ! defined( 'ABSPATH' ) ) { |
| 3 | - exit; |
|
| 3 | + exit; |
|
| 4 | 4 | } |
| 5 | 5 | ?> |
| 6 | 6 | <div id="advanced_product_data" class="panel woocommerce_options_panel hidden"> |
| 7 | 7 | |
| 8 | 8 | <div class="options_group hide_if_external hide_if_grouped"> |
| 9 | 9 | <?php |
| 10 | - woocommerce_wp_textarea_input( |
|
| 11 | - array( |
|
| 12 | - 'id' => '_purchase_note', |
|
| 13 | - 'value' => $product_object->get_purchase_note( 'edit' ), |
|
| 14 | - 'label' => __( 'Purchase note', 'woocommerce' ), |
|
| 15 | - 'desc_tip' => true, |
|
| 16 | - 'description' => __( 'Enter an optional note to send the customer after purchase.', 'woocommerce' ), |
|
| 17 | - ) |
|
| 18 | - ); |
|
| 19 | - ?> |
|
| 10 | + woocommerce_wp_textarea_input( |
|
| 11 | + array( |
|
| 12 | + 'id' => '_purchase_note', |
|
| 13 | + 'value' => $product_object->get_purchase_note( 'edit' ), |
|
| 14 | + 'label' => __( 'Purchase note', 'woocommerce' ), |
|
| 15 | + 'desc_tip' => true, |
|
| 16 | + 'description' => __( 'Enter an optional note to send the customer after purchase.', 'woocommerce' ), |
|
| 17 | + ) |
|
| 18 | + ); |
|
| 19 | + ?> |
|
| 20 | 20 | </div> |
| 21 | 21 | |
| 22 | 22 | <div class="options_group"> |
| 23 | 23 | <?php |
| 24 | - woocommerce_wp_text_input( |
|
| 25 | - array( |
|
| 26 | - 'id' => 'menu_order', |
|
| 27 | - 'value' => $product_object->get_menu_order( 'edit' ), |
|
| 28 | - 'label' => __( 'Menu order', 'woocommerce' ), |
|
| 29 | - 'desc_tip' => true, |
|
| 30 | - 'description' => __( 'Custom ordering position.', 'woocommerce' ), |
|
| 31 | - 'type' => 'number', |
|
| 32 | - 'custom_attributes' => array( |
|
| 33 | - 'step' => '1', |
|
| 34 | - ), |
|
| 35 | - ) |
|
| 36 | - ); |
|
| 37 | - ?> |
|
| 24 | + woocommerce_wp_text_input( |
|
| 25 | + array( |
|
| 26 | + 'id' => 'menu_order', |
|
| 27 | + 'value' => $product_object->get_menu_order( 'edit' ), |
|
| 28 | + 'label' => __( 'Menu order', 'woocommerce' ), |
|
| 29 | + 'desc_tip' => true, |
|
| 30 | + 'description' => __( 'Custom ordering position.', 'woocommerce' ), |
|
| 31 | + 'type' => 'number', |
|
| 32 | + 'custom_attributes' => array( |
|
| 33 | + 'step' => '1', |
|
| 34 | + ), |
|
| 35 | + ) |
|
| 36 | + ); |
|
| 37 | + ?> |
|
| 38 | 38 | </div> |
| 39 | 39 | |
| 40 | 40 | <?php if ( post_type_supports( 'product', 'comments' ) ) : ?> |
| 41 | 41 | <div class="options_group reviews"> |
| 42 | 42 | <?php |
| 43 | - woocommerce_wp_checkbox( |
|
| 44 | - array( |
|
| 45 | - 'id' => 'comment_status', |
|
| 46 | - 'value' => $product_object->get_reviews_allowed( 'edit' ) ? 'open' : 'closed', |
|
| 47 | - 'label' => __( 'Enable reviews', 'woocommerce' ), |
|
| 48 | - 'cbvalue' => 'open', |
|
| 49 | - ) |
|
| 50 | - ); |
|
| 51 | - do_action( 'woocommerce_product_options_reviews' ); |
|
| 52 | - ?> |
|
| 43 | + woocommerce_wp_checkbox( |
|
| 44 | + array( |
|
| 45 | + 'id' => 'comment_status', |
|
| 46 | + 'value' => $product_object->get_reviews_allowed( 'edit' ) ? 'open' : 'closed', |
|
| 47 | + 'label' => __( 'Enable reviews', 'woocommerce' ), |
|
| 48 | + 'cbvalue' => 'open', |
|
| 49 | + ) |
|
| 50 | + ); |
|
| 51 | + do_action( 'woocommerce_product_options_reviews' ); |
|
| 52 | + ?> |
|
| 53 | 53 | </div> |
| 54 | 54 | <?php endif; ?> |
| 55 | 55 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 2 | +if (!defined('ABSPATH')) { |
|
| 3 | 3 | exit; |
| 4 | 4 | } |
| 5 | 5 | ?> |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | woocommerce_wp_textarea_input( |
| 11 | 11 | array( |
| 12 | 12 | 'id' => '_purchase_note', |
| 13 | - 'value' => $product_object->get_purchase_note( 'edit' ), |
|
| 14 | - 'label' => __( 'Purchase note', 'woocommerce' ), |
|
| 13 | + 'value' => $product_object->get_purchase_note('edit'), |
|
| 14 | + 'label' => __('Purchase note', 'woocommerce'), |
|
| 15 | 15 | 'desc_tip' => true, |
| 16 | - 'description' => __( 'Enter an optional note to send the customer after purchase.', 'woocommerce' ), |
|
| 16 | + 'description' => __('Enter an optional note to send the customer after purchase.', 'woocommerce'), |
|
| 17 | 17 | ) |
| 18 | 18 | ); |
| 19 | 19 | ?> |
@@ -24,10 +24,10 @@ discard block |
||
| 24 | 24 | woocommerce_wp_text_input( |
| 25 | 25 | array( |
| 26 | 26 | 'id' => 'menu_order', |
| 27 | - 'value' => $product_object->get_menu_order( 'edit' ), |
|
| 28 | - 'label' => __( 'Menu order', 'woocommerce' ), |
|
| 27 | + 'value' => $product_object->get_menu_order('edit'), |
|
| 28 | + 'label' => __('Menu order', 'woocommerce'), |
|
| 29 | 29 | 'desc_tip' => true, |
| 30 | - 'description' => __( 'Custom ordering position.', 'woocommerce' ), |
|
| 30 | + 'description' => __('Custom ordering position.', 'woocommerce'), |
|
| 31 | 31 | 'type' => 'number', |
| 32 | 32 | 'custom_attributes' => array( |
| 33 | 33 | 'step' => '1', |
@@ -37,21 +37,21 @@ discard block |
||
| 37 | 37 | ?> |
| 38 | 38 | </div> |
| 39 | 39 | |
| 40 | - <?php if ( post_type_supports( 'product', 'comments' ) ) : ?> |
|
| 40 | + <?php if (post_type_supports('product', 'comments')) : ?> |
|
| 41 | 41 | <div class="options_group reviews"> |
| 42 | 42 | <?php |
| 43 | 43 | woocommerce_wp_checkbox( |
| 44 | 44 | array( |
| 45 | 45 | 'id' => 'comment_status', |
| 46 | - 'value' => $product_object->get_reviews_allowed( 'edit' ) ? 'open' : 'closed', |
|
| 47 | - 'label' => __( 'Enable reviews', 'woocommerce' ), |
|
| 46 | + 'value' => $product_object->get_reviews_allowed('edit') ? 'open' : 'closed', |
|
| 47 | + 'label' => __('Enable reviews', 'woocommerce'), |
|
| 48 | 48 | 'cbvalue' => 'open', |
| 49 | 49 | ) |
| 50 | 50 | ); |
| 51 | - do_action( 'woocommerce_product_options_reviews' ); |
|
| 51 | + do_action('woocommerce_product_options_reviews'); |
|
| 52 | 52 | ?> |
| 53 | 53 | </div> |
| 54 | 54 | <?php endif; ?> |
| 55 | 55 | |
| 56 | - <?php do_action( 'woocommerce_product_options_advanced' ); ?> |
|
| 56 | + <?php do_action('woocommerce_product_options_advanced'); ?> |
|
| 57 | 57 | </div> |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | - exit; |
|
| 9 | + exit; |
|
| 10 | 10 | } |
| 11 | 11 | ?> |
| 12 | 12 | |
@@ -24,13 +24,13 @@ discard block |
||
| 24 | 24 | </label> |
| 25 | 25 | |
| 26 | 26 | <?php |
| 27 | - foreach ( self::get_product_type_options() as $key => $option ) : |
|
| 28 | - if ( metadata_exists( 'post', $post->ID, '_' . $key ) ) { |
|
| 29 | - $selected_value = is_callable( array( $product_object, "is_$key" ) ) ? $product_object->{"is_$key"}() : 'yes' === get_post_meta( $post->ID, '_' . $key, true ); |
|
| 30 | - } else { |
|
| 31 | - $selected_value = 'yes' === ( isset( $option['default'] ) ? $option['default'] : 'no' ); |
|
| 32 | - } |
|
| 33 | - ?> |
|
| 27 | + foreach ( self::get_product_type_options() as $key => $option ) : |
|
| 28 | + if ( metadata_exists( 'post', $post->ID, '_' . $key ) ) { |
|
| 29 | + $selected_value = is_callable( array( $product_object, "is_$key" ) ) ? $product_object->{"is_$key"}() : 'yes' === get_post_meta( $post->ID, '_' . $key, true ); |
|
| 30 | + } else { |
|
| 31 | + $selected_value = 'yes' === ( isset( $option['default'] ) ? $option['default'] : 'no' ); |
|
| 32 | + } |
|
| 33 | + ?> |
|
| 34 | 34 | <label for="<?php echo esc_attr( $option['id'] ); ?>" class="<?php echo esc_attr( $option['wrapper_class'] ); ?> tips" data-tip="<?php echo esc_attr( $option['description'] ); ?>"> |
| 35 | 35 | <?php echo esc_html( $option['label'] ); ?>: |
| 36 | 36 | <input type="checkbox" name="<?php echo esc_attr( $option['id'] ); ?>" id="<?php echo esc_attr( $option['id'] ); ?>" <?php echo checked( $selected_value, true, false ); ?> /> |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | </ul> |
| 49 | 49 | |
| 50 | 50 | <?php |
| 51 | - self::output_tabs(); |
|
| 52 | - self::output_variations(); |
|
| 53 | - do_action( 'woocommerce_product_data_panels' ); |
|
| 54 | - wc_do_deprecated_action( 'woocommerce_product_write_panels', array(), '2.6', 'Use woocommerce_product_data_panels action instead.' ); |
|
| 55 | - ?> |
|
| 51 | + self::output_tabs(); |
|
| 52 | + self::output_variations(); |
|
| 53 | + do_action( 'woocommerce_product_data_panels' ); |
|
| 54 | + wc_do_deprecated_action( 'woocommerce_product_write_panels', array(), '2.6', 'Use woocommerce_product_data_panels action instead.' ); |
|
| 55 | + ?> |
|
| 56 | 56 | <div class="clear"></div> |
| 57 | 57 | </div> |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | * @package WooCommerce\Admin |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 8 | +if (!defined('ABSPATH')) { |
|
| 9 | 9 | exit; |
| 10 | 10 | } |
| 11 | 11 | ?> |
@@ -15,43 +15,43 @@ discard block |
||
| 15 | 15 | <span class="type_box hidden"> — |
| 16 | 16 | <label for="product-type"> |
| 17 | 17 | <select id="product-type" name="product-type"> |
| 18 | - <optgroup label="<?php esc_attr_e( 'Product Type', 'woocommerce' ); ?>"> |
|
| 19 | - <?php foreach ( wc_get_product_types() as $value => $label ) : ?> |
|
| 20 | - <option value="<?php echo esc_attr( $value ); ?>" <?php echo selected( $product_object->get_type(), $value, false ); ?>><?php echo esc_html( $label ); ?></option> |
|
| 18 | + <optgroup label="<?php esc_attr_e('Product Type', 'woocommerce'); ?>"> |
|
| 19 | + <?php foreach (wc_get_product_types() as $value => $label) : ?> |
|
| 20 | + <option value="<?php echo esc_attr($value); ?>" <?php echo selected($product_object->get_type(), $value, false); ?>><?php echo esc_html($label); ?></option> |
|
| 21 | 21 | <?php endforeach; ?> |
| 22 | 22 | </optgroup> |
| 23 | 23 | </select> |
| 24 | 24 | </label> |
| 25 | 25 | |
| 26 | 26 | <?php |
| 27 | - foreach ( self::get_product_type_options() as $key => $option ) : |
|
| 28 | - if ( metadata_exists( 'post', $post->ID, '_' . $key ) ) { |
|
| 29 | - $selected_value = is_callable( array( $product_object, "is_$key" ) ) ? $product_object->{"is_$key"}() : 'yes' === get_post_meta( $post->ID, '_' . $key, true ); |
|
| 27 | + foreach (self::get_product_type_options() as $key => $option) : |
|
| 28 | + if (metadata_exists('post', $post->ID, '_' . $key)) { |
|
| 29 | + $selected_value = is_callable(array($product_object, "is_$key")) ? $product_object->{"is_$key"}() : 'yes' === get_post_meta($post->ID, '_' . $key, true); |
|
| 30 | 30 | } else { |
| 31 | - $selected_value = 'yes' === ( isset( $option['default'] ) ? $option['default'] : 'no' ); |
|
| 31 | + $selected_value = 'yes' === (isset($option['default']) ? $option['default'] : 'no'); |
|
| 32 | 32 | } |
| 33 | 33 | ?> |
| 34 | - <label for="<?php echo esc_attr( $option['id'] ); ?>" class="<?php echo esc_attr( $option['wrapper_class'] ); ?> tips" data-tip="<?php echo esc_attr( $option['description'] ); ?>"> |
|
| 35 | - <?php echo esc_html( $option['label'] ); ?>: |
|
| 36 | - <input type="checkbox" name="<?php echo esc_attr( $option['id'] ); ?>" id="<?php echo esc_attr( $option['id'] ); ?>" <?php echo checked( $selected_value, true, false ); ?> /> |
|
| 34 | + <label for="<?php echo esc_attr($option['id']); ?>" class="<?php echo esc_attr($option['wrapper_class']); ?> tips" data-tip="<?php echo esc_attr($option['description']); ?>"> |
|
| 35 | + <?php echo esc_html($option['label']); ?>: |
|
| 36 | + <input type="checkbox" name="<?php echo esc_attr($option['id']); ?>" id="<?php echo esc_attr($option['id']); ?>" <?php echo checked($selected_value, true, false); ?> /> |
|
| 37 | 37 | </label> |
| 38 | 38 | <?php endforeach; ?> |
| 39 | 39 | </span> |
| 40 | 40 | |
| 41 | 41 | <ul class="product_data_tabs wc-tabs"> |
| 42 | - <?php foreach ( self::get_product_data_tabs() as $key => $tab ) : ?> |
|
| 43 | - <li class="<?php echo esc_attr( $key ); ?>_options <?php echo esc_attr( $key ); ?>_tab <?php echo esc_attr( isset( $tab['class'] ) ? implode( ' ', (array) $tab['class'] ) : '' ); ?>"> |
|
| 44 | - <a href="#<?php echo esc_attr( $tab['target'] ); ?>"><span><?php echo esc_html( $tab['label'] ); ?></span></a> |
|
| 42 | + <?php foreach (self::get_product_data_tabs() as $key => $tab) : ?> |
|
| 43 | + <li class="<?php echo esc_attr($key); ?>_options <?php echo esc_attr($key); ?>_tab <?php echo esc_attr(isset($tab['class']) ? implode(' ', (array) $tab['class']) : ''); ?>"> |
|
| 44 | + <a href="#<?php echo esc_attr($tab['target']); ?>"><span><?php echo esc_html($tab['label']); ?></span></a> |
|
| 45 | 45 | </li> |
| 46 | 46 | <?php endforeach; ?> |
| 47 | - <?php do_action( 'woocommerce_product_write_panel_tabs' ); ?> |
|
| 47 | + <?php do_action('woocommerce_product_write_panel_tabs'); ?> |
|
| 48 | 48 | </ul> |
| 49 | 49 | |
| 50 | 50 | <?php |
| 51 | 51 | self::output_tabs(); |
| 52 | 52 | self::output_variations(); |
| 53 | - do_action( 'woocommerce_product_data_panels' ); |
|
| 54 | - wc_do_deprecated_action( 'woocommerce_product_write_panels', array(), '2.6', 'Use woocommerce_product_data_panels action instead.' ); |
|
| 53 | + do_action('woocommerce_product_data_panels'); |
|
| 54 | + wc_do_deprecated_action('woocommerce_product_write_panels', array(), '2.6', 'Use woocommerce_product_data_panels action instead.'); |
|
| 55 | 55 | ?> |
| 56 | 56 | <div class="clear"></div> |
| 57 | 57 | </div> |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | - exit; // Exit if accessed directly. |
|
| 10 | + exit; // Exit if accessed directly. |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | $who_refunded = new WP_User( $refund->get_refunded_by() ); |
@@ -17,28 +17,28 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | <td class="name"> |
| 19 | 19 | <?php |
| 20 | - if ( $who_refunded->exists() ) { |
|
| 21 | - printf( |
|
| 22 | - /* translators: 1: refund id 2: refund date 3: username */ |
|
| 23 | - esc_html__( 'Refund #%1$s - %2$s by %3$s', 'woocommerce' ), |
|
| 24 | - esc_html( $refund->get_id() ), |
|
| 25 | - esc_html( wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) ) ), |
|
| 26 | - sprintf( |
|
| 27 | - '<abbr class="refund_by" title="%1$s">%2$s</abbr>', |
|
| 28 | - /* translators: 1: ID who refunded */ |
|
| 29 | - sprintf( esc_attr__( 'ID: %d', 'woocommerce' ), absint( $who_refunded->ID ) ), |
|
| 30 | - esc_html( $who_refunded->display_name ) |
|
| 31 | - ) |
|
| 32 | - ); |
|
| 33 | - } else { |
|
| 34 | - printf( |
|
| 35 | - /* translators: 1: refund id 2: refund date */ |
|
| 36 | - esc_html__( 'Refund #%1$s - %2$s', 'woocommerce' ), |
|
| 37 | - esc_html( $refund->get_id() ), |
|
| 38 | - esc_html( wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) ) ) |
|
| 39 | - ); |
|
| 40 | - } |
|
| 41 | - ?> |
|
| 20 | + if ( $who_refunded->exists() ) { |
|
| 21 | + printf( |
|
| 22 | + /* translators: 1: refund id 2: refund date 3: username */ |
|
| 23 | + esc_html__( 'Refund #%1$s - %2$s by %3$s', 'woocommerce' ), |
|
| 24 | + esc_html( $refund->get_id() ), |
|
| 25 | + esc_html( wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) ) ), |
|
| 26 | + sprintf( |
|
| 27 | + '<abbr class="refund_by" title="%1$s">%2$s</abbr>', |
|
| 28 | + /* translators: 1: ID who refunded */ |
|
| 29 | + sprintf( esc_attr__( 'ID: %d', 'woocommerce' ), absint( $who_refunded->ID ) ), |
|
| 30 | + esc_html( $who_refunded->display_name ) |
|
| 31 | + ) |
|
| 32 | + ); |
|
| 33 | + } else { |
|
| 34 | + printf( |
|
| 35 | + /* translators: 1: refund id 2: refund date */ |
|
| 36 | + esc_html__( 'Refund #%1$s - %2$s', 'woocommerce' ), |
|
| 37 | + esc_html( $refund->get_id() ), |
|
| 38 | + esc_html( wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) ) ) |
|
| 39 | + ); |
|
| 40 | + } |
|
| 41 | + ?> |
|
| 42 | 42 | <?php if ( $refund->get_reason() ) : ?> |
| 43 | 43 | <p class="description"><?php echo esc_html( $refund->get_reason() ); ?></p> |
| 44 | 44 | <?php endif; ?> |
@@ -55,17 +55,17 @@ discard block |
||
| 55 | 55 | <td class="line_cost" width="1%"> |
| 56 | 56 | <div class="view"> |
| 57 | 57 | <?php |
| 58 | - echo wp_kses_post( |
|
| 59 | - wc_price( '-' . $refund->get_amount(), array( 'currency' => $refund->get_currency() ) ) |
|
| 60 | - ); |
|
| 61 | - ?> |
|
| 58 | + echo wp_kses_post( |
|
| 59 | + wc_price( '-' . $refund->get_amount(), array( 'currency' => $refund->get_currency() ) ) |
|
| 60 | + ); |
|
| 61 | + ?> |
|
| 62 | 62 | </div> |
| 63 | 63 | </td> |
| 64 | 64 | |
| 65 | 65 | <?php |
| 66 | - if ( wc_tax_enabled() ) : |
|
| 67 | - $total_taxes = count( $order_taxes ); |
|
| 68 | - ?> |
|
| 66 | + if ( wc_tax_enabled() ) : |
|
| 67 | + $total_taxes = count( $order_taxes ); |
|
| 68 | + ?> |
|
| 69 | 69 | <?php for ( $i = 0; $i < $total_taxes; $i++ ) : ?> |
| 70 | 70 | <td class="line_tax" width="1%"></td> |
| 71 | 71 | <?php endfor; ?> |
@@ -6,48 +6,48 @@ discard block |
||
| 6 | 6 | * @package WooCommerce\Admin |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if (!defined('ABSPATH')) { |
|
| 10 | 10 | exit; // Exit if accessed directly. |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | -$who_refunded = new WP_User( $refund->get_refunded_by() ); |
|
| 13 | +$who_refunded = new WP_User($refund->get_refunded_by()); |
|
| 14 | 14 | ?> |
| 15 | -<tr class="refund <?php echo ( ! empty( $class ) ) ? esc_attr( $class ) : ''; ?>" data-order_refund_id="<?php echo esc_attr( $refund->get_id() ); ?>"> |
|
| 15 | +<tr class="refund <?php echo (!empty($class)) ? esc_attr($class) : ''; ?>" data-order_refund_id="<?php echo esc_attr($refund->get_id()); ?>"> |
|
| 16 | 16 | <td class="thumb"><div></div></td> |
| 17 | 17 | |
| 18 | 18 | <td class="name"> |
| 19 | 19 | <?php |
| 20 | - if ( $who_refunded->exists() ) { |
|
| 20 | + if ($who_refunded->exists()) { |
|
| 21 | 21 | printf( |
| 22 | 22 | /* translators: 1: refund id 2: refund date 3: username */ |
| 23 | - esc_html__( 'Refund #%1$s - %2$s by %3$s', 'woocommerce' ), |
|
| 24 | - esc_html( $refund->get_id() ), |
|
| 25 | - esc_html( wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) ) ), |
|
| 23 | + esc_html__('Refund #%1$s - %2$s by %3$s', 'woocommerce'), |
|
| 24 | + esc_html($refund->get_id()), |
|
| 25 | + esc_html(wc_format_datetime($refund->get_date_created(), get_option('date_format') . ', ' . get_option('time_format'))), |
|
| 26 | 26 | sprintf( |
| 27 | 27 | '<abbr class="refund_by" title="%1$s">%2$s</abbr>', |
| 28 | 28 | /* translators: 1: ID who refunded */ |
| 29 | - sprintf( esc_attr__( 'ID: %d', 'woocommerce' ), absint( $who_refunded->ID ) ), |
|
| 30 | - esc_html( $who_refunded->display_name ) |
|
| 29 | + sprintf(esc_attr__('ID: %d', 'woocommerce'), absint($who_refunded->ID)), |
|
| 30 | + esc_html($who_refunded->display_name) |
|
| 31 | 31 | ) |
| 32 | 32 | ); |
| 33 | 33 | } else { |
| 34 | 34 | printf( |
| 35 | 35 | /* translators: 1: refund id 2: refund date */ |
| 36 | - esc_html__( 'Refund #%1$s - %2$s', 'woocommerce' ), |
|
| 37 | - esc_html( $refund->get_id() ), |
|
| 38 | - esc_html( wc_format_datetime( $refund->get_date_created(), get_option( 'date_format' ) . ', ' . get_option( 'time_format' ) ) ) |
|
| 36 | + esc_html__('Refund #%1$s - %2$s', 'woocommerce'), |
|
| 37 | + esc_html($refund->get_id()), |
|
| 38 | + esc_html(wc_format_datetime($refund->get_date_created(), get_option('date_format') . ', ' . get_option('time_format'))) |
|
| 39 | 39 | ); |
| 40 | 40 | } |
| 41 | 41 | ?> |
| 42 | - <?php if ( $refund->get_reason() ) : ?> |
|
| 43 | - <p class="description"><?php echo esc_html( $refund->get_reason() ); ?></p> |
|
| 42 | + <?php if ($refund->get_reason()) : ?> |
|
| 43 | + <p class="description"><?php echo esc_html($refund->get_reason()); ?></p> |
|
| 44 | 44 | <?php endif; ?> |
| 45 | - <input type="hidden" class="order_refund_id" name="order_refund_id[]" value="<?php echo esc_attr( $refund->get_id() ); ?>" /> |
|
| 45 | + <input type="hidden" class="order_refund_id" name="order_refund_id[]" value="<?php echo esc_attr($refund->get_id()); ?>" /> |
|
| 46 | 46 | |
| 47 | - <?php do_action( 'woocommerce_after_order_refund_item_name', $refund ); ?> |
|
| 47 | + <?php do_action('woocommerce_after_order_refund_item_name', $refund); ?> |
|
| 48 | 48 | </td> |
| 49 | 49 | |
| 50 | - <?php do_action( 'woocommerce_admin_order_item_values', null, $refund, $refund->get_id() ); ?> |
|
| 50 | + <?php do_action('woocommerce_admin_order_item_values', null, $refund, $refund->get_id()); ?> |
|
| 51 | 51 | |
| 52 | 52 | <td class="item_cost" width="1%"> </td> |
| 53 | 53 | <td class="quantity" width="1%"> </td> |
@@ -56,17 +56,17 @@ discard block |
||
| 56 | 56 | <div class="view"> |
| 57 | 57 | <?php |
| 58 | 58 | echo wp_kses_post( |
| 59 | - wc_price( '-' . $refund->get_amount(), array( 'currency' => $refund->get_currency() ) ) |
|
| 59 | + wc_price('-' . $refund->get_amount(), array('currency' => $refund->get_currency())) |
|
| 60 | 60 | ); |
| 61 | 61 | ?> |
| 62 | 62 | </div> |
| 63 | 63 | </td> |
| 64 | 64 | |
| 65 | 65 | <?php |
| 66 | - if ( wc_tax_enabled() ) : |
|
| 67 | - $total_taxes = count( $order_taxes ); |
|
| 66 | + if (wc_tax_enabled()) : |
|
| 67 | + $total_taxes = count($order_taxes); |
|
| 68 | 68 | ?> |
| 69 | - <?php for ( $i = 0; $i < $total_taxes; $i++ ) : ?> |
|
| 69 | + <?php for ($i = 0; $i < $total_taxes; $i++) : ?> |
|
| 70 | 70 | <td class="line_tax" width="1%"></td> |
| 71 | 71 | <?php endfor; ?> |
| 72 | 72 | <?php endif; ?> |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | - exit; |
|
| 14 | + exit; |
|
| 15 | 15 | } |
| 16 | 16 | ?> |
| 17 | 17 | <tr class="shipping <?php echo ( ! empty( $class ) ) ? esc_attr( $class ) : ''; ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>"> |
@@ -28,24 +28,24 @@ discard block |
||
| 28 | 28 | <optgroup label="<?php esc_attr_e( 'Shipping method', 'woocommerce' ); ?>"> |
| 29 | 29 | <option value=""><?php esc_html_e( 'N/A', 'woocommerce' ); ?></option> |
| 30 | 30 | <?php |
| 31 | - $found_method = false; |
|
| 31 | + $found_method = false; |
|
| 32 | 32 | |
| 33 | - foreach ( $shipping_methods as $method ) { |
|
| 34 | - $is_active = $item->get_method_id() === $method->id; |
|
| 33 | + foreach ( $shipping_methods as $method ) { |
|
| 34 | + $is_active = $item->get_method_id() === $method->id; |
|
| 35 | 35 | |
| 36 | - echo '<option value="' . esc_attr( $method->id ) . '" ' . selected( true, $is_active, false ) . '>' . esc_html( $method->get_method_title() ) . '</option>'; |
|
| 36 | + echo '<option value="' . esc_attr( $method->id ) . '" ' . selected( true, $is_active, false ) . '>' . esc_html( $method->get_method_title() ) . '</option>'; |
|
| 37 | 37 | |
| 38 | - if ( $is_active ) { |
|
| 39 | - $found_method = true; |
|
| 40 | - } |
|
| 41 | - } |
|
| 38 | + if ( $is_active ) { |
|
| 39 | + $found_method = true; |
|
| 40 | + } |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - if ( ! $found_method && $item->get_method_id() ) { |
|
| 44 | - echo '<option value="' . esc_attr( $item->get_method_id() ) . '" selected="selected">' . esc_html__( 'Other', 'woocommerce' ) . '</option>'; |
|
| 45 | - } else { |
|
| 46 | - echo '<option value="other">' . esc_html__( 'Other', 'woocommerce' ) . '</option>'; |
|
| 47 | - } |
|
| 48 | - ?> |
|
| 43 | + if ( ! $found_method && $item->get_method_id() ) { |
|
| 44 | + echo '<option value="' . esc_attr( $item->get_method_id() ) . '" selected="selected">' . esc_html__( 'Other', 'woocommerce' ) . '</option>'; |
|
| 45 | + } else { |
|
| 46 | + echo '<option value="other">' . esc_html__( 'Other', 'woocommerce' ) . '</option>'; |
|
| 47 | + } |
|
| 48 | + ?> |
|
| 49 | 49 | </optgroup> |
| 50 | 50 | </select> |
| 51 | 51 | </div> |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | <td class="line_cost" width="1%"> |
| 64 | 64 | <div class="view"> |
| 65 | 65 | <?php |
| 66 | - echo wp_kses_post( wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) ) ); |
|
| 67 | - $refunded = -1 * $order->get_total_refunded_for_item( $item_id, 'shipping' ); |
|
| 68 | - if ( $refunded ) { |
|
| 69 | - echo wp_kses_post( '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>' ); |
|
| 70 | - } |
|
| 71 | - ?> |
|
| 66 | + echo wp_kses_post( wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) ) ); |
|
| 67 | + $refunded = -1 * $order->get_total_refunded_for_item( $item_id, 'shipping' ); |
|
| 68 | + if ( $refunded ) { |
|
| 69 | + echo wp_kses_post( '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>' ); |
|
| 70 | + } |
|
| 71 | + ?> |
|
| 72 | 72 | </div> |
| 73 | 73 | <div class="edit" style="display: none;"> |
| 74 | 74 | <input type="text" name="shipping_cost[<?php echo esc_attr( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" class="line_total wc_input_price" /> |
@@ -79,21 +79,21 @@ discard block |
||
| 79 | 79 | </td> |
| 80 | 80 | |
| 81 | 81 | <?php |
| 82 | - $tax_data = $item->get_taxes(); |
|
| 83 | - if ( $tax_data && wc_tax_enabled() ) { |
|
| 84 | - foreach ( $order_taxes as $tax_item ) { |
|
| 85 | - $tax_item_id = $tax_item->get_rate_id(); |
|
| 86 | - $tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : ''; |
|
| 87 | - ?> |
|
| 82 | + $tax_data = $item->get_taxes(); |
|
| 83 | + if ( $tax_data && wc_tax_enabled() ) { |
|
| 84 | + foreach ( $order_taxes as $tax_item ) { |
|
| 85 | + $tax_item_id = $tax_item->get_rate_id(); |
|
| 86 | + $tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : ''; |
|
| 87 | + ?> |
|
| 88 | 88 | <td class="line_tax" width="1%"> |
| 89 | 89 | <div class="view"> |
| 90 | 90 | <?php |
| 91 | - echo wp_kses_post( ( '' !== $tax_item_total ) ? wc_price( $tax_item_total, array( 'currency' => $order->get_currency() ) ) : '–' ); |
|
| 92 | - $refunded = -1 * $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'shipping' ); |
|
| 93 | - if ( $refunded ) { |
|
| 94 | - echo wp_kses_post( '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>' ); |
|
| 95 | - } |
|
| 96 | - ?> |
|
| 91 | + echo wp_kses_post( ( '' !== $tax_item_total ) ? wc_price( $tax_item_total, array( 'currency' => $order->get_currency() ) ) : '–' ); |
|
| 92 | + $refunded = -1 * $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'shipping' ); |
|
| 93 | + if ( $refunded ) { |
|
| 94 | + echo wp_kses_post( '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>' ); |
|
| 95 | + } |
|
| 96 | + ?> |
|
| 97 | 97 | </div> |
| 98 | 98 | <div class="edit" style="display: none;"> |
| 99 | 99 | <input type="text" name="shipping_taxes[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo ( isset( $tax_item_total ) ) ? esc_attr( wc_format_localized_price( $tax_item_total ) ) : ''; ?>" class="line_tax wc_input_price" /> |
@@ -103,9 +103,9 @@ discard block |
||
| 103 | 103 | </div> |
| 104 | 104 | </td> |
| 105 | 105 | <?php |
| 106 | - } |
|
| 107 | - } |
|
| 108 | - ?> |
|
| 106 | + } |
|
| 107 | + } |
|
| 108 | + ?> |
|
| 109 | 109 | <td class="wc-order-edit-line-item"> |
| 110 | 110 | <?php if ( $order->is_editable() ) : ?> |
| 111 | 111 | <div class="wc-order-edit-line-item-actions"> |
@@ -10,52 +10,52 @@ discard block |
||
| 10 | 10 | * @package WooCommerce\Admin\Views |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if (!defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | ?> |
| 17 | -<tr class="shipping <?php echo ( ! empty( $class ) ) ? esc_attr( $class ) : ''; ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>"> |
|
| 17 | +<tr class="shipping <?php echo (!empty($class)) ? esc_attr($class) : ''; ?>" data-order_item_id="<?php echo esc_attr($item_id); ?>"> |
|
| 18 | 18 | <td class="thumb"><div></div></td> |
| 19 | 19 | |
| 20 | 20 | <td class="name"> |
| 21 | 21 | <div class="view"> |
| 22 | - <?php echo esc_html( $item->get_name() ? $item->get_name() : __( 'Shipping', 'woocommerce' ) ); ?> |
|
| 22 | + <?php echo esc_html($item->get_name() ? $item->get_name() : __('Shipping', 'woocommerce')); ?> |
|
| 23 | 23 | </div> |
| 24 | 24 | <div class="edit" style="display: none;"> |
| 25 | - <input type="hidden" name="shipping_method_id[]" value="<?php echo esc_attr( $item_id ); ?>" /> |
|
| 26 | - <input type="text" class="shipping_method_name" placeholder="<?php esc_attr_e( 'Shipping name', 'woocommerce' ); ?>" name="shipping_method_title[<?php echo esc_attr( $item_id ); ?>]" value="<?php echo esc_attr( $item->get_name() ); ?>" /> |
|
| 27 | - <select class="shipping_method" name="shipping_method[<?php echo esc_attr( $item_id ); ?>]"> |
|
| 28 | - <optgroup label="<?php esc_attr_e( 'Shipping method', 'woocommerce' ); ?>"> |
|
| 29 | - <option value=""><?php esc_html_e( 'N/A', 'woocommerce' ); ?></option> |
|
| 25 | + <input type="hidden" name="shipping_method_id[]" value="<?php echo esc_attr($item_id); ?>" /> |
|
| 26 | + <input type="text" class="shipping_method_name" placeholder="<?php esc_attr_e('Shipping name', 'woocommerce'); ?>" name="shipping_method_title[<?php echo esc_attr($item_id); ?>]" value="<?php echo esc_attr($item->get_name()); ?>" /> |
|
| 27 | + <select class="shipping_method" name="shipping_method[<?php echo esc_attr($item_id); ?>]"> |
|
| 28 | + <optgroup label="<?php esc_attr_e('Shipping method', 'woocommerce'); ?>"> |
|
| 29 | + <option value=""><?php esc_html_e('N/A', 'woocommerce'); ?></option> |
|
| 30 | 30 | <?php |
| 31 | 31 | $found_method = false; |
| 32 | 32 | |
| 33 | - foreach ( $shipping_methods as $method ) { |
|
| 33 | + foreach ($shipping_methods as $method) { |
|
| 34 | 34 | $is_active = $item->get_method_id() === $method->id; |
| 35 | 35 | |
| 36 | - echo '<option value="' . esc_attr( $method->id ) . '" ' . selected( true, $is_active, false ) . '>' . esc_html( $method->get_method_title() ) . '</option>'; |
|
| 36 | + echo '<option value="' . esc_attr($method->id) . '" ' . selected(true, $is_active, false) . '>' . esc_html($method->get_method_title()) . '</option>'; |
|
| 37 | 37 | |
| 38 | - if ( $is_active ) { |
|
| 38 | + if ($is_active) { |
|
| 39 | 39 | $found_method = true; |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if ( ! $found_method && $item->get_method_id() ) { |
|
| 44 | - echo '<option value="' . esc_attr( $item->get_method_id() ) . '" selected="selected">' . esc_html__( 'Other', 'woocommerce' ) . '</option>'; |
|
| 43 | + if (!$found_method && $item->get_method_id()) { |
|
| 44 | + echo '<option value="' . esc_attr($item->get_method_id()) . '" selected="selected">' . esc_html__('Other', 'woocommerce') . '</option>'; |
|
| 45 | 45 | } else { |
| 46 | - echo '<option value="other">' . esc_html__( 'Other', 'woocommerce' ) . '</option>'; |
|
| 46 | + echo '<option value="other">' . esc_html__('Other', 'woocommerce') . '</option>'; |
|
| 47 | 47 | } |
| 48 | 48 | ?> |
| 49 | 49 | </optgroup> |
| 50 | 50 | </select> |
| 51 | 51 | </div> |
| 52 | 52 | |
| 53 | - <?php do_action( 'woocommerce_before_order_itemmeta', $item_id, $item, null ); ?> |
|
| 53 | + <?php do_action('woocommerce_before_order_itemmeta', $item_id, $item, null); ?> |
|
| 54 | 54 | <?php require __DIR__ . '/html-order-item-meta.php'; ?> |
| 55 | - <?php do_action( 'woocommerce_after_order_itemmeta', $item_id, $item, null ); ?> |
|
| 55 | + <?php do_action('woocommerce_after_order_itemmeta', $item_id, $item, null); ?> |
|
| 56 | 56 | </td> |
| 57 | 57 | |
| 58 | - <?php do_action( 'woocommerce_admin_order_item_values', null, $item, absint( $item_id ) ); ?> |
|
| 58 | + <?php do_action('woocommerce_admin_order_item_values', null, $item, absint($item_id)); ?> |
|
| 59 | 59 | |
| 60 | 60 | <td class="item_cost" width="1%"> </td> |
| 61 | 61 | <td class="quantity" width="1%"> </td> |
@@ -63,43 +63,43 @@ discard block |
||
| 63 | 63 | <td class="line_cost" width="1%"> |
| 64 | 64 | <div class="view"> |
| 65 | 65 | <?php |
| 66 | - echo wp_kses_post( wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) ) ); |
|
| 67 | - $refunded = -1 * $order->get_total_refunded_for_item( $item_id, 'shipping' ); |
|
| 68 | - if ( $refunded ) { |
|
| 69 | - echo wp_kses_post( '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>' ); |
|
| 66 | + echo wp_kses_post(wc_price($item->get_total(), array('currency' => $order->get_currency()))); |
|
| 67 | + $refunded = -1 * $order->get_total_refunded_for_item($item_id, 'shipping'); |
|
| 68 | + if ($refunded) { |
|
| 69 | + echo wp_kses_post('<small class="refunded">' . wc_price($refunded, array('currency' => $order->get_currency())) . '</small>'); |
|
| 70 | 70 | } |
| 71 | 71 | ?> |
| 72 | 72 | </div> |
| 73 | 73 | <div class="edit" style="display: none;"> |
| 74 | - <input type="text" name="shipping_cost[<?php echo esc_attr( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" class="line_total wc_input_price" /> |
|
| 74 | + <input type="text" name="shipping_cost[<?php echo esc_attr($item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" value="<?php echo esc_attr(wc_format_localized_price($item->get_total())); ?>" class="line_total wc_input_price" /> |
|
| 75 | 75 | </div> |
| 76 | 76 | <div class="refund" style="display: none;"> |
| 77 | - <input type="text" name="refund_line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_total wc_input_price" /> |
|
| 77 | + <input type="text" name="refund_line_total[<?php echo absint($item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" class="refund_line_total wc_input_price" /> |
|
| 78 | 78 | </div> |
| 79 | 79 | </td> |
| 80 | 80 | |
| 81 | 81 | <?php |
| 82 | 82 | $tax_data = $item->get_taxes(); |
| 83 | - if ( $tax_data && wc_tax_enabled() ) { |
|
| 84 | - foreach ( $order_taxes as $tax_item ) { |
|
| 83 | + if ($tax_data && wc_tax_enabled()) { |
|
| 84 | + foreach ($order_taxes as $tax_item) { |
|
| 85 | 85 | $tax_item_id = $tax_item->get_rate_id(); |
| 86 | - $tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : ''; |
|
| 86 | + $tax_item_total = isset($tax_data['total'][$tax_item_id]) ? $tax_data['total'][$tax_item_id] : ''; |
|
| 87 | 87 | ?> |
| 88 | 88 | <td class="line_tax" width="1%"> |
| 89 | 89 | <div class="view"> |
| 90 | 90 | <?php |
| 91 | - echo wp_kses_post( ( '' !== $tax_item_total ) ? wc_price( $tax_item_total, array( 'currency' => $order->get_currency() ) ) : '–' ); |
|
| 92 | - $refunded = -1 * $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'shipping' ); |
|
| 93 | - if ( $refunded ) { |
|
| 94 | - echo wp_kses_post( '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>' ); |
|
| 91 | + echo wp_kses_post(('' !== $tax_item_total) ? wc_price($tax_item_total, array('currency' => $order->get_currency())) : '–'); |
|
| 92 | + $refunded = -1 * $order->get_tax_refunded_for_item($item_id, $tax_item_id, 'shipping'); |
|
| 93 | + if ($refunded) { |
|
| 94 | + echo wp_kses_post('<small class="refunded">' . wc_price($refunded, array('currency' => $order->get_currency())) . '</small>'); |
|
| 95 | 95 | } |
| 96 | 96 | ?> |
| 97 | 97 | </div> |
| 98 | 98 | <div class="edit" style="display: none;"> |
| 99 | - <input type="text" name="shipping_taxes[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo ( isset( $tax_item_total ) ) ? esc_attr( wc_format_localized_price( $tax_item_total ) ) : ''; ?>" class="line_tax wc_input_price" /> |
|
| 99 | + <input type="text" name="shipping_taxes[<?php echo absint($item_id); ?>][<?php echo esc_attr($tax_item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" value="<?php echo (isset($tax_item_total)) ? esc_attr(wc_format_localized_price($tax_item_total)) : ''; ?>" class="line_tax wc_input_price" /> |
|
| 100 | 100 | </div> |
| 101 | 101 | <div class="refund" style="display: none;"> |
| 102 | - <input type="text" name="refund_line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" /> |
|
| 102 | + <input type="text" name="refund_line_tax[<?php echo absint($item_id); ?>][<?php echo esc_attr($tax_item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo esc_attr($tax_item_id); ?>" /> |
|
| 103 | 103 | </div> |
| 104 | 104 | </td> |
| 105 | 105 | <?php |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | ?> |
| 109 | 109 | <td class="wc-order-edit-line-item"> |
| 110 | - <?php if ( $order->is_editable() ) : ?> |
|
| 110 | + <?php if ($order->is_editable()) : ?> |
|
| 111 | 111 | <div class="wc-order-edit-line-item-actions"> |
| 112 | 112 | <a class="edit-order-item" href="#"></a><a class="delete-order-item" href="#"></a> |
| 113 | 113 | </div> |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | if ( ! defined( 'ABSPATH' ) ) { |
| 10 | - exit; |
|
| 10 | + exit; |
|
| 11 | 11 | } |
| 12 | 12 | ?> |
| 13 | 13 | <tr class="fee <?php echo ( ! empty( $class ) ) ? esc_attr( $class ) : ''; ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>"> |
@@ -33,12 +33,12 @@ discard block |
||
| 33 | 33 | <td class="line_cost" width="1%"> |
| 34 | 34 | <div class="view"> |
| 35 | 35 | <?php |
| 36 | - echo wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) ); |
|
| 36 | + echo wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) ); |
|
| 37 | 37 | |
| 38 | - if ( $refunded = -1 * $order->get_total_refunded_for_item( $item_id, 'fee' ) ) { |
|
| 39 | - echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; |
|
| 40 | - } |
|
| 41 | - ?> |
|
| 38 | + if ( $refunded = -1 * $order->get_total_refunded_for_item( $item_id, 'fee' ) ) { |
|
| 39 | + echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; |
|
| 40 | + } |
|
| 41 | + ?> |
|
| 42 | 42 | </div> |
| 43 | 43 | <div class="edit" style="display: none;"> |
| 44 | 44 | <input type="text" name="line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" class="line_total wc_input_price" /> |
@@ -49,20 +49,20 @@ discard block |
||
| 49 | 49 | </td> |
| 50 | 50 | |
| 51 | 51 | <?php |
| 52 | - if ( ( $tax_data = $item->get_taxes() ) && wc_tax_enabled() ) { |
|
| 53 | - foreach ( $order_taxes as $tax_item ) { |
|
| 54 | - $tax_item_id = $tax_item->get_rate_id(); |
|
| 55 | - $tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : ''; |
|
| 56 | - ?> |
|
| 52 | + if ( ( $tax_data = $item->get_taxes() ) && wc_tax_enabled() ) { |
|
| 53 | + foreach ( $order_taxes as $tax_item ) { |
|
| 54 | + $tax_item_id = $tax_item->get_rate_id(); |
|
| 55 | + $tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : ''; |
|
| 56 | + ?> |
|
| 57 | 57 | <td class="line_tax" width="1%"> |
| 58 | 58 | <div class="view"> |
| 59 | 59 | <?php |
| 60 | - echo ( '' !== $tax_item_total ) ? wc_price( wc_round_tax_total( $tax_item_total ), array( 'currency' => $order->get_currency() ) ) : '–'; |
|
| 60 | + echo ( '' !== $tax_item_total ) ? wc_price( wc_round_tax_total( $tax_item_total ), array( 'currency' => $order->get_currency() ) ) : '–'; |
|
| 61 | 61 | |
| 62 | - if ( $refunded = -1 * $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'fee' ) ) { |
|
| 63 | - echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; |
|
| 64 | - } |
|
| 65 | - ?> |
|
| 62 | + if ( $refunded = -1 * $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'fee' ) ) { |
|
| 63 | + echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; |
|
| 64 | + } |
|
| 65 | + ?> |
|
| 66 | 66 | </div> |
| 67 | 67 | <div class="edit" style="display: none;"> |
| 68 | 68 | <input type="text" name="line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo ( isset( $tax_item_total ) ) ? esc_attr( wc_format_localized_price( $tax_item_total ) ) : ''; ?>" class="line_tax wc_input_price" /> |
@@ -72,9 +72,9 @@ discard block |
||
| 72 | 72 | </div> |
| 73 | 73 | </td> |
| 74 | 74 | <?php |
| 75 | - } |
|
| 76 | - } |
|
| 77 | - ?> |
|
| 75 | + } |
|
| 76 | + } |
|
| 77 | + ?> |
|
| 78 | 78 | <td class="wc-order-edit-line-item"> |
| 79 | 79 | <?php if ( $order->is_editable() ) : ?> |
| 80 | 80 | <div class="wc-order-edit-line-item-actions"> |
@@ -6,26 +6,26 @@ discard block |
||
| 6 | 6 | * @var int $item_id The id of the item being displayed |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 9 | +if (!defined('ABSPATH')) { |
|
| 10 | 10 | exit; |
| 11 | 11 | } |
| 12 | 12 | ?> |
| 13 | -<tr class="fee <?php echo ( ! empty( $class ) ) ? esc_attr( $class ) : ''; ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>"> |
|
| 13 | +<tr class="fee <?php echo (!empty($class)) ? esc_attr($class) : ''; ?>" data-order_item_id="<?php echo esc_attr($item_id); ?>"> |
|
| 14 | 14 | <td class="thumb"><div></div></td> |
| 15 | 15 | |
| 16 | 16 | <td class="name"> |
| 17 | 17 | <div class="view"> |
| 18 | - <?php echo esc_html( $item->get_name() ? $item->get_name() : __( 'Fee', 'woocommerce' ) ); ?> |
|
| 18 | + <?php echo esc_html($item->get_name() ? $item->get_name() : __('Fee', 'woocommerce')); ?> |
|
| 19 | 19 | </div> |
| 20 | 20 | <div class="edit" style="display: none;"> |
| 21 | - <input type="text" placeholder="<?php esc_attr_e( 'Fee name', 'woocommerce' ); ?>" name="order_item_name[<?php echo absint( $item_id ); ?>]" value="<?php echo ( $item->get_name() ) ? esc_attr( $item->get_name() ) : ''; ?>" /> |
|
| 22 | - <input type="hidden" class="order_item_id" name="order_item_id[]" value="<?php echo esc_attr( $item_id ); ?>" /> |
|
| 23 | - <input type="hidden" name="order_item_tax_class[<?php echo absint( $item_id ); ?>]" value="<?php echo esc_attr( $item->get_tax_class() ); ?>" /> |
|
| 21 | + <input type="text" placeholder="<?php esc_attr_e('Fee name', 'woocommerce'); ?>" name="order_item_name[<?php echo absint($item_id); ?>]" value="<?php echo ($item->get_name()) ? esc_attr($item->get_name()) : ''; ?>" /> |
|
| 22 | + <input type="hidden" class="order_item_id" name="order_item_id[]" value="<?php echo esc_attr($item_id); ?>" /> |
|
| 23 | + <input type="hidden" name="order_item_tax_class[<?php echo absint($item_id); ?>]" value="<?php echo esc_attr($item->get_tax_class()); ?>" /> |
|
| 24 | 24 | </div> |
| 25 | - <?php do_action( 'woocommerce_after_order_fee_item_name', $item_id, $item, null ); ?> |
|
| 25 | + <?php do_action('woocommerce_after_order_fee_item_name', $item_id, $item, null); ?> |
|
| 26 | 26 | </td> |
| 27 | 27 | |
| 28 | - <?php do_action( 'woocommerce_admin_order_item_values', null, $item, absint( $item_id ) ); ?> |
|
| 28 | + <?php do_action('woocommerce_admin_order_item_values', null, $item, absint($item_id)); ?> |
|
| 29 | 29 | |
| 30 | 30 | <td class="item_cost" width="1%"> </td> |
| 31 | 31 | <td class="quantity" width="1%"> </td> |
@@ -33,42 +33,42 @@ discard block |
||
| 33 | 33 | <td class="line_cost" width="1%"> |
| 34 | 34 | <div class="view"> |
| 35 | 35 | <?php |
| 36 | - echo wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) ); |
|
| 36 | + echo wc_price($item->get_total(), array('currency' => $order->get_currency())); |
|
| 37 | 37 | |
| 38 | - if ( $refunded = -1 * $order->get_total_refunded_for_item( $item_id, 'fee' ) ) { |
|
| 39 | - echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; |
|
| 38 | + if ($refunded = -1 * $order->get_total_refunded_for_item($item_id, 'fee')) { |
|
| 39 | + echo '<small class="refunded">' . wc_price($refunded, array('currency' => $order->get_currency())) . '</small>'; |
|
| 40 | 40 | } |
| 41 | 41 | ?> |
| 42 | 42 | </div> |
| 43 | 43 | <div class="edit" style="display: none;"> |
| 44 | - <input type="text" name="line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" class="line_total wc_input_price" /> |
|
| 44 | + <input type="text" name="line_total[<?php echo absint($item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" value="<?php echo esc_attr(wc_format_localized_price($item->get_total())); ?>" class="line_total wc_input_price" /> |
|
| 45 | 45 | </div> |
| 46 | 46 | <div class="refund" style="display: none;"> |
| 47 | - <input type="text" name="refund_line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_total wc_input_price" /> |
|
| 47 | + <input type="text" name="refund_line_total[<?php echo absint($item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" class="refund_line_total wc_input_price" /> |
|
| 48 | 48 | </div> |
| 49 | 49 | </td> |
| 50 | 50 | |
| 51 | 51 | <?php |
| 52 | - if ( ( $tax_data = $item->get_taxes() ) && wc_tax_enabled() ) { |
|
| 53 | - foreach ( $order_taxes as $tax_item ) { |
|
| 52 | + if (($tax_data = $item->get_taxes()) && wc_tax_enabled()) { |
|
| 53 | + foreach ($order_taxes as $tax_item) { |
|
| 54 | 54 | $tax_item_id = $tax_item->get_rate_id(); |
| 55 | - $tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : ''; |
|
| 55 | + $tax_item_total = isset($tax_data['total'][$tax_item_id]) ? $tax_data['total'][$tax_item_id] : ''; |
|
| 56 | 56 | ?> |
| 57 | 57 | <td class="line_tax" width="1%"> |
| 58 | 58 | <div class="view"> |
| 59 | 59 | <?php |
| 60 | - echo ( '' !== $tax_item_total ) ? wc_price( wc_round_tax_total( $tax_item_total ), array( 'currency' => $order->get_currency() ) ) : '–'; |
|
| 60 | + echo ('' !== $tax_item_total) ? wc_price(wc_round_tax_total($tax_item_total), array('currency' => $order->get_currency())) : '–'; |
|
| 61 | 61 | |
| 62 | - if ( $refunded = -1 * $order->get_tax_refunded_for_item( $item_id, $tax_item_id, 'fee' ) ) { |
|
| 63 | - echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; |
|
| 62 | + if ($refunded = -1 * $order->get_tax_refunded_for_item($item_id, $tax_item_id, 'fee')) { |
|
| 63 | + echo '<small class="refunded">' . wc_price($refunded, array('currency' => $order->get_currency())) . '</small>'; |
|
| 64 | 64 | } |
| 65 | 65 | ?> |
| 66 | 66 | </div> |
| 67 | 67 | <div class="edit" style="display: none;"> |
| 68 | - <input type="text" name="line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo ( isset( $tax_item_total ) ) ? esc_attr( wc_format_localized_price( $tax_item_total ) ) : ''; ?>" class="line_tax wc_input_price" /> |
|
| 68 | + <input type="text" name="line_tax[<?php echo absint($item_id); ?>][<?php echo esc_attr($tax_item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" value="<?php echo (isset($tax_item_total)) ? esc_attr(wc_format_localized_price($tax_item_total)) : ''; ?>" class="line_tax wc_input_price" /> |
|
| 69 | 69 | </div> |
| 70 | 70 | <div class="refund" style="display: none;"> |
| 71 | - <input type="text" name="refund_line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" /> |
|
| 71 | + <input type="text" name="refund_line_tax[<?php echo absint($item_id); ?>][<?php echo esc_attr($tax_item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo esc_attr($tax_item_id); ?>" /> |
|
| 72 | 72 | </div> |
| 73 | 73 | </td> |
| 74 | 74 | <?php |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | ?> |
| 78 | 78 | <td class="wc-order-edit-line-item"> |
| 79 | - <?php if ( $order->is_editable() ) : ?> |
|
| 79 | + <?php if ($order->is_editable()) : ?> |
|
| 80 | 80 | <div class="wc-order-edit-line-item-actions"> |
| 81 | 81 | <a class="edit-order-item" href="#"></a><a class="delete-order-item" href="#"></a> |
| 82 | 82 | </div> |
@@ -20,23 +20,23 @@ discard block |
||
| 20 | 20 | </td> |
| 21 | 21 | <td class="name" data-sort-value="<?php echo esc_attr( $item->get_name() ); ?>"> |
| 22 | 22 | <?php |
| 23 | - echo $product_link ? '<a href="' . esc_url( $product_link ) . '" class="wc-order-item-name">' . wp_kses_post( $item->get_name() ) . '</a>' : '<div class="wc-order-item-name">' . wp_kses_post( $item->get_name() ) . '</div>'; |
|
| 24 | - |
|
| 25 | - if ( $product && $product->get_sku() ) { |
|
| 26 | - echo '<div class="wc-order-item-sku"><strong>' . esc_html__( 'SKU:', 'woocommerce' ) . '</strong> ' . esc_html( $product->get_sku() ) . '</div>'; |
|
| 27 | - } |
|
| 28 | - |
|
| 29 | - if ( $item->get_variation_id() ) { |
|
| 30 | - echo '<div class="wc-order-item-variation"><strong>' . esc_html__( 'Variation ID:', 'woocommerce' ) . '</strong> '; |
|
| 31 | - if ( 'product_variation' === get_post_type( $item->get_variation_id() ) ) { |
|
| 32 | - echo esc_html( $item->get_variation_id() ); |
|
| 33 | - } else { |
|
| 34 | - /* translators: %s: variation id */ |
|
| 35 | - printf( esc_html__( '%s (No longer exists)', 'woocommerce' ), esc_html( $item->get_variation_id() ) ); |
|
| 36 | - } |
|
| 37 | - echo '</div>'; |
|
| 38 | - } |
|
| 39 | - ?> |
|
| 23 | + echo $product_link ? '<a href="' . esc_url( $product_link ) . '" class="wc-order-item-name">' . wp_kses_post( $item->get_name() ) . '</a>' : '<div class="wc-order-item-name">' . wp_kses_post( $item->get_name() ) . '</div>'; |
|
| 24 | + |
|
| 25 | + if ( $product && $product->get_sku() ) { |
|
| 26 | + echo '<div class="wc-order-item-sku"><strong>' . esc_html__( 'SKU:', 'woocommerce' ) . '</strong> ' . esc_html( $product->get_sku() ) . '</div>'; |
|
| 27 | + } |
|
| 28 | + |
|
| 29 | + if ( $item->get_variation_id() ) { |
|
| 30 | + echo '<div class="wc-order-item-variation"><strong>' . esc_html__( 'Variation ID:', 'woocommerce' ) . '</strong> '; |
|
| 31 | + if ( 'product_variation' === get_post_type( $item->get_variation_id() ) ) { |
|
| 32 | + echo esc_html( $item->get_variation_id() ); |
|
| 33 | + } else { |
|
| 34 | + /* translators: %s: variation id */ |
|
| 35 | + printf( esc_html__( '%s (No longer exists)', 'woocommerce' ), esc_html( $item->get_variation_id() ) ); |
|
| 36 | + } |
|
| 37 | + echo '</div>'; |
|
| 38 | + } |
|
| 39 | + ?> |
|
| 40 | 40 | <input type="hidden" class="order_item_id" name="order_item_id[]" value="<?php echo esc_attr( $item_id ); ?>" /> |
| 41 | 41 | <input type="hidden" name="order_item_tax_class[<?php echo absint( $item_id ); ?>]" value="<?php echo esc_attr( $item->get_tax_class() ); ?>" /> |
| 42 | 42 | |
@@ -50,47 +50,47 @@ discard block |
||
| 50 | 50 | <td class="item_cost" width="1%" data-sort-value="<?php echo esc_attr( $order->get_item_subtotal( $item, false, true ) ); ?>"> |
| 51 | 51 | <div class="view"> |
| 52 | 52 | <?php |
| 53 | - echo wc_price( $order->get_item_subtotal( $item, false, true ), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 54 | - ?> |
|
| 53 | + echo wc_price( $order->get_item_subtotal( $item, false, true ), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 54 | + ?> |
|
| 55 | 55 | </div> |
| 56 | 56 | </td> |
| 57 | 57 | <td class="quantity" width="1%"> |
| 58 | 58 | <div class="view"> |
| 59 | 59 | <?php |
| 60 | - echo '<small class="times">×</small> ' . esc_html( $item->get_quantity() ); |
|
| 60 | + echo '<small class="times">×</small> ' . esc_html( $item->get_quantity() ); |
|
| 61 | 61 | |
| 62 | - $refunded_qty = -1 * $order->get_qty_refunded_for_item( $item_id ); |
|
| 62 | + $refunded_qty = -1 * $order->get_qty_refunded_for_item( $item_id ); |
|
| 63 | 63 | |
| 64 | - if ( $refunded_qty ) { |
|
| 65 | - echo '<small class="refunded">' . esc_html( $refunded_qty * -1 ) . '</small>'; |
|
| 66 | - } |
|
| 67 | - ?> |
|
| 64 | + if ( $refunded_qty ) { |
|
| 65 | + echo '<small class="refunded">' . esc_html( $refunded_qty * -1 ) . '</small>'; |
|
| 66 | + } |
|
| 67 | + ?> |
|
| 68 | 68 | </div> |
| 69 | 69 | <?php |
| 70 | - $step = apply_filters( 'woocommerce_quantity_input_step', '1', $product ); |
|
| 71 | - |
|
| 72 | - /** |
|
| 73 | - * Filter to change the product quantity stepping in the order editor of the admin area. |
|
| 74 | - * |
|
| 75 | - * @since 5.8.0 |
|
| 76 | - * @param string $step The current step amount to be used in the quantity editor. |
|
| 77 | - * @param WC_Product $product The product that is being edited. |
|
| 78 | - * @param string $context The context in which the quantity editor is shown, 'edit' or 'refund'. |
|
| 79 | - */ |
|
| 80 | - $step_edit = apply_filters( 'woocommerce_quantity_input_step_admin', $step, $product, 'edit' ); |
|
| 81 | - $step_refund = apply_filters( 'woocommerce_quantity_input_step_admin', $step, $product, 'refund' ); |
|
| 82 | - |
|
| 83 | - /** |
|
| 84 | - * Filter to change the product quantity minimum in the order editor of the admin area. |
|
| 85 | - * |
|
| 86 | - * @since 5.8.0 |
|
| 87 | - * @param string $step The current minimum amount to be used in the quantity editor. |
|
| 88 | - * @param WC_Product $product The product that is being edited. |
|
| 89 | - * @param string $context The context in which the quantity editor is shown, 'edit' or 'refund'. |
|
| 90 | - */ |
|
| 91 | - $min_edit = apply_filters( 'woocommerce_quantity_input_min_admin', '0', $product, 'edit' ); |
|
| 92 | - $min_refund = apply_filters( 'woocommerce_quantity_input_min_admin', '0', $product, 'refund' ); |
|
| 93 | - ?> |
|
| 70 | + $step = apply_filters( 'woocommerce_quantity_input_step', '1', $product ); |
|
| 71 | + |
|
| 72 | + /** |
|
| 73 | + * Filter to change the product quantity stepping in the order editor of the admin area. |
|
| 74 | + * |
|
| 75 | + * @since 5.8.0 |
|
| 76 | + * @param string $step The current step amount to be used in the quantity editor. |
|
| 77 | + * @param WC_Product $product The product that is being edited. |
|
| 78 | + * @param string $context The context in which the quantity editor is shown, 'edit' or 'refund'. |
|
| 79 | + */ |
|
| 80 | + $step_edit = apply_filters( 'woocommerce_quantity_input_step_admin', $step, $product, 'edit' ); |
|
| 81 | + $step_refund = apply_filters( 'woocommerce_quantity_input_step_admin', $step, $product, 'refund' ); |
|
| 82 | + |
|
| 83 | + /** |
|
| 84 | + * Filter to change the product quantity minimum in the order editor of the admin area. |
|
| 85 | + * |
|
| 86 | + * @since 5.8.0 |
|
| 87 | + * @param string $step The current minimum amount to be used in the quantity editor. |
|
| 88 | + * @param WC_Product $product The product that is being edited. |
|
| 89 | + * @param string $context The context in which the quantity editor is shown, 'edit' or 'refund'. |
|
| 90 | + */ |
|
| 91 | + $min_edit = apply_filters( 'woocommerce_quantity_input_min_admin', '0', $product, 'edit' ); |
|
| 92 | + $min_refund = apply_filters( 'woocommerce_quantity_input_min_admin', '0', $product, 'refund' ); |
|
| 93 | + ?> |
|
| 94 | 94 | <div class="edit" style="display: none;"> |
| 95 | 95 | <input type="number" step="<?php echo esc_attr( $step_edit ); ?>" min="<?php echo esc_attr( $min_edit ); ?>" autocomplete="off" name="order_item_qty[<?php echo absint( $item_id ); ?>]" placeholder="0" value="<?php echo esc_attr( $item->get_quantity() ); ?>" data-qty="<?php echo esc_attr( $item->get_quantity() ); ?>" size="4" class="quantity" /> |
| 96 | 96 | </div> |
@@ -101,19 +101,19 @@ discard block |
||
| 101 | 101 | <td class="line_cost" width="1%" data-sort-value="<?php echo esc_attr( $item->get_total() ); ?>"> |
| 102 | 102 | <div class="view"> |
| 103 | 103 | <?php |
| 104 | - echo wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 104 | + echo wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 105 | 105 | |
| 106 | - if ( $item->get_subtotal() !== $item->get_total() ) { |
|
| 107 | - /* translators: %s: discount amount */ |
|
| 108 | - echo '<span class="wc-order-item-discount">' . sprintf( esc_html__( '%s discount', 'woocommerce' ), wc_price( wc_format_decimal( $item->get_subtotal() - $item->get_total(), '' ), array( 'currency' => $order->get_currency() ) ) ) . '</span>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 109 | - } |
|
| 106 | + if ( $item->get_subtotal() !== $item->get_total() ) { |
|
| 107 | + /* translators: %s: discount amount */ |
|
| 108 | + echo '<span class="wc-order-item-discount">' . sprintf( esc_html__( '%s discount', 'woocommerce' ), wc_price( wc_format_decimal( $item->get_subtotal() - $item->get_total(), '' ), array( 'currency' => $order->get_currency() ) ) ) . '</span>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - $refunded = -1 * $order->get_total_refunded_for_item( $item_id ); |
|
| 111 | + $refunded = -1 * $order->get_total_refunded_for_item( $item_id ); |
|
| 112 | 112 | |
| 113 | - if ( $refunded ) { |
|
| 114 | - echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 115 | - } |
|
| 116 | - ?> |
|
| 113 | + if ( $refunded ) { |
|
| 114 | + echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 115 | + } |
|
| 116 | + ?> |
|
| 117 | 117 | </div> |
| 118 | 118 | <div class="edit" style="display: none;"> |
| 119 | 119 | <div class="split-input"> |
@@ -133,30 +133,30 @@ discard block |
||
| 133 | 133 | </td> |
| 134 | 134 | |
| 135 | 135 | <?php |
| 136 | - $tax_data = wc_tax_enabled() ? $item->get_taxes() : false; |
|
| 136 | + $tax_data = wc_tax_enabled() ? $item->get_taxes() : false; |
|
| 137 | 137 | |
| 138 | - if ( $tax_data ) { |
|
| 139 | - foreach ( $order_taxes as $tax_item ) { |
|
| 140 | - $tax_item_id = $tax_item->get_rate_id(); |
|
| 141 | - $tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : ''; |
|
| 142 | - $tax_item_subtotal = isset( $tax_data['subtotal'][ $tax_item_id ] ) ? $tax_data['subtotal'][ $tax_item_id ] : ''; |
|
| 138 | + if ( $tax_data ) { |
|
| 139 | + foreach ( $order_taxes as $tax_item ) { |
|
| 140 | + $tax_item_id = $tax_item->get_rate_id(); |
|
| 141 | + $tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : ''; |
|
| 142 | + $tax_item_subtotal = isset( $tax_data['subtotal'][ $tax_item_id ] ) ? $tax_data['subtotal'][ $tax_item_id ] : ''; |
|
| 143 | 143 | |
| 144 | - ?> |
|
| 144 | + ?> |
|
| 145 | 145 | <td class="line_tax" width="1%"> |
| 146 | 146 | <div class="view"> |
| 147 | 147 | <?php |
| 148 | - if ( '' !== $tax_item_total ) { |
|
| 149 | - echo wc_price( wc_round_tax_total( $tax_item_total ), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 150 | - } else { |
|
| 151 | - echo '–'; |
|
| 152 | - } |
|
| 153 | - |
|
| 154 | - $refunded = -1 * $order->get_tax_refunded_for_item( $item_id, $tax_item_id ); |
|
| 155 | - |
|
| 156 | - if ( $refunded ) { |
|
| 157 | - echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 158 | - } |
|
| 159 | - ?> |
|
| 148 | + if ( '' !== $tax_item_total ) { |
|
| 149 | + echo wc_price( wc_round_tax_total( $tax_item_total ), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 150 | + } else { |
|
| 151 | + echo '–'; |
|
| 152 | + } |
|
| 153 | + |
|
| 154 | + $refunded = -1 * $order->get_tax_refunded_for_item( $item_id, $tax_item_id ); |
|
| 155 | + |
|
| 156 | + if ( $refunded ) { |
|
| 157 | + echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 158 | + } |
|
| 159 | + ?> |
|
| 160 | 160 | </div> |
| 161 | 161 | <div class="edit" style="display: none;"> |
| 162 | 162 | <div class="split-input"> |
@@ -175,9 +175,9 @@ discard block |
||
| 175 | 175 | </div> |
| 176 | 176 | </td> |
| 177 | 177 | <?php |
| 178 | - } |
|
| 179 | - } |
|
| 180 | - ?> |
|
| 178 | + } |
|
| 179 | + } |
|
| 180 | + ?> |
|
| 181 | 181 | <td class="wc-order-edit-line-item" width="1%"> |
| 182 | 182 | <div class="wc-order-edit-line-item-actions"> |
| 183 | 183 | <?php if ( $order->is_editable() ) : ?> |
@@ -7,67 +7,67 @@ discard block |
||
| 7 | 7 | * @var int $item_id The id of the item being displayed |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -defined( 'ABSPATH' ) || exit; |
|
| 10 | +defined('ABSPATH') || exit; |
|
| 11 | 11 | |
| 12 | 12 | $product = $item->get_product(); |
| 13 | -$product_link = $product ? admin_url( 'post.php?post=' . $item->get_product_id() . '&action=edit' ) : ''; |
|
| 14 | -$thumbnail = $product ? apply_filters( 'woocommerce_admin_order_item_thumbnail', $product->get_image( 'thumbnail', array( 'title' => '' ), false ), $item_id, $item ) : ''; |
|
| 15 | -$row_class = apply_filters( 'woocommerce_admin_html_order_item_class', ! empty( $class ) ? $class : '', $item, $order ); |
|
| 13 | +$product_link = $product ? admin_url('post.php?post=' . $item->get_product_id() . '&action=edit') : ''; |
|
| 14 | +$thumbnail = $product ? apply_filters('woocommerce_admin_order_item_thumbnail', $product->get_image('thumbnail', array('title' => ''), false), $item_id, $item) : ''; |
|
| 15 | +$row_class = apply_filters('woocommerce_admin_html_order_item_class', !empty($class) ? $class : '', $item, $order); |
|
| 16 | 16 | ?> |
| 17 | -<tr class="item <?php echo esc_attr( $row_class ); ?>" data-order_item_id="<?php echo esc_attr( $item_id ); ?>"> |
|
| 17 | +<tr class="item <?php echo esc_attr($row_class); ?>" data-order_item_id="<?php echo esc_attr($item_id); ?>"> |
|
| 18 | 18 | <td class="thumb"> |
| 19 | - <?php echo '<div class="wc-order-item-thumbnail">' . wp_kses_post( $thumbnail ) . '</div>'; ?> |
|
| 19 | + <?php echo '<div class="wc-order-item-thumbnail">' . wp_kses_post($thumbnail) . '</div>'; ?> |
|
| 20 | 20 | </td> |
| 21 | - <td class="name" data-sort-value="<?php echo esc_attr( $item->get_name() ); ?>"> |
|
| 21 | + <td class="name" data-sort-value="<?php echo esc_attr($item->get_name()); ?>"> |
|
| 22 | 22 | <?php |
| 23 | - echo $product_link ? '<a href="' . esc_url( $product_link ) . '" class="wc-order-item-name">' . wp_kses_post( $item->get_name() ) . '</a>' : '<div class="wc-order-item-name">' . wp_kses_post( $item->get_name() ) . '</div>'; |
|
| 23 | + echo $product_link ? '<a href="' . esc_url($product_link) . '" class="wc-order-item-name">' . wp_kses_post($item->get_name()) . '</a>' : '<div class="wc-order-item-name">' . wp_kses_post($item->get_name()) . '</div>'; |
|
| 24 | 24 | |
| 25 | - if ( $product && $product->get_sku() ) { |
|
| 26 | - echo '<div class="wc-order-item-sku"><strong>' . esc_html__( 'SKU:', 'woocommerce' ) . '</strong> ' . esc_html( $product->get_sku() ) . '</div>'; |
|
| 25 | + if ($product && $product->get_sku()) { |
|
| 26 | + echo '<div class="wc-order-item-sku"><strong>' . esc_html__('SKU:', 'woocommerce') . '</strong> ' . esc_html($product->get_sku()) . '</div>'; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - if ( $item->get_variation_id() ) { |
|
| 30 | - echo '<div class="wc-order-item-variation"><strong>' . esc_html__( 'Variation ID:', 'woocommerce' ) . '</strong> '; |
|
| 31 | - if ( 'product_variation' === get_post_type( $item->get_variation_id() ) ) { |
|
| 32 | - echo esc_html( $item->get_variation_id() ); |
|
| 29 | + if ($item->get_variation_id()) { |
|
| 30 | + echo '<div class="wc-order-item-variation"><strong>' . esc_html__('Variation ID:', 'woocommerce') . '</strong> '; |
|
| 31 | + if ('product_variation' === get_post_type($item->get_variation_id())) { |
|
| 32 | + echo esc_html($item->get_variation_id()); |
|
| 33 | 33 | } else { |
| 34 | 34 | /* translators: %s: variation id */ |
| 35 | - printf( esc_html__( '%s (No longer exists)', 'woocommerce' ), esc_html( $item->get_variation_id() ) ); |
|
| 35 | + printf(esc_html__('%s (No longer exists)', 'woocommerce'), esc_html($item->get_variation_id())); |
|
| 36 | 36 | } |
| 37 | 37 | echo '</div>'; |
| 38 | 38 | } |
| 39 | 39 | ?> |
| 40 | - <input type="hidden" class="order_item_id" name="order_item_id[]" value="<?php echo esc_attr( $item_id ); ?>" /> |
|
| 41 | - <input type="hidden" name="order_item_tax_class[<?php echo absint( $item_id ); ?>]" value="<?php echo esc_attr( $item->get_tax_class() ); ?>" /> |
|
| 40 | + <input type="hidden" class="order_item_id" name="order_item_id[]" value="<?php echo esc_attr($item_id); ?>" /> |
|
| 41 | + <input type="hidden" name="order_item_tax_class[<?php echo absint($item_id); ?>]" value="<?php echo esc_attr($item->get_tax_class()); ?>" /> |
|
| 42 | 42 | |
| 43 | - <?php do_action( 'woocommerce_before_order_itemmeta', $item_id, $item, $product ); ?> |
|
| 43 | + <?php do_action('woocommerce_before_order_itemmeta', $item_id, $item, $product); ?> |
|
| 44 | 44 | <?php require __DIR__ . '/html-order-item-meta.php'; ?> |
| 45 | - <?php do_action( 'woocommerce_after_order_itemmeta', $item_id, $item, $product ); ?> |
|
| 45 | + <?php do_action('woocommerce_after_order_itemmeta', $item_id, $item, $product); ?> |
|
| 46 | 46 | </td> |
| 47 | 47 | |
| 48 | - <?php do_action( 'woocommerce_admin_order_item_values', $product, $item, absint( $item_id ) ); ?> |
|
| 48 | + <?php do_action('woocommerce_admin_order_item_values', $product, $item, absint($item_id)); ?> |
|
| 49 | 49 | |
| 50 | - <td class="item_cost" width="1%" data-sort-value="<?php echo esc_attr( $order->get_item_subtotal( $item, false, true ) ); ?>"> |
|
| 50 | + <td class="item_cost" width="1%" data-sort-value="<?php echo esc_attr($order->get_item_subtotal($item, false, true)); ?>"> |
|
| 51 | 51 | <div class="view"> |
| 52 | 52 | <?php |
| 53 | - echo wc_price( $order->get_item_subtotal( $item, false, true ), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 53 | + echo wc_price($order->get_item_subtotal($item, false, true), array('currency' => $order->get_currency())); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 54 | 54 | ?> |
| 55 | 55 | </div> |
| 56 | 56 | </td> |
| 57 | 57 | <td class="quantity" width="1%"> |
| 58 | 58 | <div class="view"> |
| 59 | 59 | <?php |
| 60 | - echo '<small class="times">×</small> ' . esc_html( $item->get_quantity() ); |
|
| 60 | + echo '<small class="times">×</small> ' . esc_html($item->get_quantity()); |
|
| 61 | 61 | |
| 62 | - $refunded_qty = -1 * $order->get_qty_refunded_for_item( $item_id ); |
|
| 62 | + $refunded_qty = -1 * $order->get_qty_refunded_for_item($item_id); |
|
| 63 | 63 | |
| 64 | - if ( $refunded_qty ) { |
|
| 65 | - echo '<small class="refunded">' . esc_html( $refunded_qty * -1 ) . '</small>'; |
|
| 64 | + if ($refunded_qty) { |
|
| 65 | + echo '<small class="refunded">' . esc_html($refunded_qty * -1) . '</small>'; |
|
| 66 | 66 | } |
| 67 | 67 | ?> |
| 68 | 68 | </div> |
| 69 | 69 | <?php |
| 70 | - $step = apply_filters( 'woocommerce_quantity_input_step', '1', $product ); |
|
| 70 | + $step = apply_filters('woocommerce_quantity_input_step', '1', $product); |
|
| 71 | 71 | |
| 72 | 72 | /** |
| 73 | 73 | * Filter to change the product quantity stepping in the order editor of the admin area. |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | * @param WC_Product $product The product that is being edited. |
| 78 | 78 | * @param string $context The context in which the quantity editor is shown, 'edit' or 'refund'. |
| 79 | 79 | */ |
| 80 | - $step_edit = apply_filters( 'woocommerce_quantity_input_step_admin', $step, $product, 'edit' ); |
|
| 81 | - $step_refund = apply_filters( 'woocommerce_quantity_input_step_admin', $step, $product, 'refund' ); |
|
| 80 | + $step_edit = apply_filters('woocommerce_quantity_input_step_admin', $step, $product, 'edit'); |
|
| 81 | + $step_refund = apply_filters('woocommerce_quantity_input_step_admin', $step, $product, 'refund'); |
|
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * Filter to change the product quantity minimum in the order editor of the admin area. |
@@ -88,90 +88,90 @@ discard block |
||
| 88 | 88 | * @param WC_Product $product The product that is being edited. |
| 89 | 89 | * @param string $context The context in which the quantity editor is shown, 'edit' or 'refund'. |
| 90 | 90 | */ |
| 91 | - $min_edit = apply_filters( 'woocommerce_quantity_input_min_admin', '0', $product, 'edit' ); |
|
| 92 | - $min_refund = apply_filters( 'woocommerce_quantity_input_min_admin', '0', $product, 'refund' ); |
|
| 91 | + $min_edit = apply_filters('woocommerce_quantity_input_min_admin', '0', $product, 'edit'); |
|
| 92 | + $min_refund = apply_filters('woocommerce_quantity_input_min_admin', '0', $product, 'refund'); |
|
| 93 | 93 | ?> |
| 94 | 94 | <div class="edit" style="display: none;"> |
| 95 | - <input type="number" step="<?php echo esc_attr( $step_edit ); ?>" min="<?php echo esc_attr( $min_edit ); ?>" autocomplete="off" name="order_item_qty[<?php echo absint( $item_id ); ?>]" placeholder="0" value="<?php echo esc_attr( $item->get_quantity() ); ?>" data-qty="<?php echo esc_attr( $item->get_quantity() ); ?>" size="4" class="quantity" /> |
|
| 95 | + <input type="number" step="<?php echo esc_attr($step_edit); ?>" min="<?php echo esc_attr($min_edit); ?>" autocomplete="off" name="order_item_qty[<?php echo absint($item_id); ?>]" placeholder="0" value="<?php echo esc_attr($item->get_quantity()); ?>" data-qty="<?php echo esc_attr($item->get_quantity()); ?>" size="4" class="quantity" /> |
|
| 96 | 96 | </div> |
| 97 | 97 | <div class="refund" style="display: none;"> |
| 98 | - <input type="number" step="<?php echo esc_attr( $step_refund ); ?>" min="<?php echo esc_attr( $min_refund ); ?>" max="<?php echo absint( $item->get_quantity() ); ?>" autocomplete="off" name="refund_order_item_qty[<?php echo absint( $item_id ); ?>]" placeholder="0" size="4" class="refund_order_item_qty" /> |
|
| 98 | + <input type="number" step="<?php echo esc_attr($step_refund); ?>" min="<?php echo esc_attr($min_refund); ?>" max="<?php echo absint($item->get_quantity()); ?>" autocomplete="off" name="refund_order_item_qty[<?php echo absint($item_id); ?>]" placeholder="0" size="4" class="refund_order_item_qty" /> |
|
| 99 | 99 | </div> |
| 100 | 100 | </td> |
| 101 | - <td class="line_cost" width="1%" data-sort-value="<?php echo esc_attr( $item->get_total() ); ?>"> |
|
| 101 | + <td class="line_cost" width="1%" data-sort-value="<?php echo esc_attr($item->get_total()); ?>"> |
|
| 102 | 102 | <div class="view"> |
| 103 | 103 | <?php |
| 104 | - echo wc_price( $item->get_total(), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 104 | + echo wc_price($item->get_total(), array('currency' => $order->get_currency())); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 105 | 105 | |
| 106 | - if ( $item->get_subtotal() !== $item->get_total() ) { |
|
| 106 | + if ($item->get_subtotal() !== $item->get_total()) { |
|
| 107 | 107 | /* translators: %s: discount amount */ |
| 108 | - echo '<span class="wc-order-item-discount">' . sprintf( esc_html__( '%s discount', 'woocommerce' ), wc_price( wc_format_decimal( $item->get_subtotal() - $item->get_total(), '' ), array( 'currency' => $order->get_currency() ) ) ) . '</span>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 108 | + echo '<span class="wc-order-item-discount">' . sprintf(esc_html__('%s discount', 'woocommerce'), wc_price(wc_format_decimal($item->get_subtotal() - $item->get_total(), ''), array('currency' => $order->get_currency()))) . '</span>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | - $refunded = -1 * $order->get_total_refunded_for_item( $item_id ); |
|
| 111 | + $refunded = -1 * $order->get_total_refunded_for_item($item_id); |
|
| 112 | 112 | |
| 113 | - if ( $refunded ) { |
|
| 114 | - echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 113 | + if ($refunded) { |
|
| 114 | + echo '<small class="refunded">' . wc_price($refunded, array('currency' => $order->get_currency())) . '</small>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 115 | 115 | } |
| 116 | 116 | ?> |
| 117 | 117 | </div> |
| 118 | 118 | <div class="edit" style="display: none;"> |
| 119 | 119 | <div class="split-input"> |
| 120 | 120 | <div class="input"> |
| 121 | - <label><?php esc_attr_e( 'Before discount', 'woocommerce' ); ?></label> |
|
| 122 | - <input type="text" name="line_subtotal[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_subtotal() ) ); ?>" class="line_subtotal wc_input_price" data-subtotal="<?php echo esc_attr( wc_format_localized_price( $item->get_subtotal() ) ); ?>" /> |
|
| 121 | + <label><?php esc_attr_e('Before discount', 'woocommerce'); ?></label> |
|
| 122 | + <input type="text" name="line_subtotal[<?php echo absint($item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" value="<?php echo esc_attr(wc_format_localized_price($item->get_subtotal())); ?>" class="line_subtotal wc_input_price" data-subtotal="<?php echo esc_attr(wc_format_localized_price($item->get_subtotal())); ?>" /> |
|
| 123 | 123 | </div> |
| 124 | 124 | <div class="input"> |
| 125 | - <label><?php esc_attr_e( 'Total', 'woocommerce' ); ?></label> |
|
| 126 | - <input type="text" name="line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" class="line_total wc_input_price" data-tip="<?php esc_attr_e( 'After pre-tax discounts.', 'woocommerce' ); ?>" data-total="<?php echo esc_attr( wc_format_localized_price( $item->get_total() ) ); ?>" /> |
|
| 125 | + <label><?php esc_attr_e('Total', 'woocommerce'); ?></label> |
|
| 126 | + <input type="text" name="line_total[<?php echo absint($item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" value="<?php echo esc_attr(wc_format_localized_price($item->get_total())); ?>" class="line_total wc_input_price" data-tip="<?php esc_attr_e('After pre-tax discounts.', 'woocommerce'); ?>" data-total="<?php echo esc_attr(wc_format_localized_price($item->get_total())); ?>" /> |
|
| 127 | 127 | </div> |
| 128 | 128 | </div> |
| 129 | 129 | </div> |
| 130 | 130 | <div class="refund" style="display: none;"> |
| 131 | - <input type="text" name="refund_line_total[<?php echo absint( $item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_total wc_input_price" /> |
|
| 131 | + <input type="text" name="refund_line_total[<?php echo absint($item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" class="refund_line_total wc_input_price" /> |
|
| 132 | 132 | </div> |
| 133 | 133 | </td> |
| 134 | 134 | |
| 135 | 135 | <?php |
| 136 | 136 | $tax_data = wc_tax_enabled() ? $item->get_taxes() : false; |
| 137 | 137 | |
| 138 | - if ( $tax_data ) { |
|
| 139 | - foreach ( $order_taxes as $tax_item ) { |
|
| 138 | + if ($tax_data) { |
|
| 139 | + foreach ($order_taxes as $tax_item) { |
|
| 140 | 140 | $tax_item_id = $tax_item->get_rate_id(); |
| 141 | - $tax_item_total = isset( $tax_data['total'][ $tax_item_id ] ) ? $tax_data['total'][ $tax_item_id ] : ''; |
|
| 142 | - $tax_item_subtotal = isset( $tax_data['subtotal'][ $tax_item_id ] ) ? $tax_data['subtotal'][ $tax_item_id ] : ''; |
|
| 141 | + $tax_item_total = isset($tax_data['total'][$tax_item_id]) ? $tax_data['total'][$tax_item_id] : ''; |
|
| 142 | + $tax_item_subtotal = isset($tax_data['subtotal'][$tax_item_id]) ? $tax_data['subtotal'][$tax_item_id] : ''; |
|
| 143 | 143 | |
| 144 | 144 | ?> |
| 145 | 145 | <td class="line_tax" width="1%"> |
| 146 | 146 | <div class="view"> |
| 147 | 147 | <?php |
| 148 | - if ( '' !== $tax_item_total ) { |
|
| 149 | - echo wc_price( wc_round_tax_total( $tax_item_total ), array( 'currency' => $order->get_currency() ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 148 | + if ('' !== $tax_item_total) { |
|
| 149 | + echo wc_price(wc_round_tax_total($tax_item_total), array('currency' => $order->get_currency())); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 150 | 150 | } else { |
| 151 | 151 | echo '–'; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - $refunded = -1 * $order->get_tax_refunded_for_item( $item_id, $tax_item_id ); |
|
| 154 | + $refunded = -1 * $order->get_tax_refunded_for_item($item_id, $tax_item_id); |
|
| 155 | 155 | |
| 156 | - if ( $refunded ) { |
|
| 157 | - echo '<small class="refunded">' . wc_price( $refunded, array( 'currency' => $order->get_currency() ) ) . '</small>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 156 | + if ($refunded) { |
|
| 157 | + echo '<small class="refunded">' . wc_price($refunded, array('currency' => $order->get_currency())) . '</small>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
|
| 158 | 158 | } |
| 159 | 159 | ?> |
| 160 | 160 | </div> |
| 161 | 161 | <div class="edit" style="display: none;"> |
| 162 | 162 | <div class="split-input"> |
| 163 | 163 | <div class="input"> |
| 164 | - <label><?php esc_attr_e( 'Before discount', 'woocommerce' ); ?></label> |
|
| 165 | - <input type="text" name="line_subtotal_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $tax_item_subtotal ) ); ?>" class="line_subtotal_tax wc_input_price" data-subtotal_tax="<?php echo esc_attr( wc_format_localized_price( $tax_item_subtotal ) ); ?>" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" /> |
|
| 164 | + <label><?php esc_attr_e('Before discount', 'woocommerce'); ?></label> |
|
| 165 | + <input type="text" name="line_subtotal_tax[<?php echo absint($item_id); ?>][<?php echo esc_attr($tax_item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" value="<?php echo esc_attr(wc_format_localized_price($tax_item_subtotal)); ?>" class="line_subtotal_tax wc_input_price" data-subtotal_tax="<?php echo esc_attr(wc_format_localized_price($tax_item_subtotal)); ?>" data-tax_id="<?php echo esc_attr($tax_item_id); ?>" /> |
|
| 166 | 166 | </div> |
| 167 | 167 | <div class="input"> |
| 168 | - <label><?php esc_attr_e( 'Total', 'woocommerce' ); ?></label> |
|
| 169 | - <input type="text" name="line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $tax_item_total ) ); ?>" class="line_tax wc_input_price" data-total_tax="<?php echo esc_attr( wc_format_localized_price( $tax_item_total ) ); ?>" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" /> |
|
| 168 | + <label><?php esc_attr_e('Total', 'woocommerce'); ?></label> |
|
| 169 | + <input type="text" name="line_tax[<?php echo absint($item_id); ?>][<?php echo esc_attr($tax_item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" value="<?php echo esc_attr(wc_format_localized_price($tax_item_total)); ?>" class="line_tax wc_input_price" data-total_tax="<?php echo esc_attr(wc_format_localized_price($tax_item_total)); ?>" data-tax_id="<?php echo esc_attr($tax_item_id); ?>" /> |
|
| 170 | 170 | </div> |
| 171 | 171 | </div> |
| 172 | 172 | </div> |
| 173 | 173 | <div class="refund" style="display: none;"> |
| 174 | - <input type="text" name="refund_line_tax[<?php echo absint( $item_id ); ?>][<?php echo esc_attr( $tax_item_id ); ?>]" placeholder="<?php echo esc_attr( wc_format_localized_price( 0 ) ); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo esc_attr( $tax_item_id ); ?>" /> |
|
| 174 | + <input type="text" name="refund_line_tax[<?php echo absint($item_id); ?>][<?php echo esc_attr($tax_item_id); ?>]" placeholder="<?php echo esc_attr(wc_format_localized_price(0)); ?>" class="refund_line_tax wc_input_price" data-tax_id="<?php echo esc_attr($tax_item_id); ?>" /> |
|
| 175 | 175 | </div> |
| 176 | 176 | </td> |
| 177 | 177 | <?php |
@@ -180,8 +180,8 @@ discard block |
||
| 180 | 180 | ?> |
| 181 | 181 | <td class="wc-order-edit-line-item" width="1%"> |
| 182 | 182 | <div class="wc-order-edit-line-item-actions"> |
| 183 | - <?php if ( $order->is_editable() ) : ?> |
|
| 184 | - <a class="edit-order-item tips" href="#" data-tip="<?php esc_attr_e( 'Edit item', 'woocommerce' ); ?>"></a><a class="delete-order-item tips" href="#" data-tip="<?php esc_attr_e( 'Delete item', 'woocommerce' ); ?>"></a> |
|
| 183 | + <?php if ($order->is_editable()) : ?> |
|
| 184 | + <a class="edit-order-item tips" href="#" data-tip="<?php esc_attr_e('Edit item', 'woocommerce'); ?>"></a><a class="delete-order-item tips" href="#" data-tip="<?php esc_attr_e('Delete item', 'woocommerce'); ?>"></a> |
|
| 185 | 185 | <?php endif; ?> |
| 186 | 186 | </div> |
| 187 | 187 | </td> |
@@ -6,127 +6,127 @@ |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | - exit; |
|
| 9 | + exit; |
|
| 10 | 10 | } |
| 11 | 11 | ?> |
| 12 | 12 | <div id="inventory_product_data" class="panel woocommerce_options_panel hidden"> |
| 13 | 13 | |
| 14 | 14 | <div class="options_group"> |
| 15 | 15 | <?php |
| 16 | - if ( wc_product_sku_enabled() ) { |
|
| 17 | - woocommerce_wp_text_input( |
|
| 18 | - array( |
|
| 19 | - 'id' => '_sku', |
|
| 20 | - 'value' => $product_object->get_sku( 'edit' ), |
|
| 21 | - 'label' => '<abbr title="' . esc_attr__( 'Stock Keeping Unit', 'woocommerce' ) . '">' . esc_html__( 'SKU', 'woocommerce' ) . '</abbr>', |
|
| 22 | - 'desc_tip' => true, |
|
| 23 | - 'description' => __( 'SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased.', 'woocommerce' ), |
|
| 24 | - ) |
|
| 25 | - ); |
|
| 26 | - } |
|
| 27 | - |
|
| 28 | - do_action( 'woocommerce_product_options_sku' ); |
|
| 29 | - |
|
| 30 | - if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) { |
|
| 31 | - |
|
| 32 | - woocommerce_wp_checkbox( |
|
| 33 | - array( |
|
| 34 | - 'id' => '_manage_stock', |
|
| 35 | - 'value' => $product_object->get_manage_stock( 'edit' ) ? 'yes' : 'no', |
|
| 36 | - 'wrapper_class' => 'show_if_simple show_if_variable', |
|
| 37 | - 'label' => __( 'Manage stock?', 'woocommerce' ), |
|
| 38 | - 'description' => __( 'Manage stock level (quantity)', 'woocommerce' ), |
|
| 39 | - ) |
|
| 40 | - ); |
|
| 41 | - |
|
| 42 | - do_action( 'woocommerce_product_options_stock' ); |
|
| 43 | - |
|
| 44 | - echo '<div class="stock_fields show_if_simple show_if_variable">'; |
|
| 45 | - |
|
| 46 | - woocommerce_wp_text_input( |
|
| 47 | - array( |
|
| 48 | - 'id' => '_stock', |
|
| 49 | - 'value' => wc_stock_amount( $product_object->get_stock_quantity( 'edit' ) ), |
|
| 50 | - 'label' => __( 'Stock quantity', 'woocommerce' ), |
|
| 51 | - 'desc_tip' => true, |
|
| 52 | - 'description' => __( 'Stock quantity. If this is a variable product this value will be used to control stock for all variations, unless you define stock at variation level.', 'woocommerce' ), |
|
| 53 | - 'type' => 'number', |
|
| 54 | - 'custom_attributes' => array( |
|
| 55 | - 'step' => 'any', |
|
| 56 | - ), |
|
| 57 | - 'data_type' => 'stock', |
|
| 58 | - ) |
|
| 59 | - ); |
|
| 60 | - |
|
| 61 | - echo '<input type="hidden" name="_original_stock" value="' . esc_attr( wc_stock_amount( $product_object->get_stock_quantity( 'edit' ) ) ) . '" />'; |
|
| 62 | - |
|
| 63 | - woocommerce_wp_select( |
|
| 64 | - array( |
|
| 65 | - 'id' => '_backorders', |
|
| 66 | - 'value' => $product_object->get_backorders( 'edit' ), |
|
| 67 | - 'label' => __( 'Allow backorders?', 'woocommerce' ), |
|
| 68 | - 'options' => wc_get_product_backorder_options(), |
|
| 69 | - 'desc_tip' => true, |
|
| 70 | - 'description' => __( 'If managing stock, this controls whether or not backorders are allowed. If enabled, stock quantity can go below 0.', 'woocommerce' ), |
|
| 71 | - ) |
|
| 72 | - ); |
|
| 73 | - |
|
| 74 | - woocommerce_wp_text_input( |
|
| 75 | - array( |
|
| 76 | - 'id' => '_low_stock_amount', |
|
| 77 | - 'value' => $product_object->get_low_stock_amount( 'edit' ), |
|
| 78 | - 'placeholder' => sprintf( |
|
| 79 | - /* translators: %d: Amount of stock left */ |
|
| 80 | - esc_attr__( 'Store-wide threshold (%d)', 'woocommerce' ), |
|
| 81 | - esc_attr( get_option( 'woocommerce_notify_low_stock_amount' ) ) |
|
| 82 | - ), |
|
| 83 | - 'label' => __( 'Low stock threshold', 'woocommerce' ), |
|
| 84 | - 'desc_tip' => true, |
|
| 85 | - 'description' => __( 'When product stock reaches this amount you will be notified by email. It is possible to define different values for each variation individually. The shop default value can be set in Settings > Products > Inventory.', 'woocommerce' ), |
|
| 86 | - 'type' => 'number', |
|
| 87 | - 'custom_attributes' => array( |
|
| 88 | - 'step' => 'any', |
|
| 89 | - ), |
|
| 90 | - ) |
|
| 91 | - ); |
|
| 92 | - |
|
| 93 | - do_action( 'woocommerce_product_options_stock_fields' ); |
|
| 94 | - |
|
| 95 | - echo '</div>'; |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - woocommerce_wp_select( |
|
| 99 | - array( |
|
| 100 | - 'id' => '_stock_status', |
|
| 101 | - 'value' => $product_object->get_stock_status( 'edit' ), |
|
| 102 | - 'wrapper_class' => 'stock_status_field hide_if_variable hide_if_external hide_if_grouped', |
|
| 103 | - 'label' => __( 'Stock status', 'woocommerce' ), |
|
| 104 | - 'options' => wc_get_product_stock_status_options(), |
|
| 105 | - 'desc_tip' => true, |
|
| 106 | - 'description' => __( 'Controls whether or not the product is listed as "in stock" or "out of stock" on the frontend.', 'woocommerce' ), |
|
| 107 | - ) |
|
| 108 | - ); |
|
| 109 | - |
|
| 110 | - do_action( 'woocommerce_product_options_stock_status' ); |
|
| 111 | - ?> |
|
| 16 | + if ( wc_product_sku_enabled() ) { |
|
| 17 | + woocommerce_wp_text_input( |
|
| 18 | + array( |
|
| 19 | + 'id' => '_sku', |
|
| 20 | + 'value' => $product_object->get_sku( 'edit' ), |
|
| 21 | + 'label' => '<abbr title="' . esc_attr__( 'Stock Keeping Unit', 'woocommerce' ) . '">' . esc_html__( 'SKU', 'woocommerce' ) . '</abbr>', |
|
| 22 | + 'desc_tip' => true, |
|
| 23 | + 'description' => __( 'SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased.', 'woocommerce' ), |
|
| 24 | + ) |
|
| 25 | + ); |
|
| 26 | + } |
|
| 27 | + |
|
| 28 | + do_action( 'woocommerce_product_options_sku' ); |
|
| 29 | + |
|
| 30 | + if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) { |
|
| 31 | + |
|
| 32 | + woocommerce_wp_checkbox( |
|
| 33 | + array( |
|
| 34 | + 'id' => '_manage_stock', |
|
| 35 | + 'value' => $product_object->get_manage_stock( 'edit' ) ? 'yes' : 'no', |
|
| 36 | + 'wrapper_class' => 'show_if_simple show_if_variable', |
|
| 37 | + 'label' => __( 'Manage stock?', 'woocommerce' ), |
|
| 38 | + 'description' => __( 'Manage stock level (quantity)', 'woocommerce' ), |
|
| 39 | + ) |
|
| 40 | + ); |
|
| 41 | + |
|
| 42 | + do_action( 'woocommerce_product_options_stock' ); |
|
| 43 | + |
|
| 44 | + echo '<div class="stock_fields show_if_simple show_if_variable">'; |
|
| 45 | + |
|
| 46 | + woocommerce_wp_text_input( |
|
| 47 | + array( |
|
| 48 | + 'id' => '_stock', |
|
| 49 | + 'value' => wc_stock_amount( $product_object->get_stock_quantity( 'edit' ) ), |
|
| 50 | + 'label' => __( 'Stock quantity', 'woocommerce' ), |
|
| 51 | + 'desc_tip' => true, |
|
| 52 | + 'description' => __( 'Stock quantity. If this is a variable product this value will be used to control stock for all variations, unless you define stock at variation level.', 'woocommerce' ), |
|
| 53 | + 'type' => 'number', |
|
| 54 | + 'custom_attributes' => array( |
|
| 55 | + 'step' => 'any', |
|
| 56 | + ), |
|
| 57 | + 'data_type' => 'stock', |
|
| 58 | + ) |
|
| 59 | + ); |
|
| 60 | + |
|
| 61 | + echo '<input type="hidden" name="_original_stock" value="' . esc_attr( wc_stock_amount( $product_object->get_stock_quantity( 'edit' ) ) ) . '" />'; |
|
| 62 | + |
|
| 63 | + woocommerce_wp_select( |
|
| 64 | + array( |
|
| 65 | + 'id' => '_backorders', |
|
| 66 | + 'value' => $product_object->get_backorders( 'edit' ), |
|
| 67 | + 'label' => __( 'Allow backorders?', 'woocommerce' ), |
|
| 68 | + 'options' => wc_get_product_backorder_options(), |
|
| 69 | + 'desc_tip' => true, |
|
| 70 | + 'description' => __( 'If managing stock, this controls whether or not backorders are allowed. If enabled, stock quantity can go below 0.', 'woocommerce' ), |
|
| 71 | + ) |
|
| 72 | + ); |
|
| 73 | + |
|
| 74 | + woocommerce_wp_text_input( |
|
| 75 | + array( |
|
| 76 | + 'id' => '_low_stock_amount', |
|
| 77 | + 'value' => $product_object->get_low_stock_amount( 'edit' ), |
|
| 78 | + 'placeholder' => sprintf( |
|
| 79 | + /* translators: %d: Amount of stock left */ |
|
| 80 | + esc_attr__( 'Store-wide threshold (%d)', 'woocommerce' ), |
|
| 81 | + esc_attr( get_option( 'woocommerce_notify_low_stock_amount' ) ) |
|
| 82 | + ), |
|
| 83 | + 'label' => __( 'Low stock threshold', 'woocommerce' ), |
|
| 84 | + 'desc_tip' => true, |
|
| 85 | + 'description' => __( 'When product stock reaches this amount you will be notified by email. It is possible to define different values for each variation individually. The shop default value can be set in Settings > Products > Inventory.', 'woocommerce' ), |
|
| 86 | + 'type' => 'number', |
|
| 87 | + 'custom_attributes' => array( |
|
| 88 | + 'step' => 'any', |
|
| 89 | + ), |
|
| 90 | + ) |
|
| 91 | + ); |
|
| 92 | + |
|
| 93 | + do_action( 'woocommerce_product_options_stock_fields' ); |
|
| 94 | + |
|
| 95 | + echo '</div>'; |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + woocommerce_wp_select( |
|
| 99 | + array( |
|
| 100 | + 'id' => '_stock_status', |
|
| 101 | + 'value' => $product_object->get_stock_status( 'edit' ), |
|
| 102 | + 'wrapper_class' => 'stock_status_field hide_if_variable hide_if_external hide_if_grouped', |
|
| 103 | + 'label' => __( 'Stock status', 'woocommerce' ), |
|
| 104 | + 'options' => wc_get_product_stock_status_options(), |
|
| 105 | + 'desc_tip' => true, |
|
| 106 | + 'description' => __( 'Controls whether or not the product is listed as "in stock" or "out of stock" on the frontend.', 'woocommerce' ), |
|
| 107 | + ) |
|
| 108 | + ); |
|
| 109 | + |
|
| 110 | + do_action( 'woocommerce_product_options_stock_status' ); |
|
| 111 | + ?> |
|
| 112 | 112 | </div> |
| 113 | 113 | |
| 114 | 114 | <div class="inventory_sold_individually options_group show_if_simple show_if_variable"> |
| 115 | 115 | <?php |
| 116 | - woocommerce_wp_checkbox( |
|
| 117 | - array( |
|
| 118 | - 'id' => '_sold_individually', |
|
| 119 | - 'value' => $product_object->get_sold_individually( 'edit' ) ? 'yes' : 'no', |
|
| 120 | - 'wrapper_class' => 'show_if_simple show_if_variable', |
|
| 121 | - 'label' => __( 'Sold individually', 'woocommerce' ), |
|
| 122 | - 'description' => __( 'Limit purchases to 1 item per order', 'woocommerce' ), |
|
| 123 | - ) |
|
| 124 | - ); |
|
| 125 | - |
|
| 126 | - echo wc_help_tip( __( 'Check to let customers to purchase only 1 item in a single order. This is particularly useful for items that have limited quantity, for example art or handmade goods.', 'woocommerce' ) ); |
|
| 127 | - |
|
| 128 | - do_action( 'woocommerce_product_options_sold_individually' ); |
|
| 129 | - ?> |
|
| 116 | + woocommerce_wp_checkbox( |
|
| 117 | + array( |
|
| 118 | + 'id' => '_sold_individually', |
|
| 119 | + 'value' => $product_object->get_sold_individually( 'edit' ) ? 'yes' : 'no', |
|
| 120 | + 'wrapper_class' => 'show_if_simple show_if_variable', |
|
| 121 | + 'label' => __( 'Sold individually', 'woocommerce' ), |
|
| 122 | + 'description' => __( 'Limit purchases to 1 item per order', 'woocommerce' ), |
|
| 123 | + ) |
|
| 124 | + ); |
|
| 125 | + |
|
| 126 | + echo wc_help_tip( __( 'Check to let customers to purchase only 1 item in a single order. This is particularly useful for items that have limited quantity, for example art or handmade goods.', 'woocommerce' ) ); |
|
| 127 | + |
|
| 128 | + do_action( 'woocommerce_product_options_sold_individually' ); |
|
| 129 | + ?> |
|
| 130 | 130 | </div> |
| 131 | 131 | |
| 132 | 132 | <?php do_action( 'woocommerce_product_options_inventory_product_data' ); ?> |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | * @package WooCommerce\Admin |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 8 | +if (!defined('ABSPATH')) { |
|
| 9 | 9 | exit; |
| 10 | 10 | } |
| 11 | 11 | ?> |
@@ -13,43 +13,43 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | <div class="options_group"> |
| 15 | 15 | <?php |
| 16 | - if ( wc_product_sku_enabled() ) { |
|
| 16 | + if (wc_product_sku_enabled()) { |
|
| 17 | 17 | woocommerce_wp_text_input( |
| 18 | 18 | array( |
| 19 | 19 | 'id' => '_sku', |
| 20 | - 'value' => $product_object->get_sku( 'edit' ), |
|
| 21 | - 'label' => '<abbr title="' . esc_attr__( 'Stock Keeping Unit', 'woocommerce' ) . '">' . esc_html__( 'SKU', 'woocommerce' ) . '</abbr>', |
|
| 20 | + 'value' => $product_object->get_sku('edit'), |
|
| 21 | + 'label' => '<abbr title="' . esc_attr__('Stock Keeping Unit', 'woocommerce') . '">' . esc_html__('SKU', 'woocommerce') . '</abbr>', |
|
| 22 | 22 | 'desc_tip' => true, |
| 23 | - 'description' => __( 'SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased.', 'woocommerce' ), |
|
| 23 | + 'description' => __('SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased.', 'woocommerce'), |
|
| 24 | 24 | ) |
| 25 | 25 | ); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - do_action( 'woocommerce_product_options_sku' ); |
|
| 28 | + do_action('woocommerce_product_options_sku'); |
|
| 29 | 29 | |
| 30 | - if ( 'yes' === get_option( 'woocommerce_manage_stock' ) ) { |
|
| 30 | + if ('yes' === get_option('woocommerce_manage_stock')) { |
|
| 31 | 31 | |
| 32 | 32 | woocommerce_wp_checkbox( |
| 33 | 33 | array( |
| 34 | 34 | 'id' => '_manage_stock', |
| 35 | - 'value' => $product_object->get_manage_stock( 'edit' ) ? 'yes' : 'no', |
|
| 35 | + 'value' => $product_object->get_manage_stock('edit') ? 'yes' : 'no', |
|
| 36 | 36 | 'wrapper_class' => 'show_if_simple show_if_variable', |
| 37 | - 'label' => __( 'Manage stock?', 'woocommerce' ), |
|
| 38 | - 'description' => __( 'Manage stock level (quantity)', 'woocommerce' ), |
|
| 37 | + 'label' => __('Manage stock?', 'woocommerce'), |
|
| 38 | + 'description' => __('Manage stock level (quantity)', 'woocommerce'), |
|
| 39 | 39 | ) |
| 40 | 40 | ); |
| 41 | 41 | |
| 42 | - do_action( 'woocommerce_product_options_stock' ); |
|
| 42 | + do_action('woocommerce_product_options_stock'); |
|
| 43 | 43 | |
| 44 | 44 | echo '<div class="stock_fields show_if_simple show_if_variable">'; |
| 45 | 45 | |
| 46 | 46 | woocommerce_wp_text_input( |
| 47 | 47 | array( |
| 48 | 48 | 'id' => '_stock', |
| 49 | - 'value' => wc_stock_amount( $product_object->get_stock_quantity( 'edit' ) ), |
|
| 50 | - 'label' => __( 'Stock quantity', 'woocommerce' ), |
|
| 49 | + 'value' => wc_stock_amount($product_object->get_stock_quantity('edit')), |
|
| 50 | + 'label' => __('Stock quantity', 'woocommerce'), |
|
| 51 | 51 | 'desc_tip' => true, |
| 52 | - 'description' => __( 'Stock quantity. If this is a variable product this value will be used to control stock for all variations, unless you define stock at variation level.', 'woocommerce' ), |
|
| 52 | + 'description' => __('Stock quantity. If this is a variable product this value will be used to control stock for all variations, unless you define stock at variation level.', 'woocommerce'), |
|
| 53 | 53 | 'type' => 'number', |
| 54 | 54 | 'custom_attributes' => array( |
| 55 | 55 | 'step' => 'any', |
@@ -58,31 +58,31 @@ discard block |
||
| 58 | 58 | ) |
| 59 | 59 | ); |
| 60 | 60 | |
| 61 | - echo '<input type="hidden" name="_original_stock" value="' . esc_attr( wc_stock_amount( $product_object->get_stock_quantity( 'edit' ) ) ) . '" />'; |
|
| 61 | + echo '<input type="hidden" name="_original_stock" value="' . esc_attr(wc_stock_amount($product_object->get_stock_quantity('edit'))) . '" />'; |
|
| 62 | 62 | |
| 63 | 63 | woocommerce_wp_select( |
| 64 | 64 | array( |
| 65 | 65 | 'id' => '_backorders', |
| 66 | - 'value' => $product_object->get_backorders( 'edit' ), |
|
| 67 | - 'label' => __( 'Allow backorders?', 'woocommerce' ), |
|
| 66 | + 'value' => $product_object->get_backorders('edit'), |
|
| 67 | + 'label' => __('Allow backorders?', 'woocommerce'), |
|
| 68 | 68 | 'options' => wc_get_product_backorder_options(), |
| 69 | 69 | 'desc_tip' => true, |
| 70 | - 'description' => __( 'If managing stock, this controls whether or not backorders are allowed. If enabled, stock quantity can go below 0.', 'woocommerce' ), |
|
| 70 | + 'description' => __('If managing stock, this controls whether or not backorders are allowed. If enabled, stock quantity can go below 0.', 'woocommerce'), |
|
| 71 | 71 | ) |
| 72 | 72 | ); |
| 73 | 73 | |
| 74 | 74 | woocommerce_wp_text_input( |
| 75 | 75 | array( |
| 76 | 76 | 'id' => '_low_stock_amount', |
| 77 | - 'value' => $product_object->get_low_stock_amount( 'edit' ), |
|
| 77 | + 'value' => $product_object->get_low_stock_amount('edit'), |
|
| 78 | 78 | 'placeholder' => sprintf( |
| 79 | 79 | /* translators: %d: Amount of stock left */ |
| 80 | - esc_attr__( 'Store-wide threshold (%d)', 'woocommerce' ), |
|
| 81 | - esc_attr( get_option( 'woocommerce_notify_low_stock_amount' ) ) |
|
| 80 | + esc_attr__('Store-wide threshold (%d)', 'woocommerce'), |
|
| 81 | + esc_attr(get_option('woocommerce_notify_low_stock_amount')) |
|
| 82 | 82 | ), |
| 83 | - 'label' => __( 'Low stock threshold', 'woocommerce' ), |
|
| 83 | + 'label' => __('Low stock threshold', 'woocommerce'), |
|
| 84 | 84 | 'desc_tip' => true, |
| 85 | - 'description' => __( 'When product stock reaches this amount you will be notified by email. It is possible to define different values for each variation individually. The shop default value can be set in Settings > Products > Inventory.', 'woocommerce' ), |
|
| 85 | + 'description' => __('When product stock reaches this amount you will be notified by email. It is possible to define different values for each variation individually. The shop default value can be set in Settings > Products > Inventory.', 'woocommerce'), |
|
| 86 | 86 | 'type' => 'number', |
| 87 | 87 | 'custom_attributes' => array( |
| 88 | 88 | 'step' => 'any', |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | ) |
| 91 | 91 | ); |
| 92 | 92 | |
| 93 | - do_action( 'woocommerce_product_options_stock_fields' ); |
|
| 93 | + do_action('woocommerce_product_options_stock_fields'); |
|
| 94 | 94 | |
| 95 | 95 | echo '</div>'; |
| 96 | 96 | } |
@@ -98,16 +98,16 @@ discard block |
||
| 98 | 98 | woocommerce_wp_select( |
| 99 | 99 | array( |
| 100 | 100 | 'id' => '_stock_status', |
| 101 | - 'value' => $product_object->get_stock_status( 'edit' ), |
|
| 101 | + 'value' => $product_object->get_stock_status('edit'), |
|
| 102 | 102 | 'wrapper_class' => 'stock_status_field hide_if_variable hide_if_external hide_if_grouped', |
| 103 | - 'label' => __( 'Stock status', 'woocommerce' ), |
|
| 103 | + 'label' => __('Stock status', 'woocommerce'), |
|
| 104 | 104 | 'options' => wc_get_product_stock_status_options(), |
| 105 | 105 | 'desc_tip' => true, |
| 106 | - 'description' => __( 'Controls whether or not the product is listed as "in stock" or "out of stock" on the frontend.', 'woocommerce' ), |
|
| 106 | + 'description' => __('Controls whether or not the product is listed as "in stock" or "out of stock" on the frontend.', 'woocommerce'), |
|
| 107 | 107 | ) |
| 108 | 108 | ); |
| 109 | 109 | |
| 110 | - do_action( 'woocommerce_product_options_stock_status' ); |
|
| 110 | + do_action('woocommerce_product_options_stock_status'); |
|
| 111 | 111 | ?> |
| 112 | 112 | </div> |
| 113 | 113 | |
@@ -116,18 +116,18 @@ discard block |
||
| 116 | 116 | woocommerce_wp_checkbox( |
| 117 | 117 | array( |
| 118 | 118 | 'id' => '_sold_individually', |
| 119 | - 'value' => $product_object->get_sold_individually( 'edit' ) ? 'yes' : 'no', |
|
| 119 | + 'value' => $product_object->get_sold_individually('edit') ? 'yes' : 'no', |
|
| 120 | 120 | 'wrapper_class' => 'show_if_simple show_if_variable', |
| 121 | - 'label' => __( 'Sold individually', 'woocommerce' ), |
|
| 122 | - 'description' => __( 'Limit purchases to 1 item per order', 'woocommerce' ), |
|
| 121 | + 'label' => __('Sold individually', 'woocommerce'), |
|
| 122 | + 'description' => __('Limit purchases to 1 item per order', 'woocommerce'), |
|
| 123 | 123 | ) |
| 124 | 124 | ); |
| 125 | 125 | |
| 126 | - echo wc_help_tip( __( 'Check to let customers to purchase only 1 item in a single order. This is particularly useful for items that have limited quantity, for example art or handmade goods.', 'woocommerce' ) ); |
|
| 126 | + echo wc_help_tip(__('Check to let customers to purchase only 1 item in a single order. This is particularly useful for items that have limited quantity, for example art or handmade goods.', 'woocommerce')); |
|
| 127 | 127 | |
| 128 | - do_action( 'woocommerce_product_options_sold_individually' ); |
|
| 128 | + do_action('woocommerce_product_options_sold_individually'); |
|
| 129 | 129 | ?> |
| 130 | 130 | </div> |
| 131 | 131 | |
| 132 | - <?php do_action( 'woocommerce_product_options_inventory_product_data' ); ?> |
|
| 132 | + <?php do_action('woocommerce_product_options_inventory_product_data'); ?> |
|
| 133 | 133 | </div> |