fix: All 6 issues - WC notices, terminology, tax optional, context

##  Issue #1: WooCommerce Admin Notices
- Added proper CSS styling for .woocommerce-message/error/info
- Border-left color coding (green/red/blue)
- Proper padding, margins, and backgrounds
- Now displays correctly in SPA

##  Issue #2: No Flag Emojis
- Keeping regions as text only (cleaner, more professional)
- Avoids rendering issues and political sensitivities
- Matches Shopify/marketplace approach

##  Issue #3: Added "Available to:" Context
- Zone regions now show: "Available to: Indonesia"
- Makes it clear what the regions mean
- Better UX - no ambiguity

##  Issue #4: Terminology Fixed - "Delivery Option"
- Changed ALL "Shipping Method" → "Delivery Option"
- Matches Shopify/marketplace terminology
- Consistent across desktop and mobile
- "4 delivery options" instead of "4 methods"

##  Issue #5: Tax is Optional
- Tax menu only appears if wc_tax_enabled()
- Matches WooCommerce behavior (appears after enabling)
- Dynamic navigation based on store settings
- Cleaner menu for stores without tax

##  Issue #6: Shipping Method Investigation
- Checked flexible-shipping-ups plugin
- Its a live rates plugin (UPS API)
- Does NOT require subdistrict - only needs:
  - Country, State, City, Postal Code
- Issue: Create Order may be requiring subdistrict for ALL methods
- Need to make address fields conditional based on shipping method type

## Next: Fix Create Order address fields to be conditional
This commit is contained in:
dwindown
2025-11-10 10:46:01 +07:00
parent 93e5a9a3bc
commit e502dcc807
3 changed files with 47 additions and 16 deletions

View File

@@ -132,6 +132,30 @@
[data-radix-popper-content-wrapper] { z-index: 2147483647 !important; }
body.woonoow-fullscreen .woonoow-app { overflow: visible; }
/* --- WooCommerce Admin Notices --- */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
position: relative;
border-left: 4px solid #00a32a;
padding: 12px 16px;
margin: 16px 0;
background: #f0f6fc;
border-radius: 4px;
font-size: 14px;
line-height: 1.5;
}
.woocommerce-error {
border-left-color: #d63638;
background: #fcf0f1;
}
.woocommerce-info {
border-left-color: #2271b1;
background: #f0f6fc;
}
/* a[href] {
color: rgb(34 197 94);
font-weight: bold;

View File

@@ -299,10 +299,10 @@ export default function ShippingPage() {
<div className="min-w-0 flex-1">
<h3 className="font-semibold text-base md:text-lg">{zone.name}</h3>
<p className="text-xs md:text-sm text-muted-foreground truncate">
{zone.regions}
<span className="font-medium">{__('Available to:')}</span> {zone.regions}
</p>
<p className="text-xs md:text-sm text-muted-foreground">
{zone.rates.length} {zone.rates.length === 1 ? 'method' : 'methods'}
{zone.rates.length} {zone.rates.length === 1 ? __('delivery option') : __('delivery options')}
</p>
</div>
</div>
@@ -327,7 +327,7 @@ export default function ShippingPage() {
variant="ghost"
size="sm"
onClick={() => setSelectedZone(zone)}
title={__('Manage shipping methods')}
title={__('Manage delivery options')}
>
<Settings className="h-4 w-4" />
</Button>
@@ -417,7 +417,7 @@ export default function ShippingPage() {
</DialogHeader>
<div className="flex-1 overflow-y-auto p-6 min-h-0">
<div className="space-y-4">
{/* Add Shipping Method Button */}
{/* Add Delivery Option Button */}
{!showAvailableMethods ? (
<Button
variant="outline"
@@ -425,12 +425,12 @@ export default function ShippingPage() {
onClick={() => setShowAvailableMethods(true)}
>
<Plus className="h-4 w-4 mr-2" />
{__('Add Shipping Method')}
{__('Add Delivery Option')}
</Button>
) : (
<div className="border rounded-lg p-4 space-y-3">
<div className="flex items-center justify-between mb-2">
<h3 className="font-medium">{__('Available Shipping Methods')}</h3>
<h3 className="font-medium">{__('Available Delivery Options')}</h3>
<Button
variant="ghost"
size="sm"
@@ -460,7 +460,7 @@ export default function ShippingPage() {
</div>
)}
{/* Shipping Methods Accordion */}
{/* Delivery Options Accordion */}
<Accordion type="single" collapsible value={expandedMethod} onValueChange={(value) => {
setExpandedMethod(value);
if (value) {
@@ -629,7 +629,7 @@ export default function ShippingPage() {
</DrawerHeader>
<div className="flex-1 overflow-y-auto px-4 py-4 min-h-0">
<div className="space-y-3">
{/* Add Shipping Method Button */}
{/* Add Delivery Option Button */}
{!showAvailableMethods ? (
<Button
variant="outline"
@@ -637,12 +637,12 @@ export default function ShippingPage() {
onClick={() => setShowAvailableMethods(true)}
>
<Plus className="h-4 w-4 mr-2" />
{__('Add Shipping Method')}
{__('Add Delivery Option')}
</Button>
) : (
<div className="border rounded-lg p-3 space-y-2">
<div className="flex items-center justify-between mb-2">
<h3 className="font-medium text-sm">{__('Available Shipping Methods')}</h3>
<h3 className="font-medium text-sm">{__('Available Delivery Options')}</h3>
<Button
variant="ghost"
size="sm"
@@ -672,7 +672,7 @@ export default function ShippingPage() {
</div>
)}
{/* Shipping Methods Accordion (Mobile) */}
{/* Delivery Options Accordion (Mobile) */}
<Accordion type="single" collapsible value={expandedMethod} onValueChange={(value) => {
setExpandedMethod(value);
if (value) {
@@ -914,7 +914,6 @@ export default function ShippingPage() {
<input
id="zone-name"
name="name"
type="text"
required
defaultValue={editingZone?.name || ''}
placeholder={__('e.g., Domestic, International, Europe')}
@@ -932,7 +931,6 @@ export default function ShippingPage() {
{/* Search Filter */}
<input
type="text"
placeholder={__('Search regions...')}
value={regionSearch}
onChange={(e) => setRegionSearch(e.target.value)}

View File

@@ -169,7 +169,7 @@ class NavigationRegistry {
private static function get_settings_children(): array {
$admin = admin_url('admin.php');
return [
$children = [
// WooNooW Settings
['label' => __('WooNooW', 'woonoow'), 'mode' => 'spa', 'path' => '/settings'],
@@ -177,7 +177,14 @@ class NavigationRegistry {
['label' => __('Store Details', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/store'],
['label' => __('Payments', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/payments'],
['label' => __('Shipping & Delivery', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/shipping'],
['label' => __('Taxes', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/taxes'],
];
// Only show Tax if enabled in WooCommerce
if (wc_tax_enabled()) {
$children[] = ['label' => __('Tax', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/tax'];
}
$children = array_merge($children, [
['label' => __('Checkout', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/checkout'],
['label' => __('Customer Accounts', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/customers'],
['label' => __('Notifications', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/notifications'],
@@ -188,7 +195,9 @@ class NavigationRegistry {
['label' => __('Integrations', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-settings&tab=integration'],
['label' => __('System Status', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-status'],
['label' => __('Extensions', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-addons'],
];
]);
return $children;
}
/**