Use WooCommerce store currency for product and order money.
Deploy Ladill Woo Manager / deploy (push) Successful in 35s
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:
@@ -30,7 +30,13 @@ class OrderIngestService
|
||||
->all();
|
||||
|
||||
$totalMinor = (int) round(((float) ($payload['total'] ?? 0)) * 100);
|
||||
$currency = strtoupper((string) ($payload['currency'] ?? 'GHS'));
|
||||
$currency = strtoupper(trim((string) ($payload['currency'] ?? '')));
|
||||
if (preg_match('/^[A-Z]{3}$/', $currency) !== 1) {
|
||||
$currency = $store->currency();
|
||||
}
|
||||
if ($currency === '') {
|
||||
$currency = 'XXX';
|
||||
}
|
||||
|
||||
$wcUpdatedAt = isset($payload['date_modified_gmt'])
|
||||
? Carbon::parse($payload['date_modified_gmt'].' UTC')
|
||||
|
||||
Reference in New Issue
Block a user