Skip to content

Commit

Permalink
Merge pull request #157 from tblivet/fix/issue-37194
Browse files Browse the repository at this point in the history
Fix: issue 37194
  • Loading branch information
ga-devfront authored Oct 22, 2024
2 parents efb5fa7 + acd52d3 commit a6b9f7c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
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

0 comments on commit a6b9f7c

Please sign in to comment.