Skip to content

Commit

Permalink
FFWEB-3004: Implement new localization and formatting
Browse files Browse the repository at this point in the history
Implement new localization and formatting
  • Loading branch information
Rayn93 authored Mar 22, 2024
1 parent 318d471 commit 6439d20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/view/frontend/templates/ff/communication.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ $parameters = $viewModel->getParameters($communicationParameters);
factfinder.config.apiKey = `<?= $escaper->escapeHtml($parameters['api_key'])?>`;
factfinder.config.fieldRoles = <?= /* @noEscape */ $viewModel->getFieldRoles() ?>;

factfinder.config.formatting = {
locale: `<?= $escaper->escapeUrl($parameters['currency-country-code'])?>`,
formatOptions: {
style: `currency`,
currency: `<?= $escaper->escapeUrl($parameters['currency-code'])?>`,
},
};

// This is also the best place to invoke a search request replacing the `search-immediate` attribute.

factfinder.request.before.search(({ searchParams, searchOptions }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/view/frontend/templates/ff/record-list.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $viewModel = $block->getViewModel();
<div class="price-box price-final_price" data-role="priceBox">
<span class="price-container price-final_price tax weee">
<span data-price-amount="{{masterValues.Price}}" data-price-type="finalPrice" class="price-wrapper">
<span class="price">{{masterValues.Price}}</span>
<span class="price">{{$ masterValues.Price}}</span>
</span>
</span>
</div>
Expand Down

0 comments on commit 6439d20

Please sign in to comment.