diff --git a/admin/partials/email_template/woo-refund-and-exchange-lite-refund-request-accept-email.php b/admin/partials/email_template/woo-refund-and-exchange-lite-refund-request-accept-email.php index f94e0c9..d362de0 100755 --- a/admin/partials/email_template/woo-refund-and-exchange-lite-refund-request-accept-email.php +++ b/admin/partials/email_template/woo-refund-and-exchange-lite-refund-request-accept-email.php @@ -66,7 +66,7 @@ } $message .= '' . $item['name'] . '
'; $message .= '' . $item_meta_html . ' - ' . $item['qty'] . ' + ' . $requested_product['qty'] . ' ' . wps_wrma_format_price( $requested_product['price'] * $requested_product['qty'], $get_order_currency ) . ' '; } diff --git a/assets/src/common/js/woo-refund-and-exchange-lite-common.js b/assets/src/common/js/woo-refund-and-exchange-lite-common.js index f544ff3..0b0eb47 100755 --- a/assets/src/common/js/woo-refund-and-exchange-lite-common.js +++ b/assets/src/common/js/woo-refund-and-exchange-lite-common.js @@ -33,7 +33,26 @@ jQuery( document ).on( 'ready', function(){ } } } + + var attachment_enable = wrael_common_param.refund_form_attachment; + if ( attachment_enable && 'on' == attachment_enable ) { + $('.wps_rma_return_request_files').each(function(){ + var up_files = $(this); + var totalfiles = up_files[0].files.length; + if ( totalfiles ) { + var file_type = up_files[0].files[0].type; + if ( 'image/png' == file_type || 'image/jpeg' == file_type || 'image/jpg' == file_type ) { + } else { + alerthtml += '
  • '+ wrael_common_param.file_not_supported + '
  • '; + } + } else { + alerthtml += '
  • '+ wrael_common_param.no_file_attached +'
  • '; + } + }); + } + if (alerthtml != '') { + $( '#wps_rma_return_alert' ).show(); $( '#wps_rma_return_alert' ).html( alerthtml ); $( '#wps_rma_return_alert' ).addClass('woocommerce-error'); $( '#wps_rma_return_alert' ).removeClass('woocommerce-message'); @@ -49,6 +68,7 @@ jQuery( document ).on( 'ready', function(){ $( '#wps_rma_return_alert' ).hide(); $( '#wps_rma_return_alert' ).html( alerthtml ); } + if( pro_act ){ if (typeof wps_rma_refund_total == 'function') { var return_data = wps_rma_refund_total(); @@ -166,25 +186,41 @@ jQuery( document ).on( 'ready', function(){ var msg = $('#wps_order_new_msg').val(); var order_msg_type = $('#order_msg_type').val(); var alerthtml = ''; - if ( msg == '' ) { - alerthtml = '

    '+ wrael_common_param.message_empty +'

    X'; - $('.wps_order_msg_notice_wrapper').css('display', 'flex'); - $('.wps_order_msg_notice_wrapper').css('background-color', 'red'); - $('.wps_order_msg_notice_wrapper').html(alerthtml); - $('#wps_order_msg_submit').css({'outline-color':'white', 'border-color':'white'}); - return false; - } var order_id = $(this).data('id'); var form_data = new FormData(); // Read selected files - if ( up_files[0] ) { + var attachment_enable = wrael_common_param.order_msg_attachment; + if ( attachment_enable && 'on' == attachment_enable && up_files[0] ) { var totalfiles = up_files[0].files.length; - for (var index = 0; index < totalfiles; index++) { - form_data.append('wps_order_msg_attachment[]', up_files[0].files[index]); + if ( totalfiles ) { + for (var index = 0; index < totalfiles; index++) { + var file_type = up_files[0].files[index].type; + if ( 'image/png' == file_type || 'image/jpeg' == file_type || 'image/jpg' == file_type ) { + form_data.append('wps_order_msg_attachment[]', up_files[0].files[index]); + } else { + alerthtml = '

    '+ wrael_common_param.file_not_supported +'

    X'; + } + } + + } else { + alerthtml = '

    '+ wrael_common_param.no_file_attached +'

    X'; } } + if ( order_msg_type == 'admin') { + alerthtml = ''; + } + if ( msg == '' ) { + alerthtml = '

    '+ wrael_common_param.message_empty +'

    X'; + } + if ( alerthtml ) { + $('.wps_order_msg_notice_wrapper').css('display', 'flex'); + $('.wps_order_msg_notice_wrapper').css('background-color', 'red'); + $('.wps_order_msg_notice_wrapper').html(alerthtml); + $('#wps_order_msg_submit').css({'outline-color':'white', 'border-color':'white'}); + return false; + } form_data.append( 'action', 'wps_rma_order_messages_save' ); form_data.append( 'msg', msg ); form_data.append( 'order_msg_type', order_msg_type ); diff --git a/assets/src/front-end/scss/main.scss b/assets/src/front-end/scss/main.scss index 00b9d42..7db9f7c 100755 --- a/assets/src/front-end/scss/main.scss +++ b/assets/src/front-end/scss/main.scss @@ -50,7 +50,7 @@ } .wps-rma-form__wrapper label{ margin-bottom: 8px; - display: inline-block; + display: inline-block !important; line-height: 1.2; } .wps-rma-form__wrapper h4{ @@ -458,4 +458,8 @@ div.wps_order_msg_single_attachment a .wps_order_msg_attachment_thumbnail{ .wps_rma_customer_detail { padding: 30px 15px; overflow: hidden; +} + +.wps_field_mendatory{ + color:red; } \ No newline at end of file diff --git a/common/class-woo-refund-and-exchange-lite-common.php b/common/class-woo-refund-and-exchange-lite-common.php index 5573880..cedddd3 100755 --- a/common/class-woo-refund-and-exchange-lite-common.php +++ b/common/class-woo-refund-and-exchange-lite-common.php @@ -31,8 +31,8 @@ class Woo_Refund_And_Exchange_Lite_Common { /** * The version of this plugin. * - * @since 1.0.0 - * @var string $version The current version of this plugin. + * @since 1.0.0 + * @var string $version The current version of this plugin. */ private $version; @@ -69,23 +69,27 @@ public function wrael_common_enqueue_scripts() { $myaccount_page = get_option( 'woocommerce_myaccount_page_id' ); $myaccount_page_url = get_permalink( $myaccount_page ); } else { - $myaccount_page_url = ''; - $myaccount_page_url = apply_filters( 'myaccount_page_url', $myaccount_page_url ); + $myaccount_page = get_option( 'woocommerce_myaccount_page_id' ); + $myaccount_page_url = get_permalink( $myaccount_page ); } wp_register_script( $this->plugin_name . 'common', WOO_REFUND_AND_EXCHANGE_LITE_DIR_URL . 'common/js/woo-refund-and-exchange-lite-common.min.js', array( 'jquery' ), $this->version, false ); wp_localize_script( $this->plugin_name . 'common', 'wrael_common_param', array( - 'ajaxurl' => admin_url( 'admin-ajax.php' ), - 'wps_rma_nonce' => wp_create_nonce( 'wps_rma_ajax_security' ), - 'return_subject_msg' => esc_html__( 'Please Enter Refund Subject.', 'woo-refund-and-exchange-lite' ), - 'return_reason_msg' => esc_html__( 'Please Enter Refund Reason.', 'woo-refund-and-exchange-lite' ), - 'return_select_product' => esc_html__( 'Please Select Product to refund.', 'woo-refund-and-exchange-lite' ), - 'check_pro_active' => esc_html( $pro_active ), - 'message_sent' => esc_html__( 'The message has been sent successfully', 'woo-refund-and-exchange-lite' ), - 'message_empty' => esc_html__( 'Please Enter a Message.', 'woo-refund-and-exchange-lite' ), - 'myaccount_url' => esc_attr( $myaccount_page_url ), + 'ajaxurl' => admin_url( 'admin-ajax.php' ), + 'wps_rma_nonce' => wp_create_nonce( 'wps_rma_ajax_security' ), + 'return_subject_msg' => esc_html__( 'Please Enter Refund Subject.', 'woo-refund-and-exchange-lite' ), + 'return_reason_msg' => esc_html__( 'Please Enter Refund Reason.', 'woo-refund-and-exchange-lite' ), + 'return_select_product' => esc_html__( 'Please Select Product to refund.', 'woo-refund-and-exchange-lite' ), + 'check_pro_active' => esc_html( $pro_active ), + 'message_sent' => esc_html__( 'The message has been sent successfully', 'woo-refund-and-exchange-lite' ), + 'message_empty' => esc_html__( 'Please Enter a Message.', 'woo-refund-and-exchange-lite' ), + 'myaccount_url' => esc_attr( $myaccount_page_url ), + 'refund_form_attachment' => get_option( 'wps_rma_refund_attachment' ), + 'order_msg_attachment' => get_option( 'wps_rma_general_enable_om_attachment' ), + 'no_file_attached' => esc_html__( 'No File Attached', 'woo-refund-and-exchange-lite' ), + 'file_not_supported' => esc_html__( 'Attached File type is not supported', 'woo-refund-and-exchange-lite' ), ) ); wp_enqueue_script( $this->plugin_name . 'common' ); diff --git a/common/js/woo-refund-and-exchange-lite-common.js b/common/js/woo-refund-and-exchange-lite-common.js index f544ff3..0b0eb47 100755 --- a/common/js/woo-refund-and-exchange-lite-common.js +++ b/common/js/woo-refund-and-exchange-lite-common.js @@ -33,7 +33,26 @@ jQuery( document ).on( 'ready', function(){ } } } + + var attachment_enable = wrael_common_param.refund_form_attachment; + if ( attachment_enable && 'on' == attachment_enable ) { + $('.wps_rma_return_request_files').each(function(){ + var up_files = $(this); + var totalfiles = up_files[0].files.length; + if ( totalfiles ) { + var file_type = up_files[0].files[0].type; + if ( 'image/png' == file_type || 'image/jpeg' == file_type || 'image/jpg' == file_type ) { + } else { + alerthtml += '
  • '+ wrael_common_param.file_not_supported + '
  • '; + } + } else { + alerthtml += '
  • '+ wrael_common_param.no_file_attached +'
  • '; + } + }); + } + if (alerthtml != '') { + $( '#wps_rma_return_alert' ).show(); $( '#wps_rma_return_alert' ).html( alerthtml ); $( '#wps_rma_return_alert' ).addClass('woocommerce-error'); $( '#wps_rma_return_alert' ).removeClass('woocommerce-message'); @@ -49,6 +68,7 @@ jQuery( document ).on( 'ready', function(){ $( '#wps_rma_return_alert' ).hide(); $( '#wps_rma_return_alert' ).html( alerthtml ); } + if( pro_act ){ if (typeof wps_rma_refund_total == 'function') { var return_data = wps_rma_refund_total(); @@ -166,25 +186,41 @@ jQuery( document ).on( 'ready', function(){ var msg = $('#wps_order_new_msg').val(); var order_msg_type = $('#order_msg_type').val(); var alerthtml = ''; - if ( msg == '' ) { - alerthtml = '

    '+ wrael_common_param.message_empty +'

    X'; - $('.wps_order_msg_notice_wrapper').css('display', 'flex'); - $('.wps_order_msg_notice_wrapper').css('background-color', 'red'); - $('.wps_order_msg_notice_wrapper').html(alerthtml); - $('#wps_order_msg_submit').css({'outline-color':'white', 'border-color':'white'}); - return false; - } var order_id = $(this).data('id'); var form_data = new FormData(); // Read selected files - if ( up_files[0] ) { + var attachment_enable = wrael_common_param.order_msg_attachment; + if ( attachment_enable && 'on' == attachment_enable && up_files[0] ) { var totalfiles = up_files[0].files.length; - for (var index = 0; index < totalfiles; index++) { - form_data.append('wps_order_msg_attachment[]', up_files[0].files[index]); + if ( totalfiles ) { + for (var index = 0; index < totalfiles; index++) { + var file_type = up_files[0].files[index].type; + if ( 'image/png' == file_type || 'image/jpeg' == file_type || 'image/jpg' == file_type ) { + form_data.append('wps_order_msg_attachment[]', up_files[0].files[index]); + } else { + alerthtml = '

    '+ wrael_common_param.file_not_supported +'

    X'; + } + } + + } else { + alerthtml = '

    '+ wrael_common_param.no_file_attached +'

    X'; } } + if ( order_msg_type == 'admin') { + alerthtml = ''; + } + if ( msg == '' ) { + alerthtml = '

    '+ wrael_common_param.message_empty +'

    X'; + } + if ( alerthtml ) { + $('.wps_order_msg_notice_wrapper').css('display', 'flex'); + $('.wps_order_msg_notice_wrapper').css('background-color', 'red'); + $('.wps_order_msg_notice_wrapper').html(alerthtml); + $('#wps_order_msg_submit').css({'outline-color':'white', 'border-color':'white'}); + return false; + } form_data.append( 'action', 'wps_rma_order_messages_save' ); form_data.append( 'msg', msg ); form_data.append( 'order_msg_type', order_msg_type ); diff --git a/common/js/woo-refund-and-exchange-lite-common.min.js b/common/js/woo-refund-and-exchange-lite-common.min.js index 3fae27c..8348ee8 100755 --- a/common/js/woo-refund-and-exchange-lite-common.min.js +++ b/common/js/woo-refund-and-exchange-lite-common.min.js @@ -1 +1 @@ -jQuery(document).on("ready",(function(){$=jQuery,$(".wps_rma_return_notification").hide(),$("#wps_rma_return_request_form").on("submit",(function(r){r.preventDefault();var e=$(this).data("orderid"),_=$(".wps_rma_total_refund_price").val(),a="",o={},t=0,s="",n=wrael_common_param.check_pro_active,c=$("#wps_rma_return_request_subject").val();""!=c&&null!=c||""!=(c=$("#wps_rma_return_request_subject_text").val())&&null!=c&&c.match(/[[A-Za-z]/i)||(a+="
  • "+wrael_common_param.return_subject_msg+"
  • ");var m=$(".wps_rma_return_request_reason").val();if(void 0===m||""!=m&&null!=m&&m.match(/[[A-Za-z]/i)||(a+="
  • "+wrael_common_param.return_reason_msg+"
  • "),n&&"function"==typeof wps_rma_return_alert_condition_addon){var p=wps_rma_return_alert_condition_addon();p&&(a+=p)}if(""!=a)return $("#wps_rma_return_alert").html(a),$("#wps_rma_return_alert").addClass("woocommerce-error"),$("#wps_rma_return_alert").removeClass("woocommerce-message"),$("#wps_rma_return_alert").css("background-color","red"),$("html, body").animate({scrollTop:$("#wps_rma_return_request_container").offset().top},800),!1;if($("#wps_rma_return_alert").hide(),$("#wps_rma_return_alert").html(a),n){if("function"==typeof wps_rma_refund_total){var d=wps_rma_refund_total();o=d.selected_product,_=d.amount}}else $(".wps_rma_return_column").each((function(){if($(this).find("td:eq(0)").children(".wps_rma_return_product")){var r={},e=$(this).data("variationid"),_=$(this).data("productid"),a=$(this).data("itemid"),s=$(this).find("td:eq(0)").children(".wps_rma_product_amount").val(),n=$(this).find("td:eq(1)").children(".wps_rma_return_product_qty").val();r.product_id=_,r.variation_id=e,r.item_id=a,r.price=s,r.qty=n,o[t]=r,t++}}));n&&"function"==typeof wps_rma_refund_method&&(s=wps_rma_refund_method());var i={action:"wps_rma_save_return_request",products:o,amount:_,subject:c,reason:m,orderid:e,bankdetails:$("#wps_rma_bank_details").val(),refund_method:s,security_check:wrael_common_param.wps_rma_nonce},u=new FormData(this);u.append("action","wps_rma_return_upload_files"),u.append("security_check",wrael_common_param.wps_rma_nonce),$(".wps_rma_return_notification").show(),$.ajax({url:wrael_common_param.ajaxurl,type:"POST",data:u,contentType:!1,cache:!1,processData:!1,success:function(r){$.ajax({url:wrael_common_param.ajaxurl,type:"POST",data:i,dataType:"json",success:function(r){var _=10;setInterval((function(){_>=0&&$("#countdownTimer").html(_),_-=1}),1e3);$("#wps_rma_return_alert").removeClass("woocommerce-error"),$("#wps_rma_return_alert").addClass("woocommerce-message"),$("#wps_rma_return_alert").css("background-color","#8FAE1B"),$("#wps_rma_return_alert").show(),$("#wps_rma_return_alert").html(r.msg+' in seconds'),$(".wps_rma_return_notification").hide(),$("html, body").animate({scrollTop:$("#wps_rma_return_request_container").offset().top},800),void 0!==r.auto_accept&&1==r.auto_accept?"function"==typeof wps_rma_refund_auto_accept&&wps_rma_refund_auto_accept(e):window.setTimeout((function(){window.location.href=wrael_common_param.myaccount_url}),11e3)}})}})})),$(document).on("click",".wps_remove_notice_msg",(function(r){r.preventDefault(),$(".wps_order_msg_notice_wrapper").hide()})),$(document).on("click","#wps_order_msg_submit",(function(r){r.preventDefault();var e=$("#wps_order_msg_attachment"),_=$("#wps_order_new_msg").val(),a=$("#order_msg_type").val(),o="";if(""==_)return o='

    '+wrael_common_param.message_empty+'

    X',$(".wps_order_msg_notice_wrapper").css("display","flex"),$(".wps_order_msg_notice_wrapper").css("background-color","red"),$(".wps_order_msg_notice_wrapper").html(o),$("#wps_order_msg_submit").css({"outline-color":"white","border-color":"white"}),!1;var t=$(this).data("id"),s=new FormData;if(e[0])for(var n=e[0].files.length,c=0;cX';$(".wps_order_msg_notice_wrapper").css("background-color","#64CD83"),$(".wps_order_msg_notice_wrapper").css("display","flex"),$("#wps_order_msg_submit").css({"outline-color":"none","border-color":"none"}),$(".wps_order_msg_sub_container").load(document.URL+" .wps-order-msg__row"),$("#wps_order_new_msg").val(""),$("#wps_order_msg_attachment").val(""),$(".wps_order_msg_notice_wrapper").html(e)}}})})),$(".wps_order_msg_reload_notice_wrapper").hide(),$(document).on("click",".wps_reload_messages",(function(r){r.preventDefault(),$(this).addClass("wps-loader-icon"),$(".wps_order_msg_sub_container").load(document.URL+" .wps-order-msg__row"),setTimeout((function(){$(".wps_reload_messages").removeClass("wps-loader-icon"),$(".wps_order_msg_reload_notice_wrapper").show(),$(".wps_order_msg_reload_notice_wrapper").css({"background-color":"rgb(100, 205, 131)","border-radius":"5px",color:"white","padding-left":"10px"})}),2e3),setTimeout((function(){$(".wps_order_msg_reload_notice_wrapper").hide()}),3e3)})),$(document).on("click",".wps_order_send_msg_dismiss",(function(r){r.preventDefault(),$(".wps_order_msg_notice_wrapper").hide()}))})); \ No newline at end of file +jQuery(document).on("ready",(function(){$=jQuery,$(".wps_rma_return_notification").hide(),$("#wps_rma_return_request_form").on("submit",(function(e){e.preventDefault();var r=$(this).data("orderid"),_=$(".wps_rma_total_refund_price").val(),a="",o={},t=0,s="",n=wrael_common_param.check_pro_active,m=$("#wps_rma_return_request_subject").val();""!=m&&null!=m||""!=(m=$("#wps_rma_return_request_subject_text").val())&&null!=m&&m.match(/[[A-Za-z]/i)||(a+="
  • "+wrael_common_param.return_subject_msg+"
  • ");var p=$(".wps_rma_return_request_reason").val();if(void 0===p||""!=p&&null!=p&&p.match(/[[A-Za-z]/i)||(a+="
  • "+wrael_common_param.return_reason_msg+"
  • "),n&&"function"==typeof wps_rma_return_alert_condition_addon){var c=wps_rma_return_alert_condition_addon();c&&(a+=c)}var i=wrael_common_param.refund_form_attachment;if(i&&"on"==i&&$(".wps_rma_return_request_files").each((function(){var e=$(this);if(e[0].files.length){var r=e[0].files[0].type;"image/png"==r||"image/jpeg"==r||"image/jpg"==r||(a+="
  • "+wrael_common_param.file_not_supported+"
  • ")}else a+="
  • "+wrael_common_param.no_file_attached+"
  • "})),""!=a)return $("#wps_rma_return_alert").show(),$("#wps_rma_return_alert").html(a),$("#wps_rma_return_alert").addClass("woocommerce-error"),$("#wps_rma_return_alert").removeClass("woocommerce-message"),$("#wps_rma_return_alert").css("background-color","red"),$("html, body").animate({scrollTop:$("#wps_rma_return_request_container").offset().top},800),!1;if($("#wps_rma_return_alert").hide(),$("#wps_rma_return_alert").html(a),n){if("function"==typeof wps_rma_refund_total){var d=wps_rma_refund_total();o=d.selected_product,_=d.amount}}else $(".wps_rma_return_column").each((function(){if($(this).find("td:eq(0)").children(".wps_rma_return_product")){var e={},r=$(this).data("variationid"),_=$(this).data("productid"),a=$(this).data("itemid"),s=$(this).find("td:eq(0)").children(".wps_rma_product_amount").val(),n=$(this).find("td:eq(1)").children(".wps_rma_return_product_qty").val();e.product_id=_,e.variation_id=r,e.item_id=a,e.price=s,e.qty=n,o[t]=e,t++}}));n&&"function"==typeof wps_rma_refund_method&&(s=wps_rma_refund_method());var l={action:"wps_rma_save_return_request",products:o,amount:_,subject:m,reason:p,orderid:r,bankdetails:$("#wps_rma_bank_details").val(),refund_method:s,security_check:wrael_common_param.wps_rma_nonce},u=new FormData(this);u.append("action","wps_rma_return_upload_files"),u.append("security_check",wrael_common_param.wps_rma_nonce),$(".wps_rma_return_notification").show(),$.ajax({url:wrael_common_param.ajaxurl,type:"POST",data:u,contentType:!1,cache:!1,processData:!1,success:function(e){$.ajax({url:wrael_common_param.ajaxurl,type:"POST",data:l,dataType:"json",success:function(e){var _=10;setInterval((function(){_>=0&&$("#countdownTimer").html(_),_-=1}),1e3);$("#wps_rma_return_alert").removeClass("woocommerce-error"),$("#wps_rma_return_alert").addClass("woocommerce-message"),$("#wps_rma_return_alert").css("background-color","#8FAE1B"),$("#wps_rma_return_alert").show(),$("#wps_rma_return_alert").html(e.msg+' in seconds'),$(".wps_rma_return_notification").hide(),$("html, body").animate({scrollTop:$("#wps_rma_return_request_container").offset().top},800),void 0!==e.auto_accept&&1==e.auto_accept?"function"==typeof wps_rma_refund_auto_accept&&wps_rma_refund_auto_accept(r):window.setTimeout((function(){window.location.href=wrael_common_param.myaccount_url}),11e3)}})}})})),$(document).on("click",".wps_remove_notice_msg",(function(e){e.preventDefault(),$(".wps_order_msg_notice_wrapper").hide()})),$(document).on("click","#wps_order_msg_submit",(function(e){e.preventDefault();var r=$("#wps_order_msg_attachment"),_=$("#wps_order_new_msg").val(),a=$("#order_msg_type").val(),o="",t=$(this).data("id"),s=new FormData,n=wrael_common_param.order_msg_attachment;if(n&&"on"==n&&r[0]){var m=r[0].files.length;if(m)for(var p=0;p'+wrael_common_param.file_not_supported+'

    X'}else o='

    '+wrael_common_param.no_file_attached+'

    X'}if("admin"==a&&(o=""),""==_&&(o='

    '+wrael_common_param.message_empty+'

    X'),o)return $(".wps_order_msg_notice_wrapper").css("display","flex"),$(".wps_order_msg_notice_wrapper").css("background-color","red"),$(".wps_order_msg_notice_wrapper").html(o),$("#wps_order_msg_submit").css({"outline-color":"white","border-color":"white"}),!1;s.append("action","wps_rma_order_messages_save"),s.append("msg",_),s.append("order_msg_type",a),s.append("order_id",t),s.append("security_check",wrael_common_param.wps_rma_nonce),$.ajax({url:wrael_common_param.ajaxurl,type:"post",data:s,dataType:"json",contentType:!1,processData:!1,success:function(e){if(e){var r='

    '+wrael_common_param.message_sent+'

    X';$(".wps_order_msg_notice_wrapper").css("background-color","#64CD83"),$(".wps_order_msg_notice_wrapper").css("display","flex"),$("#wps_order_msg_submit").css({"outline-color":"none","border-color":"none"}),$(".wps_order_msg_sub_container").load(document.URL+" .wps-order-msg__row"),$("#wps_order_new_msg").val(""),$("#wps_order_msg_attachment").val(""),$(".wps_order_msg_notice_wrapper").html(r)}}})})),$(".wps_order_msg_reload_notice_wrapper").hide(),$(document).on("click",".wps_reload_messages",(function(e){e.preventDefault(),$(this).addClass("wps-loader-icon"),$(".wps_order_msg_sub_container").load(document.URL+" .wps-order-msg__row"),setTimeout((function(){$(".wps_reload_messages").removeClass("wps-loader-icon"),$(".wps_order_msg_reload_notice_wrapper").show(),$(".wps_order_msg_reload_notice_wrapper").css({"background-color":"rgb(100, 205, 131)","border-radius":"5px",color:"white","padding-left":"10px"})}),2e3),setTimeout((function(){$(".wps_order_msg_reload_notice_wrapper").hide()}),3e3)})),$(document).on("click",".wps_order_send_msg_dismiss",(function(e){e.preventDefault(),$(".wps_order_msg_notice_wrapper").hide()}))})); \ No newline at end of file diff --git a/common/partials/email_template/woo-refund-and-exchange-lite-refund-request-email.php b/common/partials/email_template/woo-refund-and-exchange-lite-refund-request-email.php index cdc9a4f..4f2185e 100755 --- a/common/partials/email_template/woo-refund-and-exchange-lite-refund-request-email.php +++ b/common/partials/email_template/woo-refund-and-exchange-lite-refund-request-email.php @@ -73,7 +73,7 @@ } $message .= '' . $item['name'] . '
    '; $message .= '' . $item_meta_html . ' - ' . $item['qty'] . ' + ' . $requested_product['qty'] . ' ' . wps_wrma_format_price( $requested_product['price'] * $requested_product['qty'], $get_order_currency ) . ' '; } diff --git a/emails/class-wps-rma-order-messages-email.php b/emails/class-wps-rma-order-messages-email.php index 278cc7a..154dc65 100755 --- a/emails/class-wps-rma-order-messages-email.php +++ b/emails/class-wps-rma-order-messages-email.php @@ -64,8 +64,8 @@ public function trigger( $msg, $attachment, $to, $order_id ) { $this->receicer = $to; $this->msg = $msg; $this->order_id = $order_id; - $this->placeholders['{message_date}'] = gmdate( 'M d, Y' ); - $this->placeholders['{order_id}'] = '#' . $order_id; + $this->placeholders['{message_date}'] = date_i18n( wc_date_format() ); + $this->placeholders['{order_id}'] = '#' . wps_rma_order_number( $order_id ); $this->send( $this->receicer, $this->get_subject(), $this->get_content(), $this->get_headers(), $attachment ); } $this->restore_locale(); diff --git a/emails/class-wps-rma-refund-request-accept-email.php b/emails/class-wps-rma-refund-request-accept-email.php index 3a0a92a..c6534f5 100755 --- a/emails/class-wps-rma-refund-request-accept-email.php +++ b/emails/class-wps-rma-refund-request-accept-email.php @@ -65,8 +65,8 @@ public function trigger( $msg, $attachment, $to, $order_id ) { $this->setup_locale(); $this->receicer = $to; $this->msg = $msg; - $this->placeholders['{message_date}'] = gmdate( 'M d, Y' ); - $this->placeholders['{order_id}'] = '#' . $order_id; + $this->placeholders['{message_date}'] = date_i18n( wc_date_format() ); + $this->placeholders['{order_id}'] = '#' . wps_rma_order_number( $order_id ); $placeholder = $this->placeholders; $this->placeholders = apply_filters( 'wps_rma_shortcode_extend', $placeholder, $order_id ); $this->send( $this->receicer, $this->get_subject(), $this->get_content(), $this->get_headers(), $attachment ); diff --git a/emails/class-wps-rma-refund-request-cancel-email.php b/emails/class-wps-rma-refund-request-cancel-email.php index fde43d7..ba073e1 100755 --- a/emails/class-wps-rma-refund-request-cancel-email.php +++ b/emails/class-wps-rma-refund-request-cancel-email.php @@ -63,8 +63,8 @@ public function trigger( $msg, $attachment, $to, $order_id ) { $this->setup_locale(); $this->receicer = $to; $this->msg = $msg; - $this->placeholders['{message_date}'] = gmdate( 'M d, Y' ); - $this->placeholders['{order_id}'] = '#' . $order_id; + $this->placeholders['{message_date}'] = date_i18n( wc_date_format() ); + $this->placeholders['{order_id}'] = '#' . wps_rma_order_number( $order_id ); $placeholder = $this->placeholders; $this->placeholders = apply_filters( 'wps_rma_shortcode_extend', $placeholder, $order_id ); $this->send( $this->receicer, $this->get_subject(), $this->get_content(), $this->get_headers(), $attachment ); diff --git a/emails/class-wps-rma-refund-request-email.php b/emails/class-wps-rma-refund-request-email.php index b5897ae..efd05d4 100755 --- a/emails/class-wps-rma-refund-request-email.php +++ b/emails/class-wps-rma-refund-request-email.php @@ -65,8 +65,8 @@ public function trigger( $msg, $attachment, $to, $order_id ) { $this->to = $to; $this->msg = $msg; $this->order_id = $order_id; - $this->placeholders['{message_date}'] = gmdate( 'M d, Y' ); - $this->placeholders['{order_id}'] = '#' . $order_id; + $this->placeholders['{message_date}'] = date_i18n( wc_date_format() ); + $this->placeholders['{order_id}'] = '#' . wps_rma_order_number( $order_id ); $placeholder = $this->placeholders; $this->placeholders = apply_filters( 'wps_rma_shortcode_extend', $placeholder, $order_id ); $this->send( $this->receicer, $this->get_subject(), $this->get_content(), $this->get_headers(), $attachment ); diff --git a/includes/woo-refund-and-exchange-lite-common-functions.php b/includes/woo-refund-and-exchange-lite-common-functions.php index e172d0d..9e1f415 100755 --- a/includes/woo-refund-and-exchange-lite-common-functions.php +++ b/includes/woo-refund-and-exchange-lite-common-functions.php @@ -30,8 +30,8 @@ function wps_rma_show_buttons( $func, $order ) { } } } - $order_date = date_i18n( 'F d Y', strtotime( $order->get_date_created() ) ); - $today_date = date_i18n( 'F d Y' ); + $order_date = date_i18n( wc_date_format(), strtotime( $order->get_date_created() ) ); + $today_date = date_i18n( wc_date_format() ); $order_date = apply_filters( 'wps_order_status_start_date', strtotime( $order_date ), $order ); $today_date = strtotime( $today_date ); $days = $today_date - $order_date; @@ -145,13 +145,11 @@ function wps_rma_lite_send_order_msg_callback( $order_id, $msg, $sender, $to ) { if ( ! file_exists( $directory ) ) { mkdir( $directory, 0755, true ); } - $sourcepath = sanitize_text_field( wp_unslash( $_FILES['wps_order_msg_attachment']['tmp_name'][ $i ] ) ); - $f_name = isset( $_FILES['wps_order_msg_attachment']['name'][ $i ] ) ? sanitize_text_field( wp_unslash( $_FILES['wps_order_msg_attachment']['name'][ $i ] ) ) : ''; - $targetpath = $directory . '/' . $order_id . '-' . $f_name; - $file_type = isset( $_FILES['wps_order_msg_attachment']['type'][ $i ] ) ? sanitize_text_field( wp_unslash( $_FILES['wps_order_msg_attachment']['type'][ $i ] ) ) : ''; - $file_type_flag = false; + $sourcepath = sanitize_text_field( wp_unslash( $_FILES['wps_order_msg_attachment']['tmp_name'][ $i ] ) ); + $f_name = isset( $_FILES['wps_order_msg_attachment']['name'][ $i ] ) ? sanitize_text_field( wp_unslash( $_FILES['wps_order_msg_attachment']['name'][ $i ] ) ) : ''; + $targetpath = $directory . '/' . $order_id . '-' . $f_name; + $file_type = isset( $_FILES['wps_order_msg_attachment']['type'][ $i ] ) ? sanitize_text_field( wp_unslash( $_FILES['wps_order_msg_attachment']['type'][ $i ] ) ) : ''; if ( 'image/png' === $file_type || 'image/jpeg' === $file_type || 'image/jpg' === $file_type ) { - $file_type_flag = true; $filename[ $i ] ['img'] = true; $filename[ $i ]['name'] = isset( $_FILES['wps_order_msg_attachment']['name'][ $i ] ) ? sanitize_text_field( wp_unslash( $_FILES['wps_order_msg_attachment']['name'][ $i ] ) ) : ''; $attachment[ $i ] = $targetpath; @@ -172,9 +170,7 @@ function wps_rma_lite_send_order_msg_callback( $order_id, $msg, $sender, $to ) { $get_msg = array(); array_push( $get_msg, $order_msg ); } - if ( $file_type_flag ) { - update_post_meta( $order_id, 'wps_cutomer_order_msg', $get_msg ); - } + update_post_meta( $order_id, 'wps_cutomer_order_msg', $get_msg ); $restrict_mail = // Allow/Disallow Email. apply_filters( 'wps_rma_restrict_order_msg_mails', false ); @@ -375,10 +371,14 @@ function wps_rma_return_req_approve_callback( $orderid, $products ) { } // Update the status. update_post_meta( $orderid, 'wps_rma_return_attachment', $request_files ); - $order_obj = wc_get_order( $orderid ); - $line_items_refund = array(); - $wps_rma_check_tax = get_option( $orderid . 'check_tax', false ); - $coupon_discount = get_option( 'wps_rma_refund_deduct_coupon', 'no' ); + $order_obj = wc_get_order( $orderid ); + $line_items_refund = array(); + $wps_rma_check_tax = get_option( $orderid . 'check_tax', false ); + $coupon_discount = get_option( 'wps_rma_refund_deduct_coupon', 'no' ); + $refund_items_details = get_post_meta( $orderid, 'wps_rma_refund_items_details', true ); + if ( ! is_array( $refund_items_details ) ) { + $refund_items_details = array(); + } // add refund item related info for wc_create_refund. if ( isset( $product_datas ) && ! empty( $product_datas ) ) { foreach ( $order_obj->get_items() as $item_id => $item ) { @@ -393,37 +393,36 @@ function wps_rma_return_req_approve_callback( $orderid, $products ) { $prod_price = $item->get_subtotal(); } if ( 'wps_rma_inlcude_tax' === $wps_rma_check_tax ) { - $item_tax = $item->get_subtotal_tax() / $item->get_quantity(); + $item_tax = $item->get_subtotal_tax() / $requested_product['qty']; $line_items_refund[ $item_id ]['refund_tax'] = array( 1 => $item_tax ); } elseif ( 'wps_rma_exclude_tax' === $wps_rma_check_tax ) { - $prod_price -= $item->get_subtotal_tax(); + $prod_price -= $item->get_subtotal_tax() / $requested_product['qty']; } $line_items_refund[ $item_id ]['qty'] = $requested_product['qty']; $line_items_refund[ $item_id ]['refund_total'] = wc_format_decimal( $prod_price * $requested_product['qty'] / $item->get_quantity() ); - // translators: %1$s: product name, %2$s: product qty. - $order_obj->add_order_note( sprintf( __( '%1$s %2$s Item Quantity has been reduce because of the return', 'woo-refund-and-exchange-lite' ), $product->get_name(), $requested_product['qty'] ), false, true ); + + if ( ! empty( $refund_items_details ) && isset( $refund_items_details[ $item_id ] ) ) { + $get_qty = $refund_items_details[ $item_id ]; + $refund_items_details[ $item_id ] = $get_qty + $requested_product['qty']; + } else { + $refund_items_details[ $item_id ] = $requested_product['qty']; + } } } } } } + update_post_meta( $orderid, 'wps_rma_refund_items_details', $refund_items_details ); if ( ! empty( $line_items_refund ) ) { - $refund = wc_create_refund( - array( - 'amount' => 0, - 'reason' => esc_html__( 'Added the return item info', 'woo-refund-and-exchange-lite' ), - 'order_id' => $orderid, - 'line_items' => $line_items_refund, - 'refund_payment' => false, - 'restock_items' => apply_filters( 'wps_rma_auto_restock_item_refund', false, $orderid ), - ) + $refund_items_details = array( + 'amount' => 0, + 'reason' => esc_html__( 'Added the return item info', 'woo-refund-and-exchange-lite' ), + 'order_id' => $orderid, + 'line_items' => $line_items_refund, + 'refund_payment' => false, + 'restock_items' => apply_filters( 'wps_rma_auto_restock_item_refund', false, $orderid ), ); - $wps_refund = get_post_meta( $orderid, 'wps_rma_refund_info', true ); - if ( empty( $wps_refund ) ) { - $wps_refund = array(); - } - $wps_refund[] = $refund->get_id(); - update_post_meta( $orderid, 'wps_rma_refund_info', $wps_refund ); + update_post_meta( $orderid, 'wps_rma_refund_items', $refund_items_details ); } $update_item_status = get_post_meta( $orderid, 'wps_rma_request_made', true ); @@ -574,248 +573,50 @@ function wps_rma_standard_check_multistep() { return $bool; } } -if ( ! function_exists( 'wps_rma_lite_migrate_settings' ) ) { +if ( ! function_exists( 'wps_rma_order_number' ) ) { /** - * Function to migrate the settings + * Check Pro Active. */ - function wps_rma_lite_migrate_settings() { - $enable_refund = get_option( 'mwb_wrma_return_enable', false ); - if ( 'yes' === $enable_refund ) { - update_option( 'wps_rma_refund_enable', 'on' ); - } - $attach_enable = get_option( 'mwb_wrma_return_attach_enable', false ); - if ( 'yes' === $attach_enable ) { - update_option( 'wps_rma_refund_attachment', 'on' ); - } - $attach_limit = get_option( 'mwb_wrma_refund_attachment_limit', false ); - if ( ! empty( $attach_limit ) && $attach_limit > 0 ) { - update_option( 'wps_rma_attachment_limit', $attach_limit ); - } - $manage_stock = get_option( 'mwb_wrma_return_request_manage_stock', false ); - if ( 'yes' === $manage_stock ) { - update_option( 'wps_rma_refund_manage_stock', 'on' ); - } - $show_pages = get_option( 'mwb_wrma_refund_button_view', false ); - if ( ! empty( $show_pages ) ) { - $button_hide = array(); - if ( ! in_array( 'order-page', $show_pages ) ) { - $button_hide[] = 'order-page'; - } - if ( ! in_array( 'My account', $show_pages ) ) { - $button_hide[] = 'My account'; - } - if ( ! in_array( 'thank-you-page', $show_pages ) ) { - $button_hide[] = 'Checkout'; - } - update_option( 'wps_rma_refund_button_pages', $button_hide ); - } - $refund_rule_enable = get_option( 'mwb_wrma_refund_rules_editor_enable', false ); - if ( 'yes' === $refund_rule_enable ) { - update_option( 'wps_rma_refund_rules', 'on' ); - } - $refund_editor = get_option( 'mwb_wrma_return_request_rules_editor', false ); - if ( ! empty( $refund_editor ) ) { - update_option( 'wps_rma_refund_rules_editor', $refund_editor ); - } - $refund_text = get_option( 'mwb_wrma_return_button_text', false ); - if ( ! empty( $refund_text ) ) { - update_option( 'wps_rma_refund_button_text', $refund_text ); - } - $refund_desc = get_option( 'mwb_wrma_return_request_description', false ); - if ( 'yes' === $refund_desc ) { - update_option( 'wps_rma_refund_description', 'on' ); - } - $refund_reason = get_option( 'ced_rnx_return_predefined_reason', false ); - $refund_reason1 = get_option( 'mwb_wrma_return_predefined_reason', false ); - if ( ! empty( $refund_reason1 ) ) { - $refund_reason = $refund_reason1; - } - if ( ! empty( $refund_reason ) ) { - $refund_reason = implode( ',', $refund_reason ); - update_option( 'wps_rma_refund_reasons', $refund_reason ); - } - $order_msg_enable = get_option( 'mwb_wrma_order_message_view', false ); - if ( 'yes' === $order_msg_enable ) { - update_option( 'wps_rma_general_om', 'on' ); - } - $order_attach = get_option( 'mwb_wrma_order_message_attachment', false ); - if ( 'yes' === $order_attach ) { - update_option( 'wps_rma_general_enable_om_attachment', 'on' ); - } - $order_text = get_option( 'mwb_wrma_order_msg_text', false ); - if ( ! empty( $order_text ) ) { - update_option( 'wps_rma_order_message_button_text', $order_text ); - } - - // RMA Policies Setting Save. - $tax_enable = get_option( 'mwb_wrma_return_tax_enable', false ); - $refund_order_status = get_option( 'mwb_wrma_return_order_status', false ); - $return_days = get_option( 'mwb_wrma_return_days', false ); - $refund_order_status = ! empty( $refund_order_status ) ? $refund_order_status : array(); - $set_policies_arr = array( - 'wps_rma_setting' => - array( - 0 => array( - 'row_policy' => 'wps_rma_maximum_days', - 'row_functionality' => 'refund', - 'row_conditions1' => 'wps_rma_less_than', - 'row_value' => $return_days, - 'incase_functionality' => 'incase', - ), - 1 => array( - 'row_functionality' => 'refund', - 'row_policy' => 'wps_rma_order_status', - 'row_conditions2' => 'wps_rma_equal_to', - 'row_statuses' => $refund_order_status, - 'incase_functionality' => 'incase', - ), - ), - ); - update_option( 'policies_setting_option', $set_policies_arr ); - - // Refund Request Subject And Content Updation. - $subject = get_option( 'ced_rnx_notification_return_subject', false ); - $subject1 = get_option( 'mwb_wrma_notification_return_subject', false ); - if ( ! empty( $subject1 ) ) { - $subject = $subject1; - } - if ( empty( $subject ) ) { - $subject = ''; - } - $content = get_option( 'ced_rnx_notification_return_rcv', false ); - $content1 = get_option( 'mwb_wrma_notification_return_rcv', false ); - if ( ! empty( $content1 ) ) { - $content = $content1; - } - if ( empty( $content ) ) { - $content = ''; - } - $content = str_replace( '[', '{', $content ); - $content = str_replace( ']', '}', $content ); - $refund_request_add = array( - 'enabled' => 'yes', - 'subject' => $subject, - 'heading' => '', - 'additional_content' => $content, - 'email_type' => 'html', - ); - update_option( 'woocommerce_wps_rma_refund_request_email_settings', $refund_request_add ); - - // Refund Request Accept Subject And Content Updation. - $subject = get_option( 'ced_rnx_notification_return_approve_subject', false ); - $subject1 = get_option( 'mwb_wrma_notification_return_approve_subject', false ); - if ( ! empty( $subject1 ) ) { - $subject = $subject1; - } - if ( empty( $subject ) ) { - $subject = ''; - } - $content = get_option( 'ced_rnx_notification_return_approve', false ); - $content1 = get_option( 'mwb_wrma_notification_return_approve', false ); - if ( ! empty( $content1 ) ) { - $content = $content1; - } - if ( empty( $content ) ) { - $content = ''; - } - $content = str_replace( '[', '{', $content ); - $content = str_replace( ']', '}', $content ); - $refund_request_accept_add = array( - 'enabled' => 'yes', - 'subject' => $subject, - 'heading' => '', - 'additional_content' => $content, - 'email_type' => 'html', - ); - update_option( 'woocommerce_wps_rma_refund_request_accept_email_settings', $refund_request_accept_add ); - - // Refund Request Cancel Subject And Content Updation. - - $subject = get_option( 'ced_rnx_notification_return_cancel_subject', false ); - $subject1 = get_option( 'mwb_wrma_notification_return_cancel_subject', false ); - if ( ! empty( $subject1 ) ) { - $subject = $subject1; - } - if ( empty( $subject ) ) { - $subject = ''; - } - $content = get_option( 'ced_rnx_notification_return_cancel', false ); - $content1 = get_option( 'mwb_wrma_notification_return_cancel', false ); - if ( ! empty( $content1 ) ) { - $content = $content1; - } - if ( empty( $content ) ) { - $content = ''; - } - $content = str_replace( '[', '{', $content ); - $content = str_replace( ']', '}', $content ); - $refund_request_cancel_add = array( - 'enabled' => 'yes', - 'subject' => $subject, - 'heading' => '', - 'additional_content' => $content, - 'email_type' => 'html', - ); - update_option( 'woocommerce_wps_rma_refund_request_cancel_email_settings', $refund_request_cancel_add ); - } -} -if ( ! function_exists( 'wps_rma_lite_post_meta_data_migrate' ) ) { - /** Post Meta Data Migrate */ - function wps_rma_lite_post_meta_data_migrate() { - $orders = get_posts( - array( - 'numberposts' => -1, + /** + * Return the correct order number + * + * @param int $order_id . + * @return $order_id + */ + function wps_rma_order_number( $order_id ) { + $active_plugins = get_option( 'active_plugins', array() ); + if ( in_array( 'woocommerce-sequential-order-numbers-pro/woocommerce-sequential-order-numbers-pro.php', $active_plugins, true ) ) { + $query_args = array( + 'numberposts' => 1, + 'meta_key' => '_order_number_formatted', + 'post_id' => $order_id, 'post_type' => 'shop_order', - 'fields' => 'ids', // return only ids. - 'order' => 'ASC', 'post_status' => 'any', - ) - ); - if ( ! empty( $orders ) ) { - foreach ( $orders as $order_id ) { - if ( ! empty( $order_id ) ) { - $get_messages = get_option( $order_id . '-mwb_cutomer_order_msg', array() ); - if ( ! empty( $get_messages ) ) { - update_post_meta( $order_id, 'wps_cutomer_order_msg', $get_messages ); - } - } + 'fields' => 'ids', + ); + + $posts = get_posts( $query_args ); + if ( is_array( $posts ) && ! empty( $posts ) && isset( $posts[0] ) ) { + $order_id = $posts[0]; + $order_id = get_post_meta( $order_id, '_order_number_formatted', true ); } } - $post_meta_keys = array( - 'ced_rnx_request_made', - 'ced_rnx_return_product', - 'ced_rnx_return_attachment', - 'mwb_wrma_return_product', - ); - foreach ( $post_meta_keys as $key => $meta_keys ) { - - $orders = get_posts( - array( - 'numberposts' => -1, - 'post_status' => 'publish', - 'fields' => 'ids', // return only ids. - 'meta_key' => $meta_keys, //phpcs:ignore - 'post_type' => 'shop_order', - 'order' => 'ASC', - 'post_status' => 'any', - ) + if ( in_array( 'wt-woocommerce-sequential-order-numbers/wt-advanced-order-number.php', $active_plugins, true ) ) { + $query_args = array( + 'numberposts' => 1, + 'meta_key' => '_order_number', + 'post_id' => $order_id, + 'post_type' => 'shop_order', + 'post_status' => 'any', + 'fields' => 'ids', ); - if ( ! empty( $orders ) ) { - foreach ( $orders as $order_id ) { - if ( ! empty( $order_id ) ) { - $value = get_post_meta( $order_id, $meta_keys, true ); - $new_key = str_replace( 'ced_rnx', 'wps_rma', $meta_keys ); - if ( 'mwb_wrma_return_product' === $meta_keys ) { - $new_key = 'wps_rma_return_product'; - $value = get_post_meta( $order_id, 'mwb_wrma_return_product', true ); - } - if ( ! empty( $value ) ) { - update_post_meta( $order_id, $new_key, $value ); - } - } - } + + $posts = get_posts( $query_args ); + if ( is_array( $posts ) && ! empty( $posts ) && isset( $posts[0] ) ) { + $order_id = $posts[0]; + $order_id = get_post_meta( $order_id, '_order_number', true ); } } + return $order_id; } } - diff --git a/languages/woo-refund-and-exchange-lite-en_US.mo b/languages/woo-refund-and-exchange-lite-en_US.mo index e7835a8..11e5d41 100644 Binary files a/languages/woo-refund-and-exchange-lite-en_US.mo and b/languages/woo-refund-and-exchange-lite-en_US.mo differ diff --git a/languages/woo-refund-and-exchange-lite-en_US.po b/languages/woo-refund-and-exchange-lite-en_US.po index 183ab92..4a9f8f1 100644 --- a/languages/woo-refund-and-exchange-lite-en_US.po +++ b/languages/woo-refund-and-exchange-lite-en_US.po @@ -1,17 +1,23 @@ msgid "" msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: 2022-07-05 13:57+0530\n" -"PO-Revision-Date: 2022-07-05 13:58+0530\n" -"Last-Translator: \n" -"Language-Team: \n" -"Language: en_US\n" +"Project-Id-Version: Return Refund and Exchange for WooCommerce 4.0.5\n" +"POT-Creation-Date: 2022-07-20 18:34+0530\n" +"PO-Revision-Date: 2022-07-20 18:35+0530\n" +"Language-Team: WP Swings\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.0.6\n" -"X-Poedit-Basepath: .\n" +"X-Poedit-Basepath: ..\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_n;_x;_ex;_nx;esc_attr__;esc_attr_e;esc_attr_x;" +"esc_html;esc_html__;esc_html_e;esc_html_x;_n_noop;_nx_noop;" +"translate_nooped_plural\n" +"Last-Translator: \n" +"Language: en_US\n" +"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: build\n" #: admin/class-woo-refund-and-exchange-lite-admin.php:156 msgid "Policy already exist" @@ -221,21 +227,21 @@ msgstr "" #: admin/partials/email_template/woo-refund-and-exchange-lite-refund-request-accept-email.php:38 #: common/partials/email_template/woo-refund-and-exchange-lite-refund-request-email.php:45 #: public/class-woo-refund-and-exchange-lite-public.php:227 -#: public/partials/wps-rma-refund-request-form.php:90 +#: public/partials/wps-rma-refund-request-form.php:87 msgid "Product" msgstr "" #: admin/partials/email_template/woo-refund-and-exchange-lite-refund-request-accept-email.php:39 #: admin/partials/woo-refund-and-exchange-lite-return-meta.php:47 #: common/partials/email_template/woo-refund-and-exchange-lite-refund-request-email.php:46 -#: public/partials/wps-rma-refund-request-form.php:91 +#: public/partials/wps-rma-refund-request-form.php:88 msgid "Quantity" msgstr "" #: admin/partials/email_template/woo-refund-and-exchange-lite-refund-request-accept-email.php:40 #: admin/partials/woo-refund-and-exchange-lite-return-meta.php:46 #: common/partials/email_template/woo-refund-and-exchange-lite-refund-request-email.php:47 -#: public/partials/wps-rma-refund-request-form.php:183 +#: public/partials/wps-rma-refund-request-form.php:187 msgid "Price" msgstr "" @@ -360,6 +366,7 @@ msgid "Write a message you want to send to the Customer." msgstr "" #: admin/partials/woo-refund-and-exchange-lite-order-message-meta.php:86 +#: public/partials/wps-rma-view-order-msg.php:47 msgid "Attach file" msgstr "" @@ -587,7 +594,7 @@ msgstr "" #: admin/partials/woo-refund-and-exchange-lite-return-meta.php:48 #: admin/partials/woo-refund-and-exchange-lite-return-meta.php:104 #: public/class-woo-refund-and-exchange-lite-public.php:228 -#: public/partials/wps-rma-refund-request-form.php:92 +#: public/partials/wps-rma-refund-request-form.php:89 msgid "Total" msgstr "" @@ -699,30 +706,38 @@ msgstr "" msgid "Please Enter a Message." msgstr "" -#: common/class-woo-refund-and-exchange-lite-common.php:206 +#: common/class-woo-refund-and-exchange-lite-common.php:91 +msgid "No File Attached" +msgstr "" + +#: common/class-woo-refund-and-exchange-lite-common.php:92 +msgid "Attached File type is not supported" +msgstr "" + +#: common/class-woo-refund-and-exchange-lite-common.php:210 #, php-format msgid "Refund Requested (%s)" msgstr "" -#: common/class-woo-refund-and-exchange-lite-common.php:217 +#: common/class-woo-refund-and-exchange-lite-common.php:221 #, php-format msgid "Refund Approved (%s)" msgstr "" -#: common/class-woo-refund-and-exchange-lite-common.php:228 +#: common/class-woo-refund-and-exchange-lite-common.php:232 #, php-format msgid "Refund Cancelled (%s)" msgstr "" -#: common/class-woo-refund-and-exchange-lite-common.php:247 +#: common/class-woo-refund-and-exchange-lite-common.php:251 msgid "Refund Requested" msgstr "" -#: common/class-woo-refund-and-exchange-lite-common.php:248 +#: common/class-woo-refund-and-exchange-lite-common.php:252 msgid "Refund Approved" msgstr "" -#: common/class-woo-refund-and-exchange-lite-common.php:249 +#: common/class-woo-refund-and-exchange-lite-common.php:253 msgid "Refund Cancelled" msgstr "" @@ -944,41 +959,36 @@ msgstr "" msgid "Refund request is already made and accepted" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:289 +#: includes/woo-refund-and-exchange-lite-common-functions.php:285 msgid "" "Your Giftcard has been expired so you can not proceed with the exchange. " "Thanks" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:296 +#: includes/woo-refund-and-exchange-lite-common-functions.php:292 msgid "" "Your Giftcard has been used so you can not proceed with the exchange. Thanks" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:335 +#: includes/woo-refund-and-exchange-lite-common-functions.php:331 msgid "User Request to refund product" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:339 +#: includes/woo-refund-and-exchange-lite-common-functions.php:335 msgid "" "Refund request placed successfully. You have received a notification mail " "regarding this. You will redirect to the My Account Page" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:404 -#, php-format -msgid "%1$s %2$s Item Quantity has been reduce because of the return" -msgstr "" - -#: includes/woo-refund-and-exchange-lite-common-functions.php:414 +#: includes/woo-refund-and-exchange-lite-common-functions.php:419 msgid "Added the return item info" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:448 +#: includes/woo-refund-and-exchange-lite-common-functions.php:447 msgid "User Request of Refund Product is approved" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:499 +#: includes/woo-refund-and-exchange-lite-common-functions.php:498 msgid "User Request of Refund Product is cancelled" msgstr "" @@ -1005,100 +1015,100 @@ msgstr "" msgid "Skip For Now" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:122 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:141 msgid "" "Return Request Already has been made and accepted for the items you have " "given" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:126 -msgid "Quantity given for items is greater than the order's items quantity" +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:145 +msgid "Quantity given for items is greater than the orders items quantity" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:130 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:149 msgid "These item id does not belong to the order" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:134 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:153 msgid "Please give the item ids which needs to be refunded" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:138 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:157 msgid "Please give the item qty which needs to be refunded" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:142 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:161 msgid "Products are given by you doesn't a valid json format" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:145 -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:148 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:164 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:167 msgid "Please Provide the data for the products" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:159 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:178 msgid "Refund Request Send Successfully" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:163 -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:222 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:182 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:242 msgid "Some problem occur while refund requesting" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:214 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:234 msgid "Return Request Already has been made and accepted" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:218 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:238 msgid "Return Request Send Successfully" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:231 -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:288 -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:339 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:251 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:308 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:359 msgid "Please Provide the order id to perform the process" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:234 -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:285 -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:336 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:254 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:305 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:356 msgid "Please Provide the correct order id to perform the process" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:237 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:257 msgid "Please Provide the reason for refund" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:271 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:291 msgid "Return Request Accepted Successfully" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:274 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:294 msgid "Some problem occur while refund request accepting" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:278 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:298 msgid "You have approved the refund request already" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:281 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:301 msgid "" "You can only accept the refund request when the request has been made earlier" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:322 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:342 msgid "Return Request Cancel Successfully" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:325 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:345 msgid "Some problem occur while refund request cancelling" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:329 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:349 msgid "You have cancelled the refund request already" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:332 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:352 msgid "" "You can only perform the refund request cancel when the request request has " "been made earlier" @@ -1140,71 +1150,72 @@ msgstr "" msgid "The above product Refund request is cancelled on" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:32 +#: public/partials/wps-rma-refund-request-form.php:27 msgid "Please give the correct order id" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:79 +#: public/partials/wps-rma-refund-request-form.php:76 msgid "Order's Product Refund Request Form" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:188 -#: public/partials/wps-rma-refund-request-form.php:224 -#: public/partials/wps-rma-refund-request-form.php:253 -msgid "(incl. tax)" -msgstr "" - #: public/partials/wps-rma-refund-request-form.php:192 #: public/partials/wps-rma-refund-request-form.php:228 #: public/partials/wps-rma-refund-request-form.php:257 +msgid "(incl. tax)" +msgstr "" + +#: public/partials/wps-rma-refund-request-form.php:196 +#: public/partials/wps-rma-refund-request-form.php:232 +#: public/partials/wps-rma-refund-request-form.php:261 msgid "(excl. tax)" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:247 +#: public/partials/wps-rma-refund-request-form.php:251 msgid "Total Refund Amount" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:281 +#: public/partials/wps-rma-refund-request-form.php:285 msgid "Please Enter the bank details for manual refund" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:291 -msgid "Subject of Refund Request :" +#: public/partials/wps-rma-refund-request-form.php:295 +msgid "Subject of Refund Request" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:307 +#: public/partials/wps-rma-refund-request-form.php:312 msgid "Other" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:311 +#: public/partials/wps-rma-refund-request-form.php:316 msgid "Write your refund reason" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:322 -msgid "Description for Refund Reason :" +#: public/partials/wps-rma-refund-request-form.php:327 +msgid "Description for Refund Reason" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:330 +#: public/partials/wps-rma-refund-request-form.php:336 msgid "Write your description for a refund" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:353 -msgid "Attach Files:" +#: public/partials/wps-rma-refund-request-form.php:359 +msgid "Attach Files" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:360 +#: public/partials/wps-rma-refund-request-form.php:367 msgid "Add More" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:361 -msgid "Only .png, .jpeg extension file is approved." +#: public/partials/wps-rma-refund-request-form.php:368 +#: public/partials/wps-rma-view-order-msg.php:50 +msgid "Only png,jpg,jpeg extension file is approved" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:369 +#: public/partials/wps-rma-refund-request-form.php:376 msgid "Submit Request" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:401 +#: public/partials/wps-rma-refund-request-form.php:408 msgid "Refund Request Can't make on this order" msgstr "" @@ -1212,10 +1223,6 @@ msgstr "" msgid "Write a message you want to send to the Shop Manager." msgstr "" -#: public/partials/wps-rma-view-order-msg.php:47 -msgid "Attach file: " -msgstr "" - #: public/partials/wps-rma-view-order-msg.php:92 msgid "Attachment :" msgstr "" @@ -1237,7 +1244,7 @@ msgstr "" msgid "Settings" msgstr "" -#: woocommerce-refund-and-exchange-lite.php:327 +#: woocommerce-refund-and-exchange-lite.php:245 msgid "" "Woocommerce is not activated, Please activate Woocommerce first to install " "WooCommerce Refund and Exchange Lite." diff --git a/languages/woo-refund-and-exchange-lite.pot b/languages/woo-refund-and-exchange-lite.pot index c74af4c..0004f4b 100644 --- a/languages/woo-refund-and-exchange-lite.pot +++ b/languages/woo-refund-and-exchange-lite.pot @@ -1,7 +1,8 @@ +#, fuzzy msgid "" msgstr "" -"Project-Id-Version: Return Refund and Exchange for WooCommerce 4.0.4\n" -"POT-Creation-Date: 2022-07-05 13:57+0530\n" +"Project-Id-Version: Return Refund and Exchange for WooCommerce 4.0.5\n" +"POT-Creation-Date: 2022-07-20 18:34+0530\n" "PO-Revision-Date: 2022-07-05 13:57+0530\n" "Last-Translator: \n" "Language-Team: WP Swings\n" @@ -17,6 +18,7 @@ msgstr "" "esc_html;esc_html__;esc_html_e;esc_html_x;_n_noop;_nx_noop;" "translate_nooped_plural\n" "X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPathExcluded-0: build\n" #: admin/class-woo-refund-and-exchange-lite-admin.php:156 msgid "Policy already exist" @@ -226,21 +228,21 @@ msgstr "" #: admin/partials/email_template/woo-refund-and-exchange-lite-refund-request-accept-email.php:38 #: common/partials/email_template/woo-refund-and-exchange-lite-refund-request-email.php:45 #: public/class-woo-refund-and-exchange-lite-public.php:227 -#: public/partials/wps-rma-refund-request-form.php:90 +#: public/partials/wps-rma-refund-request-form.php:87 msgid "Product" msgstr "" #: admin/partials/email_template/woo-refund-and-exchange-lite-refund-request-accept-email.php:39 #: admin/partials/woo-refund-and-exchange-lite-return-meta.php:47 #: common/partials/email_template/woo-refund-and-exchange-lite-refund-request-email.php:46 -#: public/partials/wps-rma-refund-request-form.php:91 +#: public/partials/wps-rma-refund-request-form.php:88 msgid "Quantity" msgstr "" #: admin/partials/email_template/woo-refund-and-exchange-lite-refund-request-accept-email.php:40 #: admin/partials/woo-refund-and-exchange-lite-return-meta.php:46 #: common/partials/email_template/woo-refund-and-exchange-lite-refund-request-email.php:47 -#: public/partials/wps-rma-refund-request-form.php:183 +#: public/partials/wps-rma-refund-request-form.php:187 msgid "Price" msgstr "" @@ -365,6 +367,7 @@ msgid "Write a message you want to send to the Customer." msgstr "" #: admin/partials/woo-refund-and-exchange-lite-order-message-meta.php:86 +#: public/partials/wps-rma-view-order-msg.php:47 msgid "Attach file" msgstr "" @@ -592,7 +595,7 @@ msgstr "" #: admin/partials/woo-refund-and-exchange-lite-return-meta.php:48 #: admin/partials/woo-refund-and-exchange-lite-return-meta.php:104 #: public/class-woo-refund-and-exchange-lite-public.php:228 -#: public/partials/wps-rma-refund-request-form.php:92 +#: public/partials/wps-rma-refund-request-form.php:89 msgid "Total" msgstr "" @@ -704,30 +707,38 @@ msgstr "" msgid "Please Enter a Message." msgstr "" -#: common/class-woo-refund-and-exchange-lite-common.php:206 +#: common/class-woo-refund-and-exchange-lite-common.php:91 +msgid "No File Attached" +msgstr "" + +#: common/class-woo-refund-and-exchange-lite-common.php:92 +msgid "Attached File type is not supported" +msgstr "" + +#: common/class-woo-refund-and-exchange-lite-common.php:210 #, php-format msgid "Refund Requested (%s)" msgstr "" -#: common/class-woo-refund-and-exchange-lite-common.php:217 +#: common/class-woo-refund-and-exchange-lite-common.php:221 #, php-format msgid "Refund Approved (%s)" msgstr "" -#: common/class-woo-refund-and-exchange-lite-common.php:228 +#: common/class-woo-refund-and-exchange-lite-common.php:232 #, php-format msgid "Refund Cancelled (%s)" msgstr "" -#: common/class-woo-refund-and-exchange-lite-common.php:247 +#: common/class-woo-refund-and-exchange-lite-common.php:251 msgid "Refund Requested" msgstr "" -#: common/class-woo-refund-and-exchange-lite-common.php:248 +#: common/class-woo-refund-and-exchange-lite-common.php:252 msgid "Refund Approved" msgstr "" -#: common/class-woo-refund-and-exchange-lite-common.php:249 +#: common/class-woo-refund-and-exchange-lite-common.php:253 msgid "Refund Cancelled" msgstr "" @@ -949,41 +960,36 @@ msgstr "" msgid "Refund request is already made and accepted" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:289 +#: includes/woo-refund-and-exchange-lite-common-functions.php:285 msgid "" "Your Giftcard has been expired so you can not proceed with the exchange. " "Thanks" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:296 +#: includes/woo-refund-and-exchange-lite-common-functions.php:292 msgid "" "Your Giftcard has been used so you can not proceed with the exchange. Thanks" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:335 +#: includes/woo-refund-and-exchange-lite-common-functions.php:331 msgid "User Request to refund product" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:339 +#: includes/woo-refund-and-exchange-lite-common-functions.php:335 msgid "" "Refund request placed successfully. You have received a notification mail " "regarding this. You will redirect to the My Account Page" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:404 -#, php-format -msgid "%1$s %2$s Item Quantity has been reduce because of the return" -msgstr "" - -#: includes/woo-refund-and-exchange-lite-common-functions.php:414 +#: includes/woo-refund-and-exchange-lite-common-functions.php:419 msgid "Added the return item info" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:448 +#: includes/woo-refund-and-exchange-lite-common-functions.php:447 msgid "User Request of Refund Product is approved" msgstr "" -#: includes/woo-refund-and-exchange-lite-common-functions.php:499 +#: includes/woo-refund-and-exchange-lite-common-functions.php:498 msgid "User Request of Refund Product is cancelled" msgstr "" @@ -1010,100 +1016,100 @@ msgstr "" msgid "Skip For Now" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:122 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:141 msgid "" "Return Request Already has been made and accepted for the items you have " "given" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:126 -msgid "Quantity given for items is greater than the order's items quantity" +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:145 +msgid "Quantity given for items is greater than the orders items quantity" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:130 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:149 msgid "These item id does not belong to the order" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:134 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:153 msgid "Please give the item ids which needs to be refunded" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:138 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:157 msgid "Please give the item qty which needs to be refunded" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:142 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:161 msgid "Products are given by you doesn't a valid json format" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:145 -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:148 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:164 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:167 msgid "Please Provide the data for the products" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:159 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:178 msgid "Refund Request Send Successfully" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:163 -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:222 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:182 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:242 msgid "Some problem occur while refund requesting" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:214 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:234 msgid "Return Request Already has been made and accepted" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:218 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:238 msgid "Return Request Send Successfully" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:231 -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:288 -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:339 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:251 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:308 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:359 msgid "Please Provide the order id to perform the process" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:234 -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:285 -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:336 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:254 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:305 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:356 msgid "Please Provide the correct order id to perform the process" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:237 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:257 msgid "Please Provide the reason for refund" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:271 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:291 msgid "Return Request Accepted Successfully" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:274 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:294 msgid "Some problem occur while refund request accepting" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:278 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:298 msgid "You have approved the refund request already" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:281 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:301 msgid "" "You can only accept the refund request when the request has been made earlier" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:322 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:342 msgid "Return Request Cancel Successfully" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:325 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:345 msgid "Some problem occur while refund request cancelling" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:329 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:349 msgid "You have cancelled the refund request already" msgstr "" -#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:332 +#: package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php:352 msgid "" "You can only perform the refund request cancel when the request request has " "been made earlier" @@ -1145,71 +1151,72 @@ msgstr "" msgid "The above product Refund request is cancelled on" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:32 +#: public/partials/wps-rma-refund-request-form.php:27 msgid "Please give the correct order id" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:79 +#: public/partials/wps-rma-refund-request-form.php:76 msgid "Order's Product Refund Request Form" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:188 -#: public/partials/wps-rma-refund-request-form.php:224 -#: public/partials/wps-rma-refund-request-form.php:253 -msgid "(incl. tax)" -msgstr "" - #: public/partials/wps-rma-refund-request-form.php:192 #: public/partials/wps-rma-refund-request-form.php:228 #: public/partials/wps-rma-refund-request-form.php:257 +msgid "(incl. tax)" +msgstr "" + +#: public/partials/wps-rma-refund-request-form.php:196 +#: public/partials/wps-rma-refund-request-form.php:232 +#: public/partials/wps-rma-refund-request-form.php:261 msgid "(excl. tax)" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:247 +#: public/partials/wps-rma-refund-request-form.php:251 msgid "Total Refund Amount" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:281 +#: public/partials/wps-rma-refund-request-form.php:285 msgid "Please Enter the bank details for manual refund" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:291 -msgid "Subject of Refund Request :" +#: public/partials/wps-rma-refund-request-form.php:295 +msgid "Subject of Refund Request" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:307 +#: public/partials/wps-rma-refund-request-form.php:312 msgid "Other" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:311 +#: public/partials/wps-rma-refund-request-form.php:316 msgid "Write your refund reason" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:322 -msgid "Description for Refund Reason :" +#: public/partials/wps-rma-refund-request-form.php:327 +msgid "Description for Refund Reason" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:330 +#: public/partials/wps-rma-refund-request-form.php:336 msgid "Write your description for a refund" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:353 -msgid "Attach Files:" +#: public/partials/wps-rma-refund-request-form.php:359 +msgid "Attach Files" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:360 +#: public/partials/wps-rma-refund-request-form.php:367 msgid "Add More" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:361 -msgid "Only .png, .jpeg extension file is approved." +#: public/partials/wps-rma-refund-request-form.php:368 +#: public/partials/wps-rma-view-order-msg.php:50 +msgid "Only png,jpg,jpeg extension file is approved" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:369 +#: public/partials/wps-rma-refund-request-form.php:376 msgid "Submit Request" msgstr "" -#: public/partials/wps-rma-refund-request-form.php:401 +#: public/partials/wps-rma-refund-request-form.php:408 msgid "Refund Request Can't make on this order" msgstr "" @@ -1217,10 +1224,6 @@ msgstr "" msgid "Write a message you want to send to the Shop Manager." msgstr "" -#: public/partials/wps-rma-view-order-msg.php:47 -msgid "Attach file: " -msgstr "" - #: public/partials/wps-rma-view-order-msg.php:92 msgid "Attachment :" msgstr "" @@ -1242,7 +1245,7 @@ msgstr "" msgid "Settings" msgstr "" -#: woocommerce-refund-and-exchange-lite.php:327 +#: woocommerce-refund-and-exchange-lite.php:245 msgid "" "Woocommerce is not activated, Please activate Woocommerce first to install " "WooCommerce Refund and Exchange Lite." diff --git a/package-lock.json b/package-lock.json index 0829426..cda4294 100755 --- a/package-lock.json +++ b/package-lock.json @@ -3163,6 +3163,14 @@ "webpack-cli": "^3.3.11", "webpack-livereload-plugin": "^2.3.0", "webpack-sources": "^2.2.0" + }, + "dependencies": { + "prettier": { + "version": "npm:wp-prettier@2.2.1-beta-1", + "resolved": "https://registry.npmjs.org/wp-prettier/-/wp-prettier-2.2.1-beta-1.tgz", + "integrity": "sha512-+JHkqs9LC/JPp51yy1hzs3lQ7qeuWCwOcSzpQNeeY/G7oSpnF61vxt7hRh87zNRTr6ob2ndy0W8rVzhgrcA+Gw==", + "dev": true + } } }, "@wordpress/stylelint-config": { @@ -15698,12 +15706,6 @@ "dev": true, "optional": true }, - "prettier": { - "version": "npm:wp-prettier@2.2.1-beta-1", - "resolved": "https://registry.npmjs.org/wp-prettier/-/wp-prettier-2.2.1-beta-1.tgz", - "integrity": "sha512-+JHkqs9LC/JPp51yy1hzs3lQ7qeuWCwOcSzpQNeeY/G7oSpnF61vxt7hRh87zNRTr6ob2ndy0W8rVzhgrcA+Gw==", - "dev": true - }, "prettier-linter-helpers": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", diff --git a/package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php b/package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php index 3f8e438..3e1474a 100755 --- a/package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php +++ b/package/rest-api/version1/class-woo-refund-and-exchange-lite-api-process.php @@ -55,24 +55,37 @@ public function wps_rma_refund_request_process( $wrael_request ) { $check_refund = wps_rma_show_buttons( 'refund', $order_obj ); if ( 'yes' === $check_refund ) { if ( wps_rma_pro_active() && ! empty( $products ) ) { - $products1 = array(); - $array_merge = array(); - $ref_price = 0; - $flag = true; - $qty_flag = true; - $item_flag = true; - $invalid_item = true; - $invalid_qty = true; - $item_detail = array(); + $products1 = array(); + $refund_items = array(); + $refund_amount = 0; + $flag = true; + $qty_flag = true; + $item_flag = true; + $invalid_item = true; + $invalid_qty = true; + $item_detail = array(); foreach ( $order_obj->get_items() as $item_id => $item ) { - $item_detail[ $item_id ] = $item->get_quantity(); + $product = $item->get_product(); + if ( 'variation' === $product->get_type() ) { + $variation_id = $item->get_variation_id(); + $item_detail[ $variation_id ] = $item->get_quantity(); + } else { + $product_id = $item->get_product_id(); + $item_detail[ $product_id ] = $item->get_quantity(); + } } $json_validate = wps_json_validate( $products ); if ( $json_validate ) { foreach ( $order_obj->get_items() as $item_id => $item ) { foreach ( json_decode( $products ) as $key => $value ) { - if ( isset( $value->item_id ) && isset( $value->qty ) && array_key_exists( $value->item_id, $item_detail ) ) { - if ( $value->item_id === $item_id ) { + if ( ( isset( $value->product_id ) && array_key_exists( $value->product_id, $item_detail ) ) || ( isset( $value->variation_id ) && array_key_exists( $value->variation_id, $item_detail ) ) && isset( $value->qty ) ) { + $product = $item->get_product(); + if ( 'variation' === $product->get_type() ) { + $variation_id = $item->get_variation_id(); + } else { + $product_id = $item->get_product_id(); + } + if ( ( isset( $value->product_id ) && $product_id == $value->product_id ) || ( isset( $value->variation_id ) && $variation_id == $value->variation_id ) ) { $item_refund_already = get_post_meta( $order_id, 'wps_rma_request_made', true ); if ( ! empty( $item_refund_already ) && isset( $item_refund_already[ $item_id ] ) && 'completed' === $item_refund_already[ $item_id ] ) { $flag = false; @@ -81,7 +94,8 @@ public function wps_rma_refund_request_process( $wrael_request ) { } else { $item_arr = array(); $item_arr['product_id'] = $item->get_product_id(); - if ( $item->is_type( 'variable' ) ) { + $product = $item->get_product(); + if ( 'variation' === $product->get_type() ) { $variation_id = $item->get_variation_id(); } else { $variation_id = 0; @@ -89,23 +103,28 @@ public function wps_rma_refund_request_process( $wrael_request ) { $item_arr['item_id'] = $item_id; $item_arr['variation_id'] = $variation_id; $item_arr['qty'] = $value->qty; - $wps_rma_check_tax = get_option( $order_id . 'check_tax', false ); - $tax = $item->get_total_tax(); + $wps_rma_check_tax = get_option( $order_id . 'check_tax', false ); + $tax_price = $item->get_total_tax() / $item->get_quantity(); + $item_price = $item->get_total() / $item->get_quantity(); if ( empty( $wps_rma_check_tax ) ) { - $item_arr['price'] = $item->get_total(); - $ref_price += $item->get_total(); + $item_arr['price'] = $item_price; + $refund_amount += $item_price; } elseif ( 'wps_rma_inlcude_tax' === $wps_rma_check_tax ) { - $item_arr['price'] = $item->get_total() + $tax; - $ref_price += $item->get_total() + $tax; + $item_arr['price'] = $item_price + $tax_price; + $refund_amount += $item_price + $tax_price; } elseif ( 'wps_rma_exclude_tax' === $wps_rma_check_tax ) { - $item_arr['price'] = $item->get_total() - $tax; - $ref_price += $item->get_total() - $tax; + $item_arr['price'] = $item_price - $tax_price; + $refund_amount += $item_price - $tax_price; } - $array_merge[] = $item_arr; + $refund_items[] = $item_arr; } } } else { - if ( ! isset( $value->item_id ) ) { + $item_flag = true; + if ( isset( $value->product_id ) || isset( $value->variation_id ) ) { + $item_flag = false; + } + if ( $item_flag ) { $invalid_item = false; } elseif ( ! isset( $value->qty ) ) { $invalid_qty = false; @@ -123,7 +142,7 @@ public function wps_rma_refund_request_process( $wrael_request ) { } elseif ( ! $qty_flag ) { $wps_rma_rest_response['message'] = 'error'; $wps_rma_rest_response['status'] = 404; - $wps_rma_rest_response['data'] = esc_html__( 'Quantity given for items is greater than the order\'s items quantity', 'woo-refund-and-exchange-lite' ); + $wps_rma_rest_response['data'] = esc_html__( 'Quantity given for items is greater than the orders items quantity', 'woo-refund-and-exchange-lite' ); } elseif ( ! $item_flag ) { $wps_rma_rest_response['message'] = 'error'; $wps_rma_rest_response['status'] = 404; @@ -147,11 +166,11 @@ public function wps_rma_refund_request_process( $wrael_request ) { $wps_rma_rest_response['status'] = 404; $wps_rma_rest_response['data'] = esc_html__( 'Please Provide the data for the products', 'woo-refund-and-exchange-lite' ); } else { - $products1['products'] = $array_merge; + $products1['products'] = $refund_items; $products1['order_id'] = $order_id; $products1['subject'] = $reason; $products1['refund_method'] = $refund_method; - $products1['amount'] = $ref_price; + $products1['amount'] = $refund_amount; $wps_rma_resultsdata = wps_rma_save_return_request_callback( $order_id, $refund_method, $products1 ); if ( ! empty( $wps_rma_resultsdata ) ) { $wps_rma_rest_response['message'] = 'success'; @@ -164,9 +183,9 @@ public function wps_rma_refund_request_process( $wrael_request ) { } } } else { - $products1 = array(); - $array_merge = array(); - $ref_price = 0; + $products1 = array(); + $refund_items = array(); + $refund_amound = 0; if ( ! empty( $order_obj ) ) { foreach ( $order_obj->get_items() as $item_id => $item ) { $item_arr = array(); @@ -179,24 +198,25 @@ public function wps_rma_refund_request_process( $wrael_request ) { $item_arr['item_id'] = $item_id; $item_arr['variation_id'] = $variation_id; $item_arr['qty'] = $item->get_quantity(); - $tax = $item->get_total_tax(); + $item_tax = $item->get_total_tax() / $item->get_quantity(); + $item_price = $item->get_total() / $item->get_quantity(); if ( empty( $wps_rma_check_tax ) ) { - $item_arr['price'] = $item->get_total(); - $ref_price += $item->get_total(); + $item_arr['price'] = $item_price; + $refund_amound += $item_price; } elseif ( 'wps_rma_inlcude_tax' === $wps_rma_check_tax ) { - $item_arr['price'] = $item->get_total() + $tax; - $ref_price += $item->get_total() + $tax; + $item_arr['price'] = $item_price + $item_tax; + $refund_amound += $item_price + $item_tax; } elseif ( 'wps_rma_exclude_tax' === $wps_rma_check_tax ) { - $item_arr['price'] = $item->get_total() - $tax; - $ref_price += $item->get_total() - $tax; + $item_arr['price'] = $item_price - $item_tax; + $refund_amound += $item_price - $item_tax; } - $array_merge[] = $item_arr; + $refund_items[] = $item_arr; } - $products1['products'] = $array_merge; + $products1['products'] = $refund_items; $products1['order_id'] = $order_id; $products1['subject'] = $reason; $products1['refund_method'] = 'manual_method'; - $products1['amount'] = $ref_price; + $products1['amount'] = $refund_amound; } $wps_rma_resultsdata = wps_rma_save_return_request_callback( $order_id, 'manual_method', $products1 ); $flag_refund_made = false; diff --git a/public/css/woo-refund-and-exchange-lite-public.css b/public/css/woo-refund-and-exchange-lite-public.css index 7ce46b3..a89fdfa 100755 --- a/public/css/woo-refund-and-exchange-lite-public.css +++ b/public/css/woo-refund-and-exchange-lite-public.css @@ -75,7 +75,7 @@ .wps-rma-form__wrapper label { margin-bottom: 8px; - display: inline-block; + display: inline-block !important; line-height: 1.2; } @@ -503,6 +503,10 @@ div.wps_order_msg_single_attachment a .wps_order_msg_attachment_thumbnail { overflow: hidden; } +.wps_field_mendatory { + color: red; +} + @media only screen and (max-width: 820px) { .wps-order-msg__row { max-width: 100%; diff --git a/public/css/woo-refund-and-exchange-lite-public.min.css b/public/css/woo-refund-and-exchange-lite-public.min.css index 6e65ddb..c352c67 100755 --- a/public/css/woo-refund-and-exchange-lite-public.min.css +++ b/public/css/woo-refund-and-exchange-lite-public.min.css @@ -1 +1 @@ -*,:after,:before{box-sizing:border-box}.wps_order_msg_history_container .wps_reload_messages .reload-icon{margin-left:10px;width:25px}.wps_order_msg_sub_container{border:1px solid #ccc;max-height:400px;min-height:200px;overflow-y:auto;padding:30px}*,:after,:before{box-sizing:border-box}.wps-rma-form__wrapper .input-text,.wps-rma-form__wrapper input[type=email],.wps-rma-form__wrapper input[type=number],.wps-rma-form__wrapper input[type=password],.wps-rma-form__wrapper input[type=search],.wps-rma-form__wrapper input[type=tel],.wps-rma-form__wrapper input[type=text],.wps-rma-form__wrapper input[type=url],.wps-rma-form__wrapper textarea{background-color:transparent!important;border:1px solid #ccc!important;box-shadow:none!important;padding:10px 14px}.input-text:focus,.wps-rma-form__wrapper a:focus,.wps-rma-form__wrapper input[type=email]:focus,.wps-rma-form__wrapper input[type=number]:focus,.wps-rma-form__wrapper input[type=search]:focus,.wps-rma-form__wrapper input[type=tel]:focus,.wps-rma-form__wrapper input[type=text]:focus,.wps-rma-form__wrapper input[type=url]:focus,.wps-rma-form__wrapper textarea:focus,.wps_order_msg_sub_container input[type=password]:focus{outline:none!important}.wps-rma-form__wrapper label{display:inline-block;line-height:1.2;margin-bottom:8px}.wps-rma-form__wrapper h4{font-size:18px!important}.wps-rma-form__wrapper .wps_rma_flex{display:flex;flex-wrap:wrap}.wps-rma-form__wrapper select{padding:10px 14px}.wps_rma_refund_form_wrapper .input-text:focus,.wps_rma_refund_form_wrapper input[type=email]:focus,.wps_rma_refund_form_wrapper input[type=number]:focus,.wps_rma_refund_form_wrapper input[type=password]:focus,.wps_rma_refund_form_wrapper input[type=search]:focus,.wps_rma_refund_form_wrapper input[type=tel]:focus,.wps_rma_refund_form_wrapper input[type=text]:focus,.wps_rma_refund_form_wrapper input[type=url]:focus,.wps_rma_refund_form_wrapper textarea:focus{background-color:transparent}.wps_rma_refund_form_wrapper .wps-rma-subject__dropdown select{border-radius:0;padding:5px 105px 5px 5px;width:100%}.wps_rma_refund_form_wrapper .wps_rma_other_subject input{width:100%}.wps-rma-product__table{border-collapse:collapse;min-width:665px;width:100%}.wps-rma-form__wrapper h2.woocommerce-column__title{font-weight:600}.wps_rma_refund_form_wrapper select#wps_rma_return_request_subject:focus-visible{outline:none}.wps_rma_refund_form_wrapper select#wps_rma_return_request_subject option{box-shadow:none}.wps-rma-product__table-wrapper{overflow-x:auto;padding:0 15px}.wps_rma_refund_form_wrapper .wps_rma_product_title{padding:0 15px}.wps_rma_refund_form_wrapper .wps_rma_refund_request__row{justify-content:space-between}.wps_rma_refund_form_wrapper .wps_rma__column{width:100%}.wps-rma-form__wrapper.wps-rma-form__wrapper{border:1px solid #333}.wps-rma-form__wrapper .wps-rma-form__header{background-color:#333}.wps-rma-form__wrapper .wps-rma-form__heading{color:#fff;font-size:24px;font-weight:500;margin-top:0;padding:10px 15px}.wps-rma-form__wrapper td,.wps-rma-form__wrapper th{border:1px solid #ccc;padding:15px;text-align:center;vertical-align:middle}.wps-rma-form__wrapper th{color:#333}.wps-rma-form__wrapper .wps-rma-product__wrap{align-items:center;display:flex;justify-content:center}.wps-rma-form__wrapper .wps-rma__product-title{margin-left:20px;text-align:left}.wps-rma-product__table tbody td,table.wps-rma-product__table:not(.has-background) fieldset,table.wps-rma-product__table:not(.has-background) fieldset legend,table.wps-rma-product__table:not(.has-background) tbody td,table.wps-rma-product__table:not(.has-background) tbody tr:nth-child(2n) td{background-color:#fff}.wps-rma-form__wrapper .wps-rma-row__pd{padding:0 15px}.wps-rma-form__wrapper .wps-rma-col{width:100%}.wps-rma-form__wrapper .wps-rma-col.wps_rma_flex{justify-content:flex-start}.wps-rma-form__wrapper .wps_rma_other_subject{margin:25px 0}.wps_rma_attach_files{margin-top:10px}.wps-rma-subject__dropdown{margin-top:25px}.wps-rma-form__wrapper textarea{width:100%}.wps-rma-form__wrapper .product-quantity input{height:48px;margin:0 auto;width:197px}.wps-rma-form__wrapper td:last-child,.wps-rma-form__wrapper th:last-child{padding-right:15px}.wps-rma-form__wrapper td.product-total{text-align:center}.wps-order-msg-attachment-wrapper{align-items:center;justify-content:space-between;margin-top:20px}.wps-order-attachment input#wps_order_msg_attachment{max-width:230px}#wps_order_msg_submit{background:#374585;border:1px solid #374585;border-radius:3px;color:#fff;cursor:pointer;font-size:16px;margin:0;padding:6px 30px;text-decoration:none}form#wps_order_new_msg_form{margin-bottom:40px}.wps_rma_order_msg_wrapper .wps-order-msg-attachment-wrapper label{color:#000}.wps_rma_order_msg_wrapper h4.wps-order-heading.wps_rma_flex{align-items:center}.wps_rma_order_msg_wrapper h4.wps-order-heading.wps_rma_flex a{margin-left:20px;width:18px}.wps-order-msg__row{word-wrap:break-word;background-color:#fff;border:1px solid #ddd;margin-bottom:30px;padding:30px 30px 30px 0;width:auto}.wps_order_msg_sender{background-color:#4f62b9;color:#fff;display:inline-block;font-size:18px;font-weight:600;line-height:1.8;padding:8px 52px 8px 30px;position:relative}span.wps_order_msg_sender:after{background-color:transparent;border-left:24px solid transparent;border-right:24px solid transparent;border-top:24px solid #fff;content:"";height:100%;position:absolute;right:0;top:0;transform:rotate(90deg);width:0}.wps_order_msg_date{color:#1f1f1f;display:block;margin-top:10px;padding-left:30px}.wps_order_msg_attach_container{padding-left:30px}.wps_order_msg_detail_container{padding:20px 0 20px 30px}img.wps_order_msg_attachment_thumbnail{padding-bottom:8px;padding-top:8px}.wps_rma_order_msg_wrapper h4{background-color:#dadada;color:#1f1f1f!important;font-weight:600!important;line-height:1.6;padding:7px 15px}.wps-order-attachment input:focus{outline:none}.wps-order-msg__row{border-color:#ddd}.wps-order-msg__row:last-child{margin-bottom:0}.wps_order_msg_notice_wrapper,.wps_order_msg_sender_details.wps_rma_flex{align-items:center;justify-content:space-between}.wps_order_msg_notice_wrapper{border-radius:5px;color:#fff;display:none;flex-wrap:wrap;font-weight:600;margin-bottom:20px;padding:5px 15px}.wps_order_msg_notice_wrapper p{color:#fff;margin-bottom:0}a.wps_order_send_msg_dismiss{color:#fff;font-size:16px;font-weight:700}.wps_order_msg_sent_notice{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.wps-loader-icon{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;transition:all .3s;transition-timing-function:ease-in}.wps_order_msg_sub_container{display:flex;flex-wrap:wrap}.wps-order-msg__row{width:100%}.wmb-order-admin__msg-container .wps_order_msg_sender{background-color:#71b02f}.wps_rma_order_msg_wrapper textarea{width:100%}div.wps_order_msg_single_attachment a .wps_order_msg_attachment_thumbnail{border:1px solid #000;border-radius:3px;display:table;margin-left:auto;margin-left:0!important;margin-right:auto;margin-right:0!important;max-width:60px;padding:5px}.wps_rma_return_notification>img{left:48%;position:absolute;top:45%;width:5%}.wps_rma_exchange_notification,.wps_rma_return_notification{color:green;display:none}.wps_rma_exchange_notification>img,.wps_rma_return_notification>img{left:48%;position:absolute;top:45%;width:5%}.wps_rma_exchange_notification,.wps_rma_return_notification{background-color:#000;bottom:0;height:100%;opacity:.5;padding:0;position:fixed;right:0;width:100%;z-index:99999}.wps_rma_return_notification_checkbox:after{background:hsla(0,0%,100%,.6) none repeat scroll 0 0;bottom:0;content:"";height:100%;left:0;position:absolute;right:0;top:0;width:100%}.wps_rma_return_notification_checkbox img{left:0;margin:0 auto;position:absolute;right:0;text-align:center;top:50%;transform:translateY(-50%);z-index:99999999}.wps_rma_return_notification_checkbox{display:none}.return,.view_msg{margin-top:4px}.wps_rma_refund_request__row{padding:0 15px}.wps_rma_customer_detail{overflow:hidden;padding:30px 15px}@media only screen and (max-width:820px){.wps-order-msg__row{max-width:100%}.wps-order-msg__row:nth-child(2n),.wps-order-msg__row:nth-child(2n-1){margin-right:0}}@media only screen and (min-width:600px){.wps-rma-refund-request__row{display:flex;flex-wrap:nowrap}.wps-rma-form__wrapper .wps-rma-col:nth-child(2){padding-left:30px;width:60%}.wps_rma_refund_form_wrapper .wps_rma__column-right{justify-content:flex-end;margin-left:40px;max-width:calc(40% - 40px)}.wps-rma-form__wrapper .wps-rma-col:nth-child(2) p{margin-left:auto;max-width:220px}}@media only screen and (max-width:480px){.wps_order_msg_sub_container{padding:15px}.wps-order-msg__row{padding:15px 15px 15px 0}.wps_order_msg_detail_container{padding:15px 0 15px 15px}.wps_order_msg_attach_container{padding-left:15px}.wps-rma-form__wrapper textarea{height:150px!important}}@media only screen and (max-width:375px){.wps-order-msg-attachment-wrapper.wps_rma_flex{display:block}} \ No newline at end of file +*,:after,:before{box-sizing:border-box}.wps_order_msg_history_container .wps_reload_messages .reload-icon{margin-left:10px;width:25px}.wps_order_msg_sub_container{border:1px solid #ccc;max-height:400px;min-height:200px;overflow-y:auto;padding:30px}*,:after,:before{box-sizing:border-box}.wps-rma-form__wrapper .input-text,.wps-rma-form__wrapper input[type=email],.wps-rma-form__wrapper input[type=number],.wps-rma-form__wrapper input[type=password],.wps-rma-form__wrapper input[type=search],.wps-rma-form__wrapper input[type=tel],.wps-rma-form__wrapper input[type=text],.wps-rma-form__wrapper input[type=url],.wps-rma-form__wrapper textarea{background-color:transparent!important;border:1px solid #ccc!important;box-shadow:none!important;padding:10px 14px}.input-text:focus,.wps-rma-form__wrapper a:focus,.wps-rma-form__wrapper input[type=email]:focus,.wps-rma-form__wrapper input[type=number]:focus,.wps-rma-form__wrapper input[type=search]:focus,.wps-rma-form__wrapper input[type=tel]:focus,.wps-rma-form__wrapper input[type=text]:focus,.wps-rma-form__wrapper input[type=url]:focus,.wps-rma-form__wrapper textarea:focus,.wps_order_msg_sub_container input[type=password]:focus{outline:none!important}.wps-rma-form__wrapper label{display:inline-block!important;line-height:1.2;margin-bottom:8px}.wps-rma-form__wrapper h4{font-size:18px!important}.wps-rma-form__wrapper .wps_rma_flex{display:flex;flex-wrap:wrap}.wps-rma-form__wrapper select{padding:10px 14px}.wps_rma_refund_form_wrapper .input-text:focus,.wps_rma_refund_form_wrapper input[type=email]:focus,.wps_rma_refund_form_wrapper input[type=number]:focus,.wps_rma_refund_form_wrapper input[type=password]:focus,.wps_rma_refund_form_wrapper input[type=search]:focus,.wps_rma_refund_form_wrapper input[type=tel]:focus,.wps_rma_refund_form_wrapper input[type=text]:focus,.wps_rma_refund_form_wrapper input[type=url]:focus,.wps_rma_refund_form_wrapper textarea:focus{background-color:transparent}.wps_rma_refund_form_wrapper .wps-rma-subject__dropdown select{border-radius:0;padding:5px 105px 5px 5px;width:100%}.wps_rma_refund_form_wrapper .wps_rma_other_subject input{width:100%}.wps-rma-product__table{border-collapse:collapse;min-width:665px;width:100%}.wps-rma-form__wrapper h2.woocommerce-column__title{font-weight:600}.wps_rma_refund_form_wrapper select#wps_rma_return_request_subject:focus-visible{outline:none}.wps_rma_refund_form_wrapper select#wps_rma_return_request_subject option{box-shadow:none}.wps-rma-product__table-wrapper{overflow-x:auto;padding:0 15px}.wps_rma_refund_form_wrapper .wps_rma_product_title{padding:0 15px}.wps_rma_refund_form_wrapper .wps_rma_refund_request__row{justify-content:space-between}.wps_rma_refund_form_wrapper .wps_rma__column{width:100%}.wps-rma-form__wrapper.wps-rma-form__wrapper{border:1px solid #333}.wps-rma-form__wrapper .wps-rma-form__header{background-color:#333}.wps-rma-form__wrapper .wps-rma-form__heading{color:#fff;font-size:24px;font-weight:500;margin-top:0;padding:10px 15px}.wps-rma-form__wrapper td,.wps-rma-form__wrapper th{border:1px solid #ccc;padding:15px;text-align:center;vertical-align:middle}.wps-rma-form__wrapper th{color:#333}.wps-rma-form__wrapper .wps-rma-product__wrap{align-items:center;display:flex;justify-content:center}.wps-rma-form__wrapper .wps-rma__product-title{margin-left:20px;text-align:left}.wps-rma-product__table tbody td,table.wps-rma-product__table:not(.has-background) fieldset,table.wps-rma-product__table:not(.has-background) fieldset legend,table.wps-rma-product__table:not(.has-background) tbody td,table.wps-rma-product__table:not(.has-background) tbody tr:nth-child(2n) td{background-color:#fff}.wps-rma-form__wrapper .wps-rma-row__pd{padding:0 15px}.wps-rma-form__wrapper .wps-rma-col{width:100%}.wps-rma-form__wrapper .wps-rma-col.wps_rma_flex{justify-content:flex-start}.wps-rma-form__wrapper .wps_rma_other_subject{margin:25px 0}.wps_rma_attach_files{margin-top:10px}.wps-rma-subject__dropdown{margin-top:25px}.wps-rma-form__wrapper textarea{width:100%}.wps-rma-form__wrapper .product-quantity input{height:48px;margin:0 auto;width:197px}.wps-rma-form__wrapper td:last-child,.wps-rma-form__wrapper th:last-child{padding-right:15px}.wps-rma-form__wrapper td.product-total{text-align:center}.wps-order-msg-attachment-wrapper{align-items:center;justify-content:space-between;margin-top:20px}.wps-order-attachment input#wps_order_msg_attachment{max-width:230px}#wps_order_msg_submit{background:#374585;border:1px solid #374585;border-radius:3px;color:#fff;cursor:pointer;font-size:16px;margin:0;padding:6px 30px;text-decoration:none}form#wps_order_new_msg_form{margin-bottom:40px}.wps_rma_order_msg_wrapper .wps-order-msg-attachment-wrapper label{color:#000}.wps_rma_order_msg_wrapper h4.wps-order-heading.wps_rma_flex{align-items:center}.wps_rma_order_msg_wrapper h4.wps-order-heading.wps_rma_flex a{margin-left:20px;width:18px}.wps-order-msg__row{word-wrap:break-word;background-color:#fff;border:1px solid #ddd;margin-bottom:30px;padding:30px 30px 30px 0;width:auto}.wps_order_msg_sender{background-color:#4f62b9;color:#fff;display:inline-block;font-size:18px;font-weight:600;line-height:1.8;padding:8px 52px 8px 30px;position:relative}span.wps_order_msg_sender:after{background-color:transparent;border-left:24px solid transparent;border-right:24px solid transparent;border-top:24px solid #fff;content:"";height:100%;position:absolute;right:0;top:0;transform:rotate(90deg);width:0}.wps_order_msg_date{color:#1f1f1f;display:block;margin-top:10px;padding-left:30px}.wps_order_msg_attach_container{padding-left:30px}.wps_order_msg_detail_container{padding:20px 0 20px 30px}img.wps_order_msg_attachment_thumbnail{padding-bottom:8px;padding-top:8px}.wps_rma_order_msg_wrapper h4{background-color:#dadada;color:#1f1f1f!important;font-weight:600!important;line-height:1.6;padding:7px 15px}.wps-order-attachment input:focus{outline:none}.wps-order-msg__row{border-color:#ddd}.wps-order-msg__row:last-child{margin-bottom:0}.wps_order_msg_notice_wrapper,.wps_order_msg_sender_details.wps_rma_flex{align-items:center;justify-content:space-between}.wps_order_msg_notice_wrapper{border-radius:5px;color:#fff;display:none;flex-wrap:wrap;font-weight:600;margin-bottom:20px;padding:5px 15px}.wps_order_msg_notice_wrapper p{color:#fff;margin-bottom:0}a.wps_order_send_msg_dismiss{color:#fff;font-size:16px;font-weight:700}.wps_order_msg_sent_notice{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between}.wps-loader-icon{-webkit-animation:spin 1s linear infinite;animation:spin 1s linear infinite;transition:all .3s;transition-timing-function:ease-in}.wps_order_msg_sub_container{display:flex;flex-wrap:wrap}.wps-order-msg__row{width:100%}.wmb-order-admin__msg-container .wps_order_msg_sender{background-color:#71b02f}.wps_rma_order_msg_wrapper textarea{width:100%}div.wps_order_msg_single_attachment a .wps_order_msg_attachment_thumbnail{border:1px solid #000;border-radius:3px;display:table;margin-left:auto;margin-left:0!important;margin-right:auto;margin-right:0!important;max-width:60px;padding:5px}.wps_rma_return_notification>img{left:48%;position:absolute;top:45%;width:5%}.wps_rma_exchange_notification,.wps_rma_return_notification{color:green;display:none}.wps_rma_exchange_notification>img,.wps_rma_return_notification>img{left:48%;position:absolute;top:45%;width:5%}.wps_rma_exchange_notification,.wps_rma_return_notification{background-color:#000;bottom:0;height:100%;opacity:.5;padding:0;position:fixed;right:0;width:100%;z-index:99999}.wps_rma_return_notification_checkbox:after{background:hsla(0,0%,100%,.6) none repeat scroll 0 0;bottom:0;content:"";height:100%;left:0;position:absolute;right:0;top:0;width:100%}.wps_rma_return_notification_checkbox img{left:0;margin:0 auto;position:absolute;right:0;text-align:center;top:50%;transform:translateY(-50%);z-index:99999999}.wps_rma_return_notification_checkbox{display:none}.return,.view_msg{margin-top:4px}.wps_rma_refund_request__row{padding:0 15px}.wps_rma_customer_detail{overflow:hidden;padding:30px 15px}.wps_field_mendatory{color:red}@media only screen and (max-width:820px){.wps-order-msg__row{max-width:100%}.wps-order-msg__row:nth-child(2n),.wps-order-msg__row:nth-child(2n-1){margin-right:0}}@media only screen and (min-width:600px){.wps-rma-refund-request__row{display:flex;flex-wrap:nowrap}.wps-rma-form__wrapper .wps-rma-col:nth-child(2){padding-left:30px;width:60%}.wps_rma_refund_form_wrapper .wps_rma__column-right{justify-content:flex-end;margin-left:40px;max-width:calc(40% - 40px)}.wps-rma-form__wrapper .wps-rma-col:nth-child(2) p{margin-left:auto;max-width:220px}}@media only screen and (max-width:480px){.wps_order_msg_sub_container{padding:15px}.wps-order-msg__row{padding:15px 15px 15px 0}.wps_order_msg_detail_container{padding:15px 0 15px 15px}.wps_order_msg_attach_container{padding-left:15px}.wps-rma-form__wrapper textarea{height:150px!important}}@media only screen and (max-width:375px){.wps-order-msg-attachment-wrapper.wps_rma_flex{display:block}} \ No newline at end of file diff --git a/public/partials/wps-rma-refund-request-form.php b/public/partials/wps-rma-refund-request-form.php index a0bc4d5..c74458b 100755 --- a/public/partials/wps-rma-refund-request-form.php +++ b/public/partials/wps-rma-refund-request-form.php @@ -13,12 +13,7 @@ exit; } -if ( ! is_user_logged_in() ) { - $guest_user = true; -} else { - $guest_user = false; -} -if ( isset( $_GET['wps_rma_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['wps_rma_nonce'] ) ), 'wps_rma_nonce' ) && isset( $_GET['order_id'] ) && ( $guest_user || current_user_can( 'wps-rma-refund-request' ) ) ) { +if ( isset( $_GET['wps_rma_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['wps_rma_nonce'] ) ), 'wps_rma_nonce' ) && isset( $_GET['order_id'] ) && current_user_can( 'wps-rma-refund-request' ) ) { $order_id = sanitize_text_field( wp_unslash( $_GET['order_id'] ) ); } else { $order_id = ''; @@ -36,8 +31,10 @@ $rr_reason = ''; if ( isset( $condition ) && 'yes' === $condition && isset( $order_id ) && ! empty( $order_id ) && ! empty( $order_obj ) ) { $order_customer_id = get_post_meta( $order_id, '_customer_user', true ); - if ( ! current_user_can( 'wps-rma-refund-request' ) ) { - if ( get_current_user_id() != $order_customer_id ) { + $user = wp_get_current_user(); + $allowed_roles = array( 'editor', 'administrator', 'author' ); + if ( ! array_intersect( $allowed_roles, $user->roles ) ) { + if ( get_current_user_id() > 0 && get_current_user_id() != $order_customer_id ) { $myaccount_page = get_option( 'woocommerce_myaccount_page_id' ); $myaccount_page_url = get_permalink( $myaccount_page ); $condition = wp_kses_post( "This order #$order_id is not associated to your account. Click Here" ); @@ -72,7 +69,7 @@ if ( isset( $condition ) && 'yes' === $condition ) { $wps_refund_wrapper_class = get_option( 'wps_wrma_refund_form_wrapper_class' ); $wps_return_css = get_option( 'wps_rma_refund_form_css' ); -?> + ?>
    @@ -100,11 +97,18 @@ // Purchases note on the order. apply_filters( 'woocommerce_purchase_note_order_statuses', array( 'completed', 'processing' ) ) ); - $get_order_currency = get_woocommerce_currency_symbol( $order_obj->get_currency() ); + $get_order_currency = get_woocommerce_currency_symbol( $order_obj->get_currency() ); + $refund_items_details = get_post_meta( $order_id, 'wps_rma_refund_items_details', true ); foreach ( $order_obj->get_items() as $item_id => $item ) { $item_quantity = $item->get_quantity(); $refund_qty = $order_obj->get_qty_refunded_for_item( $item_id ); $item_qty = $item->get_quantity() + $refund_qty; + + if ( ! empty( $refund_items_details ) && isset( $refund_items_details[ $item_id ] ) ) { + $return_item_qty = $refund_items_details[ $item_id ]; + $item_qty = $item->get_quantity() - $return_item_qty; + } + if ( $item_qty > 0 ) { if ( isset( $item['variation_id'] ) && $item['variation_id'] > 0 ) { $variation_id = $item['variation_id']; @@ -288,10 +292,11 @@ + *
    @@ -358,7 +365,7 @@
    - + .

    -
    +
    *
    - +
    diff --git a/woocommerce-refund-and-exchange-lite.php b/woocommerce-refund-and-exchange-lite.php index 6414201..22b12af 100755 --- a/woocommerce-refund-and-exchange-lite.php +++ b/woocommerce-refund-and-exchange-lite.php @@ -15,16 +15,16 @@ * Plugin Name: Return Refund and Exchange for WooCommerce * Plugin URI: https://wordpress.org/plugins/woo-refund-and-exchange-lite/ * Description: Return Refund and Exchange for WooCommerce allows users to submit product refund. The plugin provides a dedicated mailing system that would help to communicate better between store owner and customers.This is lite version of WooCommerce Refund And Exchange. Elevate your e-commerce store by exploring more on WP Swings - * Version: 4.0.4 + * Version: 4.0.5 * Author: WP Swings * Author URI: https://wpswings.com/?utm_source=wpswings-rma-official&utm_medium=rma-org-backend&utm_campaign=official * Text Domain: woo-refund-and-exchange-lite * Domain Path: /languages * * Requires at least: 5.1.0 - * Tested up to: 6.0.0 + * Tested up to: 6.0.1 * WC requires at least: 5.1.0 - * WC tested up to: 6.6.1 + * WC tested up to: 6.7.0 * * License: GNU General Public License v3.0 * License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -60,7 +60,7 @@ * @since 1.0.0 */ function define_woo_refund_and_exchange_lite_constants() { - woo_refund_and_exchange_lite_constants( 'WOO_REFUND_AND_EXCHANGE_LITE_VERSION', '4.0.4' ); + woo_refund_and_exchange_lite_constants( 'WOO_REFUND_AND_EXCHANGE_LITE_VERSION', '4.0.5' ); woo_refund_and_exchange_lite_constants( 'WOO_REFUND_AND_EXCHANGE_LITE_DIR_PATH', plugin_dir_path( __FILE__ ) ); woo_refund_and_exchange_lite_constants( 'WOO_REFUND_AND_EXCHANGE_LITE_DIR_URL', plugin_dir_url( __FILE__ ) ); woo_refund_and_exchange_lite_constants( 'WOO_REFUND_AND_EXCHANGE_LITE_SERVER_URL', 'https://wpswings.com' ); @@ -216,88 +216,6 @@ function wps_rma_lite_settings_link( $links ) { return $links; } - /** Function to migrate to settings and data */ - function wps_rma_lite_migrate_settings_and_data() { - global $wpdb; - // Check if the plugin has been activated on the network. - if ( function_exists( 'is_multisite' ) && is_multisite() ) { - // Get all blogs in the network and activate plugins on each one. - $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ); - foreach ( $blog_ids as $blog_id ) { - switch_to_blog( $blog_id ); - - // Setting And DB Migration Code. - $check_return = get_option( 'mwb_wrma_return_enable', 'not_exist' ); - if ( 'not_exist' !== $check_return ) { - if ( ! get_option( 'wps_rma_lite_pages_migrate', false ) ) { - $page_id = get_option( 'ced_rnx_return_request_form_page_id' ); - wp_delete_post( $page_id ); - delete_option( 'ced_rnx_return_request_form_page_id' ); - $page_id = get_option( 'ced_rnx_view_order_msg_page_id' ); - wp_delete_post( $page_id ); - delete_option( 'ced_rnx_view_order_msg_page_id' ); - $mwb_wrma_pages = get_option( 'mwb_wrma_pages' ); - if ( isset( $mwb_wrma_pages['pages']['mwb_return_from'] ) ) { - $page_id = $mwb_wrma_pages['pages']['mwb_return_from']; - wp_delete_post( $page_id ); - } - if ( isset( $mwb_wrma_pages['pages']['mwb_view_order_msg'] ) ) { - $page_id = $mwb_wrma_pages['pages']['mwb_view_order_msg']; - wp_delete_post( $page_id ); - } - include_once WOO_REFUND_AND_EXCHANGE_LITE_DIR_PATH . 'includes/class-woo-refund-and-exchange-lite-activator.php'; - $activator_class_obj = new Woo_Refund_And_Exchange_Lite_Activator(); - $activator_class_obj::wps_rma_create_pages(); - update_option( 'wps_rma_lite_pages_migrate', true ); - } - - if ( function_exists( 'wps_rma_lite_migrate_settings' ) && ! get_option( 'wps_rma_lite_settings_migrate', false ) ) { - wps_rma_lite_migrate_settings(); - update_option( 'wps_rma_lite_settings_migrate', true ); - } - if ( function_exists( 'wps_rma_lite_post_meta_data_migrate' ) && ! get_option( 'wps_rma_lite_post_meta_data_migrate', false ) ) { - wps_rma_lite_post_meta_data_migrate(); - update_option( 'wps_rma_lite_post_meta_data_migrate', true ); - } - } - - restore_current_blog(); - } - } else { - // Setting And DB Migration Code. - $check_return = get_option( 'mwb_wrma_return_enable', 'not_exist' ); - if ( 'not_exist' !== $check_return ) { - if ( ! get_option( 'wps_rma_lite_pages_migrate', false ) ) { - $page_id = get_option( 'ced_rnx_return_request_form_page_id' ); - wp_delete_post( $page_id ); - delete_option( 'ced_rnx_return_request_form_page_id' ); - $page_id = get_option( 'ced_rnx_view_order_msg_page_id' ); - wp_delete_post( $page_id ); - delete_option( 'ced_rnx_view_order_msg_page_id' ); - $mwb_wrma_pages = get_option( 'mwb_wrma_pages' ); - if ( isset( $mwb_wrma_pages['pages']['mwb_return_from'] ) ) { - $page_id = $mwb_wrma_pages['pages']['mwb_return_from']; - wp_delete_post( $page_id ); - } - if ( isset( $mwb_wrma_pages['pages']['mwb_view_order_msg'] ) ) { - $page_id = $mwb_wrma_pages['pages']['mwb_view_order_msg']; - wp_delete_post( $page_id ); - } - include_once WOO_REFUND_AND_EXCHANGE_LITE_DIR_PATH . 'includes/class-woo-refund-and-exchange-lite-activator.php'; - $activator_class_obj = new Woo_Refund_And_Exchange_Lite_Activator(); - $activator_class_obj::wps_rma_create_pages(); - update_option( 'wps_rma_lite_pages_migrate', true ); - } - - if ( function_exists( 'wps_rma_lite_migrate_settings' ) && ! get_option( 'wps_rma_lite_settings_migrate', false ) ) { - wps_rma_lite_migrate_settings(); - update_option( 'wps_rma_lite_settings_migrate', true ); - } - } - } - } - add_action( 'admin_init', 'wps_rma_lite_migrate_settings_and_data', 10 ); - add_action( 'activated_plugin', 'wps_rma_org_redirect_on_settings' ); if ( ! function_exists( 'wps_rma_org_redirect_on_settings' ) ) { @@ -347,3 +265,4 @@ function wps_rma_plugin_deactivate_lite() { add_action( 'admin_notices', 'wps_rma_plugin_error_notice_lite' ); } } +