Skip to content

Commit

Permalink
v2.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
navneet-cedcoss committed Feb 19, 2025
1 parent 4127a45 commit 164e8cc
Show file tree
Hide file tree
Showing 23 changed files with 1,959 additions and 1,673 deletions.
7 changes: 4 additions & 3 deletions admin/class-points-rewards-for-woocommerce-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ public function wps_wpr_points_update() {
self::wps_wpr_update_points_details( $user_id, 'admin_points', $points, $data );
/* Send Mail to the user*/
$this->wps_wpr_send_mail_details( $user_id, 'admin_notification', $points );
do_action( 'wps_wpr_update_user_points_manually', $user_id );
wp_die();
}
}
Expand Down Expand Up @@ -678,15 +679,15 @@ public function wps_wpr_membership_role( $count, $key, $value ) {
</tr>
<tr valign="top">
<th scope="row" class="wps-wpr-titledesc">
<label for="wps_wpr_membership_category_list"><?php esc_html_e( 'Select Product Category', 'points-and-rewards-for-woocommerce' ); ?></label>
<label for="wps_wpr_membership_category_list"><?php esc_html_e( 'Select Product Category test', 'points-and-rewards-for-woocommerce' ); ?></label>
</th>
<td class="forminp forminp-text">
<?php
$allowed_tags = $this->wps_wpr_allowed_html();
$attribute_description = __( 'Select Product Category', 'points-and-rewards-for-woocommerce' );
echo wp_kses( wc_help_tip( $attribute_description ), $allowed_tags );
?>
<select id="wps_wpr_membership_category_list_<?php echo esc_html( $count ); ?>" required="true" multiple="multiple" class="wps_wpr_common_class_categ" data-id="<?php echo esc_html( $count ); ?>" name="wps_wpr_membership_category_list_<?php echo esc_html( $count ); ?>[]">
<select id="wps_wpr_membership_category_list_<?php echo esc_html( $count ); ?>" multiple="multiple" class="wps_wpr_common_class_categ" data-id="<?php echo esc_html( $count ); ?>" name="wps_wpr_membership_category_list_<?php echo esc_html( $count ); ?>[]">
<?php
$args = array( 'taxonomy' => 'product_cat' );
$categories = get_terms( $args );
Expand Down Expand Up @@ -773,7 +774,7 @@ public function wps_wpr_membership_role( $count, $key, $value ) {
echo wp_kses( wc_help_tip( $attribute_description ), $allowed_tags );
?>
<label for="wps_wpr_membership_discount">
<input type="number" min="1" max="100" value="<?php echo esc_html( $this->check_is_not_empty( isset( $value['Discount'] ) ? $value['Discount'] : '' ) ); ?>" name="wps_wpr_membership_discount_<?php echo esc_html( $count ); ?>" id="wps_wpr_membership_discount_<?php echo esc_html( $count ); ?>" class="input-text" required>
<input type="number" min="0" max="100" value="<?php echo esc_html( ! empty( $value['Discount'] ) ? $value['Discount'] : 0 ); ?>" name="wps_wpr_membership_discount_<?php echo esc_html( $count ); ?>" id="wps_wpr_membership_discount_<?php echo esc_html( $count ); ?>" class="input-text">
</label>
</td>
</tr>
Expand Down
70 changes: 68 additions & 2 deletions admin/class-points-rewards-for-woocommerce-dummy-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public function __construct( $plugin_name, $version ) {
add_filter( 'wps_rwpr_add_setting_tab', array( $this, 'wps_add_points_dummy_notification_addon_settings_tab' ), 22, 1 );
add_filter( 'wps_rwpr_add_setting_tab', array( $this, 'wps_add_api_dummy_settings_tab' ), 23, 1 );
add_filter( 'wps_wpr_others_settings', array( $this, 'wps_wpr_total_earning_dummy_points_settings' ), 12, 1 );
add_filter( 'wps_wpr_general_settings', array( $this, 'wps_wpr_extend_dummy_order_rewards_settings' ), 10, 1 );
}

/**
Expand Down Expand Up @@ -2367,9 +2368,9 @@ public function wps_wpr_enqueue_dummy_file() {
if ( wp_verify_nonce( ! empty( $_GET['nonce'] ) ? sanitize_text_field( wp_unslash( $_GET['nonce'] ) ) : '', 'par_main_setting' ) ) {
if ( ! empty( $_GET['page'] ) && 'wps-rwpr-setting' == $_GET['page'] ) {

wp_register_style( 'wps_wpr_dummy_css_file', WPS_RWPR_DIR_URL . 'admin/partials/dummyfile/dummycss/wps-points-and-rewards-dummy.css', array(), '2.6.1' );
wp_register_style( 'wps_wpr_dummy_css_file', WPS_RWPR_DIR_URL . 'admin/partials/dummyfile/dummycss/wps-points-and-rewards-dummy.css', array(), '2.6.2' );
wp_enqueue_style( 'wps_wpr_dummy_css_file' );
wp_register_script( 'wps_wpr_dummy_js_file', WPS_RWPR_DIR_URL . 'admin/partials/dummyfile/dummyjs/wps-points-and-rewards-dummy.js', array(), '2.6.1', true );
wp_register_script( 'wps_wpr_dummy_js_file', WPS_RWPR_DIR_URL . 'admin/partials/dummyfile/dummyjs/wps-points-and-rewards-dummy.js', array(), '2.6.2', true );
wp_enqueue_script( 'wps_wpr_dummy_js_file' );
wp_localize_script(
'wps_wpr_dummy_js_file',
Expand Down Expand Up @@ -2452,4 +2453,69 @@ public function wps_wpr_total_earning_dummy_points_settings( $wps_wpr_other_sett
return $wps_wpr_other_settings;
}

/**
* This function is used to create dummy settings for order rewards recurring points.
*
* @param array $general_settings general_settings.
* @return array
*/
public function wps_wpr_extend_dummy_order_rewards_settings( $general_settings ) {

$my_new_inserted_array = array(
array(
'title' => __( 'Recurring Reward Points Within Range', 'points-and-rewards-for-woocommerce' ),
'type' => 'checkbox',
'desc' => __( 'Enable this setting to reward the user again within the selected range', 'points-and-rewards-for-woocommerce' ),
'id' => 'wps_wpr_enable_next_rewards_time',
'class' => 'input-text wps_wpr_pro_plugin_settings',
'desc_tip' => __( 'By enabling this setting, you can reward the user again within the selected range based on the number of orders they have placed.', 'points-and-rewards-for-woocommerce' ),
'default' => 0,
),
array(
'title' => __( 'Set Next Rewards Date', 'points-and-rewards-for-woocommerce' ),
'type' => 'number_text',
'class' => 'input-text wps_wpr_pro_plugin_settings',
'desc_tip' => __( 'Set the time period during which the user will be rewarded with points.', 'points-and-rewards-for-woocommerce' ),
'number_text' => array(
array(
'type' => 'number',
'id' => 'wps_wpr_next_order_reward_time',
'class' => 'input-text wps_wpr_common_width wps_wpr_pro_plugin_settings',
'custom_attributes' => array( 'min' => '"1"' ),
'desc_tip' => __(
'Set the time period during which the user will be rewarded with points.',
'points-and-rewards-for-woocommerce'
),
),
array(
'id' => 'wps_wpr_next_order_rewards_time_type',
'class' => 'wps_wgm_new_woo_ver_style_select wps_wpr_pro_plugin_settings',
'type' => 'singleSelectDropDownWithKeyvalue',
'custom_attribute' => array(
array(
'id' => 'day',
'name' => __( 'Day', 'points-and-rewards-for-woocommerce' ),
),
array(
'id' => 'week',
'name' => __( 'Week', 'points-and-rewards-for-woocommerce' ),
),
array(
'id' => 'month',
'name' => __( 'Month', 'points-and-rewards-for-woocommerce' ),
),
array(
'id' => 'year',
'name' => __( 'Year', 'points-and-rewards-for-woocommerce' ),
),
),
),
),
),
);

$general_settings = $this->wps_dummy_insert_keys_value_pair( $general_settings, $my_new_inserted_array, 72 );
return $general_settings;
}

}
11 changes: 11 additions & 0 deletions admin/css/points-rewards-for-woocommerce-admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1497,3 +1497,14 @@ span.wps_wpr_all_referral_name:hover~span.wps_wpr_all_referral_view, span.wps_wp
.wps_wpr_user_reports table th {
background: #f2f2f2;
}

/** Floating button (Save Settings) **/

.wps_rwpr_content_template .submit {
position: sticky;
bottom: 0;
width: 100%;
background: #fff;
margin-left: -15px;
padding-left: 15px;
}
2 changes: 1 addition & 1 deletion admin/css/points-rewards-for-woocommerce-admin.min.css

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions admin/js/points-rewards-for-woocommerce-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,6 @@
.attr("required", !1),
jQuery(document)
.find("#wps_wpr_membership_expiration_" + e)
.attr("required", !1),
jQuery(document)
.find("#wps_wpr_membership_category_list_" + e)
.attr("required", !1),
jQuery(document)
.find("#wps_wpr_membership_discount_" + e)
.attr("required", !1);
});
},
Expand All @@ -311,12 +305,6 @@
.attr("required", !0),
jQuery(document)
.find("#wps_wpr_membership_expiration_" + e)
.attr("required", !0),
jQuery(document)
.find("#wps_wpr_membership_category_list_" + e)
.attr("required", !0),
jQuery(document)
.find("#wps_wpr_membership_discount_" + e)
.attr("required", !0);
});
};
Expand Down
Loading

0 comments on commit 164e8cc

Please sign in to comment.