ShippingRateWidget ajax refresh does not refresh other form elements

Created on 28 July 2023, over 1 year ago
Updated 13 August 2024, 5 months ago

Problem/Motivation

The current ajaxRefresh function defined in the ShippingRateWidget class is used to refresh specific parts of the form when a different rate is selected. However if you extend a form with that widget embedded in it with something that changes depending on the selected rate then that extra form element is never refreshed during ajaxRefresh.

Proposed resolution

Core Commerce added AjaxFormTrait to refresh whole forms. Switch to using that instead of a specially crafted ajaxRefresh function. Less code, broader compatibility.

Tests

Need to ensure there are no regressions. The following issues need to be doubled checked
#3303080: The order summary is not refreshed if it is not in the checkout sidebar
#3227281: Selecting a shipping rate should refresh the shipments form

Edge cases in the original issue that added ajax need to be double checked. I think those were all related to other code flow issues that won't be touched by this change. I will write out a list of situations that need to be verified working in another edit.
#2898118: Update the order summary via AJAX when a shipping rate is selected

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States rhovland Oregon

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024