Skip to content

Commit

Permalink
created getShopifyCurrencyRate func
Browse files Browse the repository at this point in the history
  • Loading branch information
rozhnovaYana committed May 14, 2024
1 parent de38bfd commit c209e5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
5 changes: 1 addition & 4 deletions snippets/findify-filter-checkbox.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@
containerElement?.classList.remove(openClass);
document.documentElement.classList.remove('no-scroll');
if (name === 'price') {
const rate = window.findifyBGOperationsBlockSettings
?.useCurrencyConverter
? window.Shopify?.currency?.rate
: 1;
const rate = findify.utils.getShopifyCurrencyRate();
value = value.replace(/\d+(\.\d+)?/g, (num) =>
+num ? (+num / rate)?.toFixed(2) : num,
);
Expand Down
4 changes: 1 addition & 3 deletions snippets/findify-filter-price-range.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
const submitBtnElement = document.getElementById(submit_btn_selector_id);
const onSubmitHandler = () => {
const rate = window.findifyBGOperationsBlockSettings?.useCurrencyConverter
? window.Shopify?.currency?.rate
: 1;
const rate = findify.utils.getShopifyCurrencyRate();
let from = (fromInputElement.value / rate).toFixed(4);
let to = (toInputElement.value / rate).toFixed(4);
Expand Down

0 comments on commit c209e5d

Please sign in to comment.