feat: Multiple fixes and features

1. Add allow_custom_avatar toggle to Customer Settings
2. Implement coupon apply/remove in Cart and Checkout pages
3. Update Cart interface with coupons array and discount_total
4. Implement Downloads page to fetch from /account/downloads API
This commit is contained in:
Dwindi Ramadhana
2026-01-04 20:03:33 +07:00
parent befacf9d29
commit 0f542ad452
13 changed files with 420 additions and 32 deletions

View File

@@ -21,6 +21,7 @@ class CustomerSettingsProvider {
// General
'auto_register_members' => get_option('woonoow_auto_register_members', 'no') === 'yes',
'multiple_addresses_enabled' => get_option('woonoow_multiple_addresses_enabled', 'yes') === 'yes',
'allow_custom_avatar' => get_option('woonoow_allow_custom_avatar', 'no') === 'yes',
// VIP Customer Qualification
'vip_min_spent' => floatval(get_option('woonoow_vip_min_spent', 1000)),
@@ -49,8 +50,10 @@ class CustomerSettingsProvider {
update_option('woonoow_multiple_addresses_enabled', $value);
}
if (array_key_exists('allow_custom_avatar', $settings)) {
$value = !empty($settings['allow_custom_avatar']) ? 'yes' : 'no';
update_option('woonoow_allow_custom_avatar', $value);
}
// VIP settings
if (isset($settings['vip_min_spent'])) {
update_option('woonoow_vip_min_spent', floatval($settings['vip_min_spent']));