diff --git a/_dev/js/customer.js b/_dev/js/customer.js index 65e38d27..91798be4 100644 --- a/_dev/js/customer.js +++ b/_dev/js/customer.js @@ -26,11 +26,8 @@ import $ from 'jquery'; import prestashop from 'prestashop'; function initRmaItemSelector() { - $(`${prestashop.themeSelectors.order.returnForm} table thead input[type=checkbox]`).on('click', function () { - const checked = $(this).prop('checked'); - $(`${prestashop.themeSelectors.order.returnForm} table tbody input[type=checkbox]`).each((_, checkbox) => { - $(checkbox).prop('checked', checked); - }); + $(prestashop.themeSelectors.order.returnFormCheckAll).on('click', function () { + $(prestashop.themeSelectors.order.returnFormCheckItem).prop('checked', this.checked); }); } @@ -40,4 +37,4 @@ function setupCustomerScripts() { } } -$(document).ready(setupCustomerScripts); +$(setupCustomerScripts); diff --git a/_dev/js/selectors.js b/_dev/js/selectors.js index d0a7e8cb..26bf84ae 100644 --- a/_dev/js/selectors.js +++ b/_dev/js/selectors.js @@ -68,7 +68,8 @@ prestashop.themeSelectors = { searchLink: '.js-search-link', }, order: { - returnForm: '#order-return-form, .js-order-return-form', + returnFormCheckItem: '.js-order-return-check-item', + returnFormCheckAll: '.js-order-return-check-all', }, arrowDown: '.arrow-down, .js-arrow-down', arrowUp: '.arrow-up, .js-arrow-up', diff --git a/templates/customer/_partials/order-detail-return.tpl b/templates/customer/_partials/order-detail-return.tpl index 9820b2f6..a6ce29fa 100644 --- a/templates/customer/_partials/order-detail-return.tpl +++ b/templates/customer/_partials/order-detail-return.tpl @@ -29,7 +29,9 @@ - + @@ -42,7 +44,13 @@
+ + {l s='Product' d='Shop.Theme.Catalog'} {l s='Quantity' d='Shop.Theme.Catalog'} {l s='Returned' d='Shop.Theme.Customeraccount'} {if !$product.is_virtual} - + {/if}