From 1f050a7f0b409b47ed7693a31780549d0a28eb0f Mon Sep 17 00:00:00 2001 From: Daniel Kerr Date: Thu, 4 Apr 2024 11:39:41 +0800 Subject: [PATCH] https://github.com/opencart/opencart/issues/12661 --- upload/admin/view/template/sale/order_info.twig | 14 +++++++------- upload/catalog/controller/api/sale/cart.php | 3 +++ upload/catalog/controller/api/sale/order.php | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/upload/admin/view/template/sale/order_info.twig b/upload/admin/view/template/sale/order_info.twig index 3331aa64889..7f84892e916 100644 --- a/upload/admin/view/template/sale/order_info.twig +++ b/upload/admin/view/template/sale/order_info.twig @@ -2092,7 +2092,7 @@ $('#input-payment-address').on('change', function() { var element = this; $.ajax({ - url: 'index.php?route=customer/customer.address&user_token={{ user_token }}&address_id=' + this.value, + url: 'index.php?route=customer/address.address&user_token={{ user_token }}&address_id=' + this.value, dataType: 'json', beforeSend: function() { $(element).prop('disabled', true); @@ -2263,7 +2263,7 @@ $('#input-shipping-address').on('change', function() { var element = this; $.ajax({ - url: 'index.php?route=customer/customer.address&user_token={{ user_token }}&address_id=' + this.value, + url: 'index.php?route=customer/address.address&user_token={{ user_token }}&address_id=' + this.value, dataType: 'json', beforeSend: function() { $(element).prop('disabled', true); @@ -2347,23 +2347,23 @@ $('#form-shipping-address').on('submit', function(e) { if (json['success']) { $('#form-shipping-address').prepend('
' + json['success'] + '
'); - var address = $('#input-shipping-firstname').val() + ' ' + $('#input-shipping-lastname').val() + "
"; + var address = $('#input-shipping-firstname').val() + ' ' + $('#input-shipping-lastname').val() + '
'; var company = $('#input-shipping-company').val(); if (company) { - address += $('#input-shipping-company').val() + "
"; + address += $('#input-shipping-company').val() + '
'; } - address += $('#input-shipping-address-1').val() + "
"; + address += $('#input-shipping-address-1').val() + '
'; var address_2 = $('#input-shipping-address-2').val(); if (address_2) { - address += $('#input-shipping-address-2').val() + "
"; + address += $('#input-shipping-address-2').val() + '
'; } - address += $('#input-shipping-city').val() + "
"; + address += $('#input-shipping-city').val() + '
'; var postcode = $('#input-shipping-postcode').val(); diff --git a/upload/catalog/controller/api/sale/cart.php b/upload/catalog/controller/api/sale/cart.php index 4355fdf349d..1387744b5d5 100644 --- a/upload/catalog/controller/api/sale/cart.php +++ b/upload/catalog/controller/api/sale/cart.php @@ -178,6 +178,9 @@ public function add(): void { if (!$json) { $this->cart->add($product_id, $quantity, $option, $subscription_plan_id); + print_r($this->cart->getProducts()); + + $json['success'] = $this->language->get('text_success'); } diff --git a/upload/catalog/controller/api/sale/order.php b/upload/catalog/controller/api/sale/order.php index 0f2d18b65b2..42f613d0a0a 100755 --- a/upload/catalog/controller/api/sale/order.php +++ b/upload/catalog/controller/api/sale/order.php @@ -727,9 +727,9 @@ public function delete(): void { $selected[] = (int)$this->request->get['order_id']; } - foreach ($selected as $order_id) { - $this->load->model('checkout/order'); + $this->load->model('checkout/order'); + foreach ($selected as $order_id) { $order_info = $this->model_checkout_order->getOrder($order_id); if ($order_info) {