Skip to content

Select carrier shipping method radios by value instead of index - #1102

Merged
Progi1984 merged 1 commit into
PrestaShop:mainfrom
jolelievre:fix-carrier-shipping-method-selector
Aug 19, 2026
Merged

Select carrier shipping method radios by value instead of index#1102
Progi1984 merged 1 commit into
PrestaShop:mainfrom
jolelievre:fix-carrier-shipping-method-selector

Conversation

@jolelievre

Copy link
Copy Markdown
Contributor

Why

PrestaShop/PrestaShop#42022 adds a new first choice to the carrier form's shipping method (Based on the shop configuration, ShippingMethod::DEFAULT = 0). The BO carrier create page object selected the billing radios by their positional Symfony ids (#carrier_shipping_settings_shipping_method_0 / _1), so the new option shifted every index: asking for a billing by weight actually selected by price. The carrier ranges were then stored as price ranges, and functional/BO/09_shipping/01_carriers/01_CRUDCarrier.ts failed because the updated carrier became out of range and hidden in the FO checkout whenever the random out-of-range behavior was Disable carrier.

What

  • Target the shipping method radios by their submitted value attribute instead of their index. The values map to the stable ShippingMethod constants (1 = by weight, 2 = by price) on every PrestaShop version, so the selectors are retro-compatible regardless of the choice order.
  • Add a billingConfigRadioButton selector (value="0") and handle Based on the shop configuration in createEditCarrier, so campaigns can select the new option.

The BO carrier form gains a new first choice for the shipping method
(based on the shop configuration), which shifts the positional Symfony
ids the page object relied on: asking for a billing by weight ended up
selecting the billing by price.

The radios are now targeted by their submitted value, which maps to the
stable ShippingMethod constants whatever the choice order or the
PrestaShop version. A selector and a billing branch are added for the
new shop configuration option so campaigns can select it.
@jolelievre
jolelievre requested a review from a team as a code owner August 19, 2026 16:00
@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard Aug 19, 2026
@jolelievre

jolelievre commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Hi @Progi1984

can you check this update please? It's related to this PR PrestaShop/PrestaShop#42022
That adds an option on delivery setting that was forgotten (use default config), so ther's a new option that changes the initial order. The selectors have been changed in a retr-compatible way because they map the actual value now, not the order of the radio buttons, so no need to split by versions.

I'll update the PR to temporarily use this branch to make sure this fixes the UI tests

The shipping campaign should be fixed in this run now https://github.com/jolelievre/ga.tests.ui.pr/actions/runs/32172262419 (in progress)

Comment thread src/versions/develop/pages/BO/shipping/carriers/create.ts
@Progi1984
Progi1984 merged commit 4c1098d into PrestaShop:main Aug 19, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for review to Merged in PR Dashboard Aug 19, 2026
@ps-jarvis ps-jarvis moved this from Merged to Ready for review in PR Dashboard Aug 19, 2026
@ps-jarvis

Copy link
Copy Markdown

PR merged, well done!

Message to @PrestaShop/committers: do not forget to milestone it before the merge.

@Progi1984 Progi1984 added this to the 0.0.12 milestone Aug 19, 2026
@jolelievre
jolelievre deleted the fix-carrier-shipping-method-selector branch August 20, 2026 06:30
@jolelievre

Copy link
Copy Markdown
Contributor Author

Thanks @Progi1984

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

3 participants