Skip to content

Commit 7b87017

Browse files
committed
actually commit the right code
1 parent 82f79fd commit 7b87017

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/Tags/Shopify.php

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
namespace StatamicRadPack\Shopify\Tags;
44

5-
use NumberFormatter;
65
use Shopify\Clients\Rest;
76
use Statamic\Extensions\Pagination\LengthAwarePaginator;
87
use Statamic\Facades\Entry;
9-
use Statamic\Facades\Site;
108
use Statamic\Facades\User;
119
use Statamic\Support\Arr;
1210
use Statamic\Support\Str;
@@ -65,23 +63,10 @@ public function productPrice()
6563

6664
$price = $pricePluck->sort()->first();
6765

68-
$payload = [
66+
$payload = $this->runHooksWith('product-price', [
6967
'currency' => config('shopify.currency'),
7068
'price' => $price,
71-
];
72-
73-
$this->runHooksWith('shopify-price', $payload);
74-
75-
// try to use currency
76-
if (($currencyCode = config('shopify.currency_code')) && class_exists('NumberFormatter')) {
77-
try {
78-
$formatter = new \NumberFormatter(Site::current()->locale(), \NumberFormatter::CURRENCY);
79-
80-
$price = $formatter->formatCurrency((float) $price, $currencyCode);
81-
82-
$currencyString = ''; // blank this as its included in price
83-
} catch (\Throwable $e) { }
84-
}
69+
]);
8570

8671
if ($pricePluck->count() > 1 && $this->params->get('show_from') === true) {
8772
return __('shopify::messages.display_price_from', ['currency' => $payload->currency, 'price' => $payload->price]);

0 commit comments

Comments
 (0)