Skip to content

Commit

Permalink
Merge pull request #132 from wpswings/v4.3.8
Browse files Browse the repository at this point in the history
V4.3.8
  • Loading branch information
mohammaddanish-cedcoss authored May 1, 2024
2 parents 76b2f5f + f6dcbec commit 8de3338
Show file tree
Hide file tree
Showing 14 changed files with 85 additions and 69 deletions.
9 changes: 9 additions & 0 deletions admin/class-woo-refund-and-exchange-lite-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,15 @@ public function wps_rma_refund_amount() {
$response['refund_method'] = 'wallet_method';
}
wps_rma_update_meta_data( $order_id, 'wps_rma_left_amount_done', 'yes' );

$order = wc_get_order( $order_id );
foreach ( $order->get_items() as $item_id => $item ) {
$product = $item->get_product();
if ( 'mwb_booking' === $product->get_type() ) {
$order->update_status( 'wc-cancelled' );
break;
}
}
}
echo wp_json_encode( $response );
wp_die();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
$wps_wrna_all_product_checked = wps_rma_get_meta_data( $order_id, 'wps_wrna_all_product_checked', true );
$shipping_price = $order_obj->get_shipping_total();
// Add some extra <tr> in the table for refund approve mail.
if ( ( empty( $pro_active ) && 'on' == $wps_rma_allow_refund_shipping_charge ) || ( 1 == $wps_wrna_all_product_checked && 'on' == $wps_rma_allow_refund_shipping_charge ) ) {
if ( ( empty( $pro_active ) && 'on' == $wps_rma_allow_refund_shipping_charge ) || ( 1 == $wps_wrna_all_product_checked && 'on' == $wps_rma_allow_refund_shipping_charge ) && $shipping_price ) {
$total = round( $total ) + $shipping_price;
$message .= '<tr>
<th colspan="2" style="border: 1px solid #C7C7C7;">' . esc_html__( 'Refund Total', 'woo-refund-and-exchange-lite' ) . ':</th>
Expand Down
6 changes: 3 additions & 3 deletions assets/src/common/js/woo-refund-and-exchange-lite-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jQuery( document ).on( 'ready', function(){

if (rr_subject == '' || rr_subject == null ) {
rr_subject = $( '#wps_rma_return_request_subject_text' ).val();
if (rr_subject == '' || rr_subject == null || ! rr_subject.match(/[[A-Za-z]/i ) ) {
if (rr_subject == '' || rr_subject == null ) {
alerthtml += '<li>' + wrael_common_param.return_subject_msg + '</li>';
}
}
var rr_reason = $( '.wps_rma_return_request_reason' ).val();
if ( typeof( rr_reason ) !== 'undefined' && ( rr_reason == '' || rr_reason == null || ! rr_reason.match(/[[A-Za-z]/i ) ) ) {
if ( typeof( rr_reason ) !== 'undefined' && ( rr_reason == '' || rr_reason == null ) ) {
alerthtml += '<li>' + wrael_common_param.return_reason_msg + '</li>';
}

Expand Down Expand Up @@ -66,7 +66,7 @@ jQuery( document ).on( 'ready', function(){
var product_id = $(this).data('productid');
var item_id = $(this).data('itemid');
var product_price = $(this).find('td:eq(0)').children('.wps_rma_product_amount').val();
var product_qty = $(this).find('td:eq(1)').children('.wps_rma_return_product_qty').val();
var product_qty = $(this).find('.wps_rma_return_product_qty').val();
product_info['product_id'] = product_id;
product_info['variation_id'] = variation_id;
product_info['item_id'] = item_id;
Expand Down
6 changes: 3 additions & 3 deletions common/js/woo-refund-and-exchange-lite-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jQuery( document ).on( 'ready', function(){

if (rr_subject == '' || rr_subject == null ) {
rr_subject = $( '#wps_rma_return_request_subject_text' ).val();
if (rr_subject == '' || rr_subject == null || ! rr_subject.match(/[[A-Za-z]/i ) ) {
if (rr_subject == '' || rr_subject == null ) {
alerthtml += '<li>' + wrael_common_param.return_subject_msg + '</li>';
}
}
var rr_reason = $( '.wps_rma_return_request_reason' ).val();
if ( typeof( rr_reason ) !== 'undefined' && ( rr_reason == '' || rr_reason == null || ! rr_reason.match(/[[A-Za-z]/i ) ) ) {
if ( typeof( rr_reason ) !== 'undefined' && ( rr_reason == '' || rr_reason == null ) ) {
alerthtml += '<li>' + wrael_common_param.return_reason_msg + '</li>';
}

Expand Down Expand Up @@ -66,7 +66,7 @@ jQuery( document ).on( 'ready', function(){
var product_id = $(this).data('productid');
var item_id = $(this).data('itemid');
var product_price = $(this).find('td:eq(0)').children('.wps_rma_product_amount').val();
var product_qty = $(this).find('td:eq(1)').children('.wps_rma_return_product_qty').val();
var product_qty = $(this).find('.wps_rma_return_product_qty').val();
product_info['product_id'] = product_id;
product_info['variation_id'] = variation_id;
product_info['item_id'] = item_id;
Expand Down
2 changes: 1 addition & 1 deletion common/js/woo-refund-and-exchange-lite-common.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
$wps_rma_allow_refund_shipping_charge = get_option( 'wps_rma_allow_refund_shipping_charge' );
$wps_wrna_all_product_checked = wps_rma_get_meta_data( $order_id, 'wps_wrna_all_product_checked', true );
$shipping_price = $order_obj->get_shipping_total();
if ( ( empty( $pro_active ) && 'on' == $wps_rma_allow_refund_shipping_charge ) || ( 1 == $wps_wrna_all_product_checked && 'on' == $wps_rma_allow_refund_shipping_charge ) ) {
if ( ( empty( $pro_active ) && 'on' == $wps_rma_allow_refund_shipping_charge ) || ( 1 == $wps_wrna_all_product_checked && 'on' == $wps_rma_allow_refund_shipping_charge ) && $shipping_price ) {
$total = round( $total ) + $shipping_price;
$message .= '<tr>
<th colspan="2" style="border: 1px solid #C7C7C7;">' . esc_html__( 'Refund Total', 'woo-refund-and-exchange-lite' ) . ':</th>
Expand Down
Binary file modified languages/woo-refund-and-exchange-lite-en_US.mo
Binary file not shown.
Loading

0 comments on commit 8de3338

Please sign in to comment.