Use WooCommerce store currency for product and order money.
Deploy Ladill Woo Manager / deploy (push) Successful in 35s

Sync currency from the plugin, format product prices and totals with it, and show the store currency on product price fields instead of hard-coding GHS.
This commit is contained in:
isaacclad
2026-07-24 15:38:07 +00:00
parent f7eed690ab
commit e709de6593
9 changed files with 234 additions and 9 deletions
+17 -2
View File
@@ -64,9 +64,24 @@ class WooProduct extends Model
return '—';
}
$currency = strtoupper((string) ($this->store?->metadata['currency'] ?? 'GHS'));
if ($this->relationLoaded('store') || $this->store) {
return $this->store->formatMoney($minor);
}
return $currency.' '.number_format($minor / 100, 2);
return number_format($minor / 100, 2);
}
public function regularPriceFormatted(): string
{
if ($this->regular_price_minor === null) {
return '—';
}
if ($this->relationLoaded('store') || $this->store) {
return $this->store->formatMoney((int) $this->regular_price_minor);
}
return number_format(((int) $this->regular_price_minor) / 100, 2);
}
public function statusLabel(): string