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:
@@ -132,6 +132,30 @@
|
|||||||
[data-radix-popper-content-wrapper] { z-index: 2147483647 !important; }
|
[data-radix-popper-content-wrapper] { z-index: 2147483647 !important; }
|
||||||
body.woonoow-fullscreen .woonoow-app { overflow: visible; }
|
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] {
|
/* a[href] {
|
||||||
color: rgb(34 197 94);
|
color: rgb(34 197 94);
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|||||||
@@ -299,10 +299,10 @@ export default function ShippingPage() {
|
|||||||
<div className="min-w-0 flex-1">
|
<div className="min-w-0 flex-1">
|
||||||
<h3 className="font-semibold text-base md:text-lg">{zone.name}</h3>
|
<h3 className="font-semibold text-base md:text-lg">{zone.name}</h3>
|
||||||
<p className="text-xs md:text-sm text-muted-foreground truncate">
|
<p className="text-xs md:text-sm text-muted-foreground truncate">
|
||||||
{zone.regions}
|
<span className="font-medium">{__('Available to:')}</span> {zone.regions}
|
||||||
</p>
|
</p>
|
||||||
<p className="text-xs md:text-sm text-muted-foreground">
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -327,7 +327,7 @@ export default function ShippingPage() {
|
|||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
onClick={() => setSelectedZone(zone)}
|
onClick={() => setSelectedZone(zone)}
|
||||||
title={__('Manage shipping methods')}
|
title={__('Manage delivery options')}
|
||||||
>
|
>
|
||||||
<Settings className="h-4 w-4" />
|
<Settings className="h-4 w-4" />
|
||||||
</Button>
|
</Button>
|
||||||
@@ -417,7 +417,7 @@ export default function ShippingPage() {
|
|||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
<div className="flex-1 overflow-y-auto p-6 min-h-0">
|
<div className="flex-1 overflow-y-auto p-6 min-h-0">
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
{/* Add Shipping Method Button */}
|
{/* Add Delivery Option Button */}
|
||||||
{!showAvailableMethods ? (
|
{!showAvailableMethods ? (
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@@ -425,12 +425,12 @@ export default function ShippingPage() {
|
|||||||
onClick={() => setShowAvailableMethods(true)}
|
onClick={() => setShowAvailableMethods(true)}
|
||||||
>
|
>
|
||||||
<Plus className="h-4 w-4 mr-2" />
|
<Plus className="h-4 w-4 mr-2" />
|
||||||
{__('Add Shipping Method')}
|
{__('Add Delivery Option')}
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<div className="border rounded-lg p-4 space-y-3">
|
<div className="border rounded-lg p-4 space-y-3">
|
||||||
<div className="flex items-center justify-between mb-2">
|
<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
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -460,7 +460,7 @@ export default function ShippingPage() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Shipping Methods Accordion */}
|
{/* Delivery Options Accordion */}
|
||||||
<Accordion type="single" collapsible value={expandedMethod} onValueChange={(value) => {
|
<Accordion type="single" collapsible value={expandedMethod} onValueChange={(value) => {
|
||||||
setExpandedMethod(value);
|
setExpandedMethod(value);
|
||||||
if (value) {
|
if (value) {
|
||||||
@@ -629,7 +629,7 @@ export default function ShippingPage() {
|
|||||||
</DrawerHeader>
|
</DrawerHeader>
|
||||||
<div className="flex-1 overflow-y-auto px-4 py-4 min-h-0">
|
<div className="flex-1 overflow-y-auto px-4 py-4 min-h-0">
|
||||||
<div className="space-y-3">
|
<div className="space-y-3">
|
||||||
{/* Add Shipping Method Button */}
|
{/* Add Delivery Option Button */}
|
||||||
{!showAvailableMethods ? (
|
{!showAvailableMethods ? (
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
@@ -637,12 +637,12 @@ export default function ShippingPage() {
|
|||||||
onClick={() => setShowAvailableMethods(true)}
|
onClick={() => setShowAvailableMethods(true)}
|
||||||
>
|
>
|
||||||
<Plus className="h-4 w-4 mr-2" />
|
<Plus className="h-4 w-4 mr-2" />
|
||||||
{__('Add Shipping Method')}
|
{__('Add Delivery Option')}
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<div className="border rounded-lg p-3 space-y-2">
|
<div className="border rounded-lg p-3 space-y-2">
|
||||||
<div className="flex items-center justify-between mb-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
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
size="sm"
|
size="sm"
|
||||||
@@ -672,7 +672,7 @@ export default function ShippingPage() {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Shipping Methods Accordion (Mobile) */}
|
{/* Delivery Options Accordion (Mobile) */}
|
||||||
<Accordion type="single" collapsible value={expandedMethod} onValueChange={(value) => {
|
<Accordion type="single" collapsible value={expandedMethod} onValueChange={(value) => {
|
||||||
setExpandedMethod(value);
|
setExpandedMethod(value);
|
||||||
if (value) {
|
if (value) {
|
||||||
@@ -914,7 +914,6 @@ export default function ShippingPage() {
|
|||||||
<input
|
<input
|
||||||
id="zone-name"
|
id="zone-name"
|
||||||
name="name"
|
name="name"
|
||||||
type="text"
|
|
||||||
required
|
required
|
||||||
defaultValue={editingZone?.name || ''}
|
defaultValue={editingZone?.name || ''}
|
||||||
placeholder={__('e.g., Domestic, International, Europe')}
|
placeholder={__('e.g., Domestic, International, Europe')}
|
||||||
@@ -932,7 +931,6 @@ export default function ShippingPage() {
|
|||||||
|
|
||||||
{/* Search Filter */}
|
{/* Search Filter */}
|
||||||
<input
|
<input
|
||||||
type="text"
|
|
||||||
placeholder={__('Search regions...')}
|
placeholder={__('Search regions...')}
|
||||||
value={regionSearch}
|
value={regionSearch}
|
||||||
onChange={(e) => setRegionSearch(e.target.value)}
|
onChange={(e) => setRegionSearch(e.target.value)}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class NavigationRegistry {
|
|||||||
private static function get_settings_children(): array {
|
private static function get_settings_children(): array {
|
||||||
$admin = admin_url('admin.php');
|
$admin = admin_url('admin.php');
|
||||||
|
|
||||||
return [
|
$children = [
|
||||||
// WooNooW Settings
|
// WooNooW Settings
|
||||||
['label' => __('WooNooW', 'woonoow'), 'mode' => 'spa', 'path' => '/settings'],
|
['label' => __('WooNooW', 'woonoow'), 'mode' => 'spa', 'path' => '/settings'],
|
||||||
|
|
||||||
@@ -177,7 +177,14 @@ class NavigationRegistry {
|
|||||||
['label' => __('Store Details', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/store'],
|
['label' => __('Store Details', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/store'],
|
||||||
['label' => __('Payments', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/payments'],
|
['label' => __('Payments', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/payments'],
|
||||||
['label' => __('Shipping & Delivery', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/shipping'],
|
['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' => __('Checkout', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/checkout'],
|
||||||
['label' => __('Customer Accounts', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/customers'],
|
['label' => __('Customer Accounts', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/customers'],
|
||||||
['label' => __('Notifications', 'woonoow'), 'mode' => 'spa', 'path' => '/settings/notifications'],
|
['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' => __('Integrations', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-settings&tab=integration'],
|
||||||
['label' => __('System Status', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-status'],
|
['label' => __('System Status', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-status'],
|
||||||
['label' => __('Extensions', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-addons'],
|
['label' => __('Extensions', 'woonoow'), 'mode' => 'bridge', 'href' => $admin . '?page=wc-addons'],
|
||||||
];
|
]);
|
||||||
|
|
||||||
|
return $children;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user