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
+9
View File
@@ -9,6 +9,7 @@ class OrderSyncService
public function __construct(
private PluginClient $client,
private OrderIngestService $orders,
private CatalogSyncService $catalog,
) {}
public function syncOrders(WooStore $store): int
@@ -18,11 +19,19 @@ class OrderSyncService
return 0;
}
if (isset($response['currency']) || isset($response['currency_symbol'])) {
$this->catalog->applyStoreMeta($store, $response);
}
$items = $response['data'] ?? $response;
if (! is_array($items)) {
return 0;
}
if (array_is_list($items) === false && isset($response['data']) === false) {
$items = array_values(array_filter($items, fn ($item) => is_array($item) && (isset($item['id']) || isset($item['number']))));
}
$count = 0;
foreach ($items as $item) {
if (! is_array($item)) {