Skip to content

Commit

Permalink
Merge pull request #136 from wpswings/v4.4.2
Browse files Browse the repository at this point in the history
V4.4.2
  • Loading branch information
mohammaddanish-cedcoss authored Sep 19, 2024
2 parents 40e2b59 + b171e2f commit 2e34ae9
Show file tree
Hide file tree
Showing 15 changed files with 654 additions and 71 deletions.
14 changes: 14 additions & 0 deletions admin/class-woo-refund-and-exchange-lite-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,20 @@ public function wps_rma_refund_settings_page( $wps_rma_settings_refund ) {
'cols' => '80',
'placeholder' => esc_html__( 'Write the Refund Form CSS', 'woo-refund-and-exchange-lite' ),
);
$pro_slug = 'woocommerce-rma-for-return-refund-and-exchange/mwb-woocommerce-rma.php';
if ( function_exists( 'is_plugin_active' ) && ! is_plugin_active( $pro_slug ) ) {
$wps_rma_settings_refund[] = array(
'title' => esc_html__( 'Choose Template', 'woo-refund-and-exchange-lite' ),
'type' => 'radio',
'id' => 'wps_rma_return_template_css',
'value' => get_option( 'wps_rma_return_template_css' ),
'class' => 'mwr-radio-class',
'options' => array(
'' => esc_html__( 'Default', 'woo-refund-and-exchange-lite' ),
'template1' => esc_html__( 'Clean Slate', 'woo-refund-and-exchange-lite' )
),
);
}
$wps_rma_settings_refund =
// To extend Refund Apperance setting.
apply_filters( 'wps_rma_refund_appearance_setting_extend', $wps_rma_settings_refund );
Expand Down
18 changes: 18 additions & 0 deletions admin/js/woo-refund-and-exchange-lite-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,4 +490,22 @@ jQuery(document).ready(function() {
showLeadingZero: true,
});
}

// Function to get URL parameters
function getUrlParameter(name) {
// Create a regular expression to find the parameter in the URL
var regex = new RegExp('[?&]' + name + '=([^&]*)');
var results = regex.exec(window.location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}
if ( getUrlParameter('wrael_tab') == 'woo-refund-and-exchange-lite-refund' ) {
// $('.label_default').append('<img src="img_girl.jpg" class="wps_template_image" alt="Not Found">');
// $('.label_template1').append('<img src="img_girl.jpg" class="wps_template_image" alt="Not Found">');
} else if ( getUrlParameter('wrael_tab') == 'rma-return-refund-exchange-for-woocommerce-pro-exchange' ) {
// $('.label_default').append('<img src="img_girl.jpg" class="wps_template_image" alt="Not Found">');
// $('.label_template1').append('<img src="img_girl.jpg" class="wps_template_image" alt="Not Found">');
} else if ( getUrlParameter('wrael_tab') == 'rma-return-refund-exchange-for-woocommerce-pro-cancel' ) {
// $('.label_default').append('<img src="img_girl.jpg" class="wps_template_image" alt="Not Found">');
// $('.label_template1').append('<img src="img_girl.jpg" class="wps_template_image" alt="Not Found">');
}
});
2 changes: 1 addition & 1 deletion admin/js/woo-refund-and-exchange-lite-admin.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,20 @@ public function wps_rma_refund_appearance_setting_extend_set( $refund_app_settin
'class' => 'wrael-radio-switch-class ' . $this->rma_pro_activate,
'placeholder' => esc_html__( 'Enter the Product Notes', 'woo-refund-and-exchange-lite' ),
);
if ( ! $this->rma_pro_activate ) {

$refund_app_setting_extend[] = array(
'title' => esc_html__( 'Choose Template', 'woo-refund-and-exchange-lite' ),
'type' => 'radio',
'id' => 'wps_rma_return_template_css',
'value' => get_option( 'wps_rma_return_template_css' ),
'class' => 'mwr-radio-class',
'options' => array(
'' => esc_html__( 'Default', 'woo-refund-and-exchange-lite' ),
'template1' => esc_html__( 'Clean Slate', 'woo-refund-and-exchange-lite' )
),
);
}
return $refund_app_setting_extend;
}

Expand Down Expand Up @@ -530,6 +544,17 @@ public function wps_rma_exchange_settings_array_set( $wps_rma_settings_exchange
'cols' => '80',
'placeholder' => esc_html__( 'Write the Exchange form CSS', 'woo-refund-and-exchange-lite' ),
);
$wps_rma_settings_exchange[] = array(
'title' => esc_html__( 'Choose Template', 'woo-refund-and-exchange-lite' ),
'type' => 'radio',
'id' => 'wps_rma_exchange_template_css',
'value' => get_option( 'wps_rma_exchange_template_css' ),
'class' => 'mwr-radio-class ' . $this->rma_pro_activate,
'options' => array(
'' => esc_html__( 'Default', 'woo-refund-and-exchange-lite' ),
'template1' => esc_html__( 'Clean Slate', 'woo-refund-and-exchange-lite' )
),
);
$wps_rma_settings_exchange =
// To extend Refund Apperance setting.
apply_filters( 'wps_rma_exchange_appearance_setting_extend', $wps_rma_settings_exchange );
Expand Down Expand Up @@ -631,6 +656,17 @@ public function wps_rma_cancel_settings_array_set( $wps_rma_settings_cancel ) {
'options' => $get_pages,
);
}
$wps_rma_settings_cancel[] = array(
'title' => esc_html__( 'Choose Template', 'woo-refund-and-exchange-lite' ),
'type' => 'radio',
'id' => 'wps_rma_cancel_template_css',
'value' => get_option( 'wps_rma_cancel_template_css' ),
'class' => 'mwr-radio-class ' . $this->rma_pro_activate,
'options' => array(
'' => esc_html__( 'Default', 'woo-refund-and-exchange-lite' ),
'template1' => esc_html__( 'Clean Slate', 'woo-refund-and-exchange-lite' )
),
);
$wps_rma_settings_cancel[] = array(
'type' => 'button',
'id' => 'wps_rma_save_cancel_setting',
Expand Down
18 changes: 18 additions & 0 deletions assets/src/back-end/js/woo-refund-and-exchange-lite-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,4 +468,22 @@ jQuery(document).ready(function() {
showLeadingZero: true,
});
}

// Function to get URL parameters
function getUrlParameter(name) {
// Create a regular expression to find the parameter in the URL
var regex = new RegExp('[?&]' + name + '=([^&]*)');
var results = regex.exec(window.location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}
if ( getUrlParameter('wrael_tab') == 'woo-refund-and-exchange-lite-refund' ) {
// $('.label_default').append('<img src="img_girl.jpg" class="wps_template_image" alt="Not Found">');
// $('.label_template1').append('<img src="img_girl.jpg" class="wps_template_image" alt="Not Found">');
} else if ( getUrlParameter('wrael_tab') == 'rma-return-refund-exchange-for-woocommerce-pro-exchange' ) {
// $('.label_default').append('<img src="img_girl.jpg" class="wps_template_image" alt="Not Found">');
// $('.label_template1').append('<img src="img_girl.jpg" class="wps_template_image" alt="Not Found">');
} else if ( getUrlParameter('wrael_tab') == 'rma-return-refund-exchange-for-woocommerce-pro-cancel' ) {
// $('.label_default').append('<img src="img_girl.jpg" class="wps_template_image" alt="Not Found">');
// $('.label_template1').append('<img src="img_girl.jpg" class="wps_template_image" alt="Not Found">');
}
});
261 changes: 261 additions & 0 deletions assets/src/front-end/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -702,3 +702,264 @@ div.wps_order_msg_single_attachment a .wps_order_msg_attachment_thumbnail{
margin-left: 5px !important ;
}

// Shadow template css start

#wps_rma_template1.wps_rma_template1 {
border-radius: 10px;
padding: 20px;
background: #fff;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
margin: 0 0 20px;
}

#wps_rma_template1.wps_rma_template1 h1.wps-rma-form__heading {
color: #000;
font-weight: bold;
padding: 0;
line-height: 1.25;
font-size: 32px;
margin: 0 0 20px;
text-align: left;
}

#wps_rma_template1.wps_rma_template1 .wps-rma-form__header {
background: transparent;
}

#wps_rma_template1.wps_rma_template1 .wps_rma_customer_detail h2 {
font-size: 24px;
font-weight: bold;
line-height: 1.25;
}

#wps_rma_template1.wps_rma_template1 table tbody tr:nth-of-type(even) {
background: #f9f9f9;
}

#wps_rma_template1.wps_rma_template1 table th,
#wps_rma_template1.wps_rma_template1 table td {
border: none;
text-align: left;
vertical-align: top;
padding: 10px;
background: transparent;
}

#wps_rma_template1.wps_rma_template1 table th {
background: transparent;
border: 1px solid #e2e2e2;
border-left: none;
font-size: 16px;
font-weight: bold;
line-height: 1.25;
}

#wps_rma_template1.wps_rma_template1 table th:last-of-type {
border-right: none;
}

#wps_rma_template1.wps_rma_template1 table tbody tr:last-of-type th,
#wps_rma_template1.wps_rma_template1 table tbody tr:last-of-type td {
border: none;
border-top: 1px solid #e2e2e2;
border-bottom: 1px solid #e2e2e2;
background: transparent;
}

#wps_rma_template1.wps_rma_template1 table tbody tr:last-of-type {
background: transparent;
}

#wps_rma_template1.wps_rma_template1 table input[type="checkbox"] {
border-radius: 6px;
appearance: none;
width: 20px;
height: 20px;
border: 1px solid #c7c7c7;
position: relative;
cursor: pointer;
}

#wps_rma_template1.wps_rma_template1
table
input[type="checkbox"]:checked::before {
content: "\2714";
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: #00a0ef;
font-size: 14px;
}

#wps_rma_template1.wps_rma_template1 table input[type="checkbox"]:checked {
border-color: #00a0ef;
}

#wps_rma_template1.wps_rma_template1
table
.product-quantity
input[type="number"],
#wps_rma_template1.wps_rma_template1 table .wps_rma_exchange_to_product_qty {
border-radius: 6px;
max-width: 80px;
}

#wps_rma_template1.wps_rma_template1 table .product-name img {
border-radius: 6px;
}

#wps_rma_template1.wps_rma_template1 table input[type="checkbox"]:focus {
outline: none;
}

#wps_rma_template1.wps_rma_template1 table td.product-total {
font-weight: bold;
color: #000;
}

#wps_rma_template1.wps_rma_template1 table th.product-check {
font-size: 0;
width: 40px;
min-width: 40px;
}

#wps_rma_template1.wps_rma_template1 .wps-rma-row__pd,
#wps_rma_template1.wps_rma_template1 .wps-rma-refund-request__row {
gap: 40px;
}

#wps_rma_template1.wps_rma_template1 select {
border-radius: 6px;
width: 100%;
}

#wps_rma_template1.wps_rma_template1 label {
font-weight: bold;
line-height: 1.25;
color: #000;
}

#wps_rma_template1.wps_rma_template1 textarea, #wps_rma_template1.wps_rma_template1 input[type=text] {
border-radius: 6px;
color: #000;
line-height: 1.25;
max-height: 140px;
}

#wps_rma_template1.wps_rma_template1 table {
background: transparent;
}

#wps_rma_template1.wps_rma_template1 .button {
border-radius: 6px;
width: auto !important;
padding: 10px 20px;
}

#wps_rma_template1.wps_rma_template1 .wps-rma-col:last-of-type {
background: #f9f9f9;
padding: 20px;
border-radius: 6px;
color: #000;
border: 1px solid #c7c7c7;
margin: 15px 0;
}

#wps_rma_template1.wps_rma_template1
table.wps_wrma_exchanged_products
th:last-of-type {
text-align: center;
}
#wps_rma_template1.wps_rma_template1 table td.wps_wrma_exchnaged_product_remove {
text-align: center;
}

#wps_rma_template1 #wps_rma_notification_div>label {
display: flex !important;
flex-direction: column;
gap: 10px;
margin: 15px 0 0;
}

#wps_rma_template1 #wps_rma_notification_div>label input[type=tel] {
border-radius: 6px;
width: 100%;
}

#wps_rma_template1 #wps_rma_return_request_form, #wps_rma_template1 #wps_rma_exchnage_request_form {
width: 100%;
}

@media only screen and (max-width: 580px) {
#wps_rma_template1.wps_rma_template1 table th.product-check {
font-size: 16px;
width: auto;
}

#wps_rma_template1.wps_rma_template1 table th {
border: none;
border-bottom: 1px solid #c7c7c7;
}

#wps_rma_template1.wps_rma_template1 table tbody tr:last-of-type td {
border: none;
}

#wps_rma_template1.wps_rma_template1 table td.product-quantity,
#wps_rma_template1.wps_rma_template1 table td.product-total {
text-align: right;
}

#wps_rma_template1.wps_rma_template1 .wps_wrma_exchanged_products tbody td {
text-align: right;
}

#wps_rma_template1.wps_rma_template1
.wps_wrma_exchanged_products
.wps-rma-product__wrap {
border: none;
}

#wps_rma_template1.wps_rma_template1
.wps_wrma_exchanged_products
a.remove:before {
display: none;
}

#wps_rma_template1.wps_rma_template1
table.wps_wrma_exchanged_products
th:last-of-type {
text-align: left;
}

#wps_rma_template1.wps_rma_template1
table
tr.wps_wrma_cancel_column
td
.wps_wrma_product_title
p {
display: flex;
justify-content: space-between;
}

#wps_rma_template1.wps_rma_template1
table
tr.wps_wrma_cancel_column
td
.wps_wrma_product_title {
width: 100%;
}

#wps_rma_template1.wps_rma_template1
table
tr.wps_wrma_cancel_column
td
.wps_wrma_product_title
p
b {
flex: 1;
}
}

// Shadow template css end
2 changes: 1 addition & 1 deletion common/class-woo-refund-and-exchange-lite-common.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public function wps_rma_order_messages_save() {
$to = get_option( 'woocommerce_email_from_address', get_option( 'admin_email' ) );
}

$wps_rma_customer_contact_order_message_get = wps_rma_pro_get_meta_data( $order_id, 'wps_rma_customer_contact_order_message', true );
$wps_rma_customer_contact_order_message_get = wps_rma_get_meta_data( $order_id, 'wps_rma_customer_contact_order_message', true );

$wps_rma_customer_contact_order_message = isset( $_POST['wps_rma_customer_contact_order_message'] ) ? sanitize_text_field( wp_unslash( $_POST['wps_rma_customer_contact_order_message'] ) ) : '';
if ( $wps_rma_customer_contact_order_message && empty( $wps_rma_customer_contact_order_message_get )) {
Expand Down
Loading

0 comments on commit 2e34ae9

Please sign in to comment.