Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

Commit

Permalink
#90659 update Amasty modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ofrankowska committed Jun 22, 2022
1 parent 86f09c2 commit 6557490
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 72 deletions.
25 changes: 3 additions & 22 deletions Amasty_GdprCookie/templates/cookiebar.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ $confirmationModal = \Amasty\GdprCookie\Model\Config\Source\CookiePolicyBarStyle
$confirmationPopup = \Amasty\GdprCookie\Model\Config\Source\CookiePolicyBarStyle::CONFIRMATION_POPUP;
$confirmationClassic = \Amasty\GdprCookie\Model\Config\Source\CookiePolicyBarStyle::CONFIRMATION;

$cookiePrivacyTextJson = $block->getNotificationText();
$cookiePrivacyText = json_decode($cookiePrivacyTextJson, true);
$widget = $this->getLayout()->createBlock('Amasty\GdprCookie\Block\Widget\Settings');
$groupData = $widget->getGroupData()['groupData'];

Expand Down Expand Up @@ -41,8 +39,7 @@ $settingsTextColorHover = $block->getSettingsTextColorHover();
*/
?>
<?php if (!strpos($block->getRequest()->getRequestUri(), 'cookie-settings')): ?>
<?php if (($block->getNoticeType() === $confirmationModal ||
$block->getNoticeType() === $confirmationPopup) && $cookiePrivacyText): ?>
<?php if ($block->getNoticeType() === $confirmationModal): ?>
<div class="modals-wrapper">
<div
data-role="gdpr-cookie-container"
Expand Down Expand Up @@ -183,13 +180,6 @@ $settingsTextColorHover = $block->getSettingsTextColorHover();
</a>
</div>
<?php endforeach; ?>
<p
<?php if ($policyTextColor): ?>
style="color: <?= $escaper->escapeHtml($policyTextColor);?>"
<?php endif ?>
>
<?= /** @noEscape */ $cookiePrivacyText ?>
</p>
</div>

<div class="modal__bottom">
Expand Down Expand Up @@ -232,7 +222,7 @@ $settingsTextColorHover = $block->getSettingsTextColorHover();
</div>
</div>
</div>
<?php elseif ($block->getNoticeType() === $confirmationClassic && $cookiePrivacyText): ?>
<?php elseif ($block->getNoticeType() === $confirmationClassic): ?>
<div
data-role="gdpr-cookie-container"
class="amgdprcookie-bar-template display-none"
Expand Down Expand Up @@ -262,15 +252,6 @@ $settingsTextColorHover = $block->getSettingsTextColorHover();
class="cookie-message__container"
tabindex="0"
>
<p
class="cookie-message__text"
<?php if ($policyTextColor): ?>
style="color: <?= $escaper->escapeHtml($policyTextColor);?>"
<?php endif ?>
>
<?= /** @noEscape */ $cookiePrivacyText ?>
</p>

<div class="cookie-message__actions">
<div class="cookie-message__action">
<button
Expand Down Expand Up @@ -372,4 +353,4 @@ $settingsTextColorHover = $block->getSettingsTextColorHover();
}
<?php endif ?>
</style>
<?php endif ?>
<?php endif ?>
74 changes: 34 additions & 40 deletions Amasty_GiftCard/templates/product/price/final_price.phtml
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
<?php
/** @var \Amasty\GiftCard\Pricing\Render\FinalPriceBox $block */
$productId = $block->getSaleableItem()->getId();
/** @var $block \Amasty\GiftCard\Pricing\Render\FinalPriceBox */
/** @var $viewModel \Amasty\GiftCard\ViewModel\Price\Component\Price */
$viewModel = $block->getViewModel();
$productId = $viewModel->getSaleableItem()->getId();
?>

<?php if ($block->isProductForm() || ($block->getCanShowPrice() !== false && !$block->isProductForm())): ?>
<?php if ($block->getCanShowPrice() !== false && !$block->isProductForm()): ?>
<div class="price-box">
<?php if (!$viewModel->isSinglePrice()): ?>
<span class="price-label price__text">
<?= $escaper->escapeHtml(__('From')) ?>
</span>
<?php endif; ?>
<span
class="price__value"
id="product-price-<?= $escaper->escapeHtmlAttr($productId . $block->getIdSuffix()) ?>"
>
<?= $escaper->escapeHtml($viewModel->convertAndFormatCurrency($viewModel->getMinPrice(), false)) ?>
</span>
</div>
<?php endif; ?>

<?php if ($block->isProductForm()): ?>
<?php
$currency = $block->getCurrencyShortName();
$product = $block->getSaleableItem();
$product = $viewModel->getSaleableItem();
?>
<div
class="amgiftcard-price-container"
data-bind="scope: 'price'"
data-amcard-js="price-container"
data-bind="scope: 'price_<?= $escaper->escapeHtmlAttr($productId) ?>'"
>
<div
class="
Expand All @@ -21,7 +40,7 @@ $productId = $block->getSaleableItem()->getId();
data-bind="
visible: $data.showCustomPrice,
css: {
'opacity-0': !$data.isLoaded()
'opacity-0': $data.isLoaded() === false
}
"
>
Expand All @@ -38,12 +57,12 @@ $productId = $block->getSaleableItem()->getId();
<?= $escaper->escapeHtml(__('From')) ?>
</span>
<span
data-price-amount="<?= $block->convertCurrency($block->getMinPrice()) ?>"
data-price-amount="<?= /* @noEscape */ $viewModel->convertCurrency($block->getMinPrice()) ?>"
data-price-type="minPrice"
class="price-wrapper"
>
<span class="price__value">
<?= $escaper->escapeHtml($block->convertAndFormatCurrency($block->getMinPrice(), false)) ?>
<?= $escaper->escapeHtml(/* @noEscape */ $viewModel->convertAndFormatCurrency(/* @noEscape */ $viewModel->getMinPrice(), false)) ?>
</span>
</span>
</div>
Expand All @@ -63,12 +82,12 @@ $productId = $block->getSaleableItem()->getId();
<?= $escaper->escapeHtml(__('To')) ?>
</span>
<span
data-price-amount="<?= $block->convertCurrency($block->getMaxPrice()) ?>"
data-price-amount="<?= /* @noEscape */ $viewModel->convertCurrency($block->getMaxPrice()) ?>"
data-price-type="maxPrice"
class="price-wrapper"
>
<span class="price__value">
<?= $escaper->escapeHtml($block->convertAndFormatCurrency($block->getMaxPrice(), false)) ?>
<?= $escaper->escapeHtml(/* @noEscape */ $viewModel->convertAndFormatCurrency(/* @noEscape */ $viewModel->getMaxPrice(), false)) ?>
</span>
</span>
</span>
Expand All @@ -90,43 +109,18 @@ $productId = $block->getSaleableItem()->getId();
<span
class="price-wrapper price__value"
data-price-amount="
<?= $block->isSinglePrice()
? $escaper->escapeHtmlAttr($block->convertCurrency($block->getFinalPrice($product)))
<?= $viewModel->isSinglePrice()
? $escaper->escapeHtmlAttr(/* @noEscape */ $viewModel->convertCurrency(/* @noEscape */ $viewModel->getFinalPrice($product)))
: '0';
?>
"
data-price-type="finalPrice"
id="product-price-<?= $escaper->escapeHtmlAttr($productId . $block->getIdSuffix()) ?>"
>
<?= $escaper->escapeHtml($block->convertAndFormatCurrency($block->getMinPrice(), false)) ?>
<?= $escaper->escapeHtml(/* @noEscape */ $viewModel->convertAndFormatCurrency(/* @noEscape */ $viewModel->getMinPrice(), false)) ?>
</span>
</span>
</div>
<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/core/app": {
"components": {
"price": {
"component": "Amasty_GiftCard/js/price",
"template": "Amasty_GiftCard/price",
"prices": <?= /** @noEscape */ $block->getPredefinedAmounts() ?>,
"currencyCode": "<?= $escaper->escapeHtmlAttr($block->getCurrencyCode()) ?>",
"feeType": "<?= $escaper->escapeHtmlAttr($product->getAmGiftcardFeeType()) ?>",
"feeValue": "<?= $escaper->escapeHtmlAttr($product->getAmGiftcardFeeValue()) ?>",
"feeStatus": "<?= $escaper->escapeHtmlAttr($product->getAmGiftcardFeeEnable()) ?>",
"feeValueConverted": "<?= $escaper->escapeHtmlAttr($this->convertCurrency($product->getAmGiftcardFeeValue())) ?>",
"productId": "<?= $escaper->escapeHtmlAttr($product->getId()); ?>",
"customMinAmountCurrency": "<?= /** @noEscape */ $block->convertAndFormatCurrency($block->getOpenAmountMin(), false) ?>",
"customMaxAmountCurrency": "<?= /** @noEscape */ $block->convertAndFormatCurrency($block->getOpenAmountMax(), false) ?>",
"customMinAmount": "<?= $escaper->escapeHtmlAttr($this->convertCurrency($block->getOpenAmountMin())) ?>",
"customMaxAmount": "<?= $escaper->escapeHtmlAttr($this->convertCurrency($block->getOpenAmountMax())) ?>",
"isOpenAmount": "<?= $escaper->escapeHtmlAttr($block->isOpenAmount()) ?>",
"isSinglePrice": "<?= $escaper->escapeHtmlAttr($block->isSinglePrice()) ?>"
}
}
}
}
}
</script>

<?= $block->getPriceComponentHtml() ?>
<?php endif; ?>
23 changes: 15 additions & 8 deletions Amasty_GiftCard/templates/product/view/type/giftcard.phtml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<?php
/** @var $block \Amasty\GiftCard\Block\Product\View\Type\GiftCard */
/**
* @var $block Amasty\GiftCard\Block\Product\View\Type\GiftCard
* @var $escaper Magento\Framework\Escaper
*/

$product = $block->getProduct();
$productId = $product->getId();
?>
<!-- ko scope: 'giftCard' -->

<!-- ko scope: 'giftCard_<?= $escaper->escapeHtml($productId) ?>' -->
<div
class="
amcard-general-container
Expand Down Expand Up @@ -167,7 +173,7 @@ $product = $block->getProduct();
<!-- ko if: isShowPrices -->
<div
class="amcard-form-container"
data-bind="scope: 'price'"
data-bind="scope: 'price_<?= $escaper->escapeHtmlAttr($productId) ?>'"
>
<!-- ko template: getTemplate() --><!-- /ko -->
</div>
Expand All @@ -177,7 +183,7 @@ $product = $block->getProduct();
amcard-form-container
-interior
"
data-bind="scope: 'images'"
data-bind="scope: 'images_<?= $escaper->escapeHtmlAttr($productId) ?>'"
>
<!-- ko template: getTemplate() --><!-- /ko -->
</div>
Expand Down Expand Up @@ -332,33 +338,34 @@ $product = $block->getProduct();
<!-- ko if: isShowField('am_giftcard_date_delivery') -->
<div
class="amcard-form-container"
data-bind="scope: 'datepicker'"
data-bind="scope: 'datepicker_<?= $escaper->escapeHtmlAttr($productId) ?>'"
>
<!-- ko template: getTemplate() --><!-- /ko -->
</div>
<!-- /ko -->
</div>
<!-- /ko -->
<?= $block->getChildHtml('amgc.component.price') ?>

<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/core/app": {
"components": {
"datepicker": {
"datepicker_<?= $escaper->escapeHtml($productId) ?>": {
"component": "Amasty_GiftCard/js/datepicker",
"template": "Amasty_GiftCard/datepicker",
"timezones": <?= /* @noEscape */ $block->getListTimezones() ?>
},
"images": {
"images_<?= $escaper->escapeHtml($productId) ?>": {
"component": "Amasty_GiftCard/js/images",
"template": "Amasty_GiftCard/images",
"images": <?= /* @noEscape */ $block->getImages() ?>,
"isCustomImageAllowed": <?= /* @noEscape */ (int)$block->getAllowUsersUploadImages() ?>,
"tooltip": "<?= $escaper->escapeHtml($block->getTooltipContent()) ?>",
"customImageUrl": "<?= $escaper->escapeUrl($block->getCustomImageUrl()) ?>"
},
"giftCard": {
"giftCard_<?= $escaper->escapeHtml($productId) ?>": {
"component": "Amasty_GiftCard/js/giftcard",
"giftCardType": "<?= /* @noEscape */ $product->getAmGiftcardType() ?>",
"previewUrl": "<?= $escaper->escapeUrl($block->getUrl('amgcard/preview/getPreviewContent')) ?>",
Expand Down
3 changes: 1 addition & 2 deletions Amasty_Storelocator/web/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ define([
'mage/translate',
'noUiSlider',
'Amasty_Storelocator/vendor/jquery.ui.touch-punch.min',
'Magento_Ui/js/lib/knockout/bindings/range',
'Magento_Ui/js/modal/modal'
'Magento_Ui/js/lib/knockout/bindings/range'
], function ($, $t, noUiSlider) {

$.widget('mage.amLocator', {
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ USE GITHUB ISSUE/PULL REQUEST NUMBERS, NOT INTERNAL ONE
- syntax error, `unexpected ','` in `Magento_Catalog/templates/product/widget/viewed/list.phtml` (#560)
### Removed
### Updated
- amasty/module-gdpr => 2.8.3
- amasty/module-gift-card => 2.8.4
- amasty/module-store-locator => 2.5.3
- amasty/shiprules => 2.8.3

## [Released]
## [2.27.0] - 2022-06-14
Expand Down

0 comments on commit 6557490

Please sign in to comment.