Hi @simoneideagency
You should update to Version 4.0.8, they remove this requirement.
But if you don’t:
– find js to override by searching woo-refund-and-exchange-lite-common in inspector, it should be /woo-refund-and-exchange-lite/common/js/woo-refund-and-exchange-lite-common.min.js
– copy code, unminify it and paste in a js file, inside a template child (or a custom plugin)
– in you new js, near l.121 just comment :
else o = '<p class="wps_order_msg_sent_notice">' + wrael_common_param.no_file_attached + '</p><a href="" class="wps_remove_notice_msg">X</a>';
then replace plugin js by your new js. Personnally, I custom messaging order page with a template, and it’s easier to find and override js
What I done from Version 4.0.5:
if ( is_plugin_active( 'woo-refund-and-exchange-lite/woocommerce-refund-and-exchange-lite.php') ) {
// dequeue js plugin (and its extra):
add_action( 'wp_enqueue_scripts', 'rma_common_remove_js', 100);
function rma_common_remove_js() {
if ( is_page_template('template-rma.php') ) {
wp_dequeue_script( 'Return Refund and Exchange for WooCommercecommon' );
}
}
// enqueue your new script and its extra:
add_action( 'wp_enqueue_scripts', 'rma_common_override_js' );
function rma_common_override_js() {
if ( is_page_template('template-rma.php') ) {
wp_enqueue_script('child-rma-common', CHILD_TMPL . '/assets/js/your-new-file-name.js', array('jquery'), '', true);
$pro_active = wps_rma_pro_active();
if ( get_current_user_id() > 0 ) {
$myaccount_page = get_option( 'woocommerce_myaccount_page_id' );
$myaccount_page_url = get_permalink( $myaccount_page );
} else {
$myaccount_page = get_option( 'woocommerce_myaccount_page_id' );
$myaccount_page_url = get_permalink( $myaccount_page );
}
wp_localize_script(
'child-rma-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),
'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'),
)
);
}
}
}
Depending on your version, you have to pay attention to the handle name (ID of the script) to dequeue. You should find it when you found plugin js in inspector.
When I updated plugin to Version 4.0.8, they seems to consider my recommendations, and ID of the script is not “Return Refund and Exchange for WooCommercecommon” anymore but “return-refund-and-exchange-for-woocommercecommon-js”, so you must dequeue it this way: wp_dequeue_script( 'return-refund-and-exchange-for-woocommercecommon' );
In this version 4.0.8, they removed the line previously commented in your js overriden. So you don’t have to override it.
I don’t know when they finally decided to change handle name (ID script) and remove requirement. You should be care.
And last advice:
To avoid problems with the html code, you should correct woo-refund-and-exchange-lite\public\partials\wps-rma-view-order-msg.php
l.55:
<div class="wps-order-msg-btn">
</div>
<input type="submit" id="wps_order_msg_submit" name="wps_order_msg_submit" value="<?php esc_html_e( 'Send', 'woo-refund-and-exchange-lite' ); ?>" data-id="<?php echo esc_attr( $order_id ); ?>">
<input type="hidden" name="wps_order_msg_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wps_order_msg_nonce' ) ); ?>">
</div>
</div>
replace with
<div class="wps-order-msg-btn">
<div>
<input type="submit" id="wps_order_msg_submit" name="wps_order_msg_submit" value="<?php esc_html_e( 'Send', 'woo-refund-and-exchange-lite' ); ?>" data-id="<?php echo esc_attr( $order_id ); ?>">
<input type="hidden" name="wps_order_msg_nonce" value="<?php echo esc_attr( wp_create_nonce( 'wps_order_msg_nonce' ) ); ?>">
</div>
</div>
I couldn’t do anything else but correct it inside the plugin, you’ll have to check it after each update. I also reported this carelessness, but it still hasn’t been corrected.
-
This reply was modified 2 years ago by seds94.
-
This reply was modified 2 years ago by seds94.
-
This reply was modified 2 years ago by seds94.
-
This reply was modified 2 years ago by seds94.