Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: issue 37194 #157

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions _dev/css/components/checkout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,6 @@ body#checkout {
}

.delivery-options {
> .row {
border-right: 0.1rem solid darken($gray-lighter, 20%);
}

.delivery-option {
min-height: 80px;
padding: 0.9375rem 0;
Expand Down Expand Up @@ -407,6 +403,10 @@ body#checkout {
width: 3.125rem;
}
}

.carrier-extra-content {
padding-block-end: 1rem;
}
}

.carrier-delay,
Expand Down
9 changes: 7 additions & 2 deletions _dev/js/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ $(document).ready(() => {
}
// Hide all carrier extra content ...
$(prestashop.themeSelectors.checkout.carrierExtraContent).hide();
// and show the one related to the selected carrier
params.deliveryOption.next(prestashop.themeSelectors.checkout.carrierExtraContent).slideDown();

// Show the one related to the selected carrier
const carrierExtraContent = params.deliveryOption.next(prestashop.themeSelectors.checkout.carrierExtraContent);

if (carrierExtraContent.html().trim() !== '') {
carrierExtraContent.slideDown();
}
});
});
4 changes: 2 additions & 2 deletions templates/checkout/_partials/steps/shipping.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{block name='delivery_options'}
<div class="delivery-options">
{foreach from=$delivery_options item=carrier key=carrier_id}
<div class="row delivery-option js-delivery-option">
<div class="delivery-option js-delivery-option">
<div class="col-sm-1">
<span class="custom-radio float-xs-left">
<input type="radio" name="delivery_option[{$id_address}]" id="delivery_option_{$carrier.id}" value="{$carrier_id}"{if $delivery_option == $carrier_id} checked{/if}>
Expand Down Expand Up @@ -71,7 +71,7 @@
</div>
</label>
</div>
<div class="row carrier-extra-content js-carrier-extra-content"{if $delivery_option != $carrier_id} style="display:none;"{/if}>
<div class="carrier-extra-content js-carrier-extra-content"{if ($delivery_option != $carrier_id) || ($delivery_option == $carrier_id && empty($carrier.extraContent))} style="display:none;"{/if}>
{$carrier.extraContent nofilter}
</div>
<div class="clearfix"></div>
Expand Down
Loading