Merge trunk

This commit is contained in:
Emili Castells Guasch 2023-11-07 09:25:59 +01:00
commit aa1942b604
30 changed files with 589 additions and 48 deletions

View file

@ -71,6 +71,8 @@ class ChangeCartEndpoint extends AbstractCartEndpoint {
* @throws Exception On error.
*/
protected function handle_data(): bool {
$data = $this->request_data->read_request( $this->nonce() );
$this->cart_products->set_cart( $this->cart );
$products = $this->products_from_request();
@ -79,7 +81,9 @@ class ChangeCartEndpoint extends AbstractCartEndpoint {
return false;
}
$this->shipping->reset_shipping();
if ( ! ( $data['keepShipping'] ?? false ) ) {
$this->shipping->reset_shipping();
}
if ( ! $this->add_products( $products ) ) {
return false;