Post by JNeuhoff » Tue Nov 30, 2021 8:21 pm

@galbeazaionut : You are not telling us the whole story here. For a start, don't use Journal3, or at least, don't use the Journal3 onepage checkout. And don't use CloudFlare. And check for other extensions which might cause problems. In a standard OpenCart, this issue doesn't exist.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by galbeazaionut » Thu Dec 02, 2021 3:46 pm

JNeuhoff wrote:
Tue Nov 30, 2021 8:21 pm
@galbeazaionut : You are not telling us the whole story here. For a start, don't use Journal3, or at least, don't use the Journal3 onepage checkout. And don't use CloudFlare. And check for other extensions which might cause problems. In a standard OpenCart, this issue doesn't exist.
Hello,
I used 3.0.3.1 with journal 3.
Only in this server I have problem with journal 3 (I have 3 shops with 3 different domains). I used journal 3 in another stores and all work fine.
After 15 - 20 orders, I got 1 order without totals and products (see the screenshot) - https://ibb.co/0hfxtTn

I investigate and I saw the first order when I enter in checkout it`s ok. (all inserts are good - oc_order, products_order etc).
Update function it`s again very good. (if I complete name, address etc, I saw the fields in database).

The problem appear when I send order. I saw the oc_order_product is empty for the order and totals in oc_order table is 0.
I think when I sent the order, the status for order is change and I have 2 lines:

Code: Select all

$this->db->query("DELETE FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "'");
After this I have this function and I think the $data['products'] is empty.

Code: Select all

if (isset($data['products'])) {
			foreach ($data['products'] as $product) {
				$this->db->query("INSERT INTO " . DB_PREFIX . "order_product SET order_id = '" . (int)$order_id . "', product_id = '" . (int)$product['product_id'] . "', name = '" . $this->db->escape($product['name']) . "', model = '" . $this->db->escape($product['model']) . "', quantity = '" . (int)$product['quantity'] . "', price = '" . (float)$product['price'] . "', total = '" . (float)$product['total'] . "', tax = '" . (float)$product['tax'] . "', reward = '" . (int)$product['reward'] . "'");

				$order_product_id = $this->db->getLastId();

				foreach ($product['option'] as $option) {
					$this->db->query("INSERT INTO " . DB_PREFIX . "order_option SET order_id = '" . (int)$order_id . "', order_product_id = '" . (int)$order_product_id . "', product_option_id = '" . (int)$option['product_option_id'] . "', product_option_value_id = '" . (int)$option['product_option_value_id'] . "', name = '" . $this->db->escape($option['name']) . "', `value` = '" . $this->db->escape($option['value']) . "', `type` = '" . $this->db->escape($option['type']) . "'");
				}
			}
		}
The function is: editOrder($order_id, $data)

Thank you!!

New member

Posts

Joined
Wed Feb 12, 2020 6:52 pm

Post by ADD Creative » Thu Dec 02, 2021 5:52 pm

galbeazaionut wrote:
Thu Dec 02, 2021 3:46 pm
The function is: editOrder($order_id, $data)
In unmodified OpenCart, editOrder is only called from the api/order/edit API function, which is only called when you manually edit the order in the admin.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by JNeuhoff » Thu Dec 02, 2021 6:29 pm

You'll have to disable the Journal3 onepage checkout. Do a quick Google search, and you'll find that even the Journal3 framework authors are aware of this bug. This is not an OpenCart bug!

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by straightlight » Thu Dec 02, 2021 7:50 pm

galbeazaionut wrote:
Thu Dec 02, 2021 3:46 pm
JNeuhoff wrote:
Tue Nov 30, 2021 8:21 pm
@galbeazaionut : You are not telling us the whole story here. For a start, don't use Journal3, or at least, don't use the Journal3 onepage checkout. And don't use CloudFlare. And check for other extensions which might cause problems. In a standard OpenCart, this issue doesn't exist.
Hello,
I used 3.0.3.1 with journal 3.
Only in this server I have problem with journal 3 (I have 3 shops with 3 different domains). I used journal 3 in another stores and all work fine.
After 15 - 20 orders, I got 1 order without totals and products (see the screenshot) - https://ibb.co/0hfxtTn

I investigate and I saw the first order when I enter in checkout it`s ok. (all inserts are good - oc_order, products_order etc).
Update function it`s again very good. (if I complete name, address etc, I saw the fields in database).

The problem appear when I send order. I saw the oc_order_product is empty for the order and totals in oc_order table is 0.
I think when I sent the order, the status for order is change and I have 2 lines:

Code: Select all

$this->db->query("DELETE FROM " . DB_PREFIX . "order_product WHERE order_id = '" . (int)$order_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "order_option WHERE order_id = '" . (int)$order_id . "'");
After this I have this function and I think the $data['products'] is empty.

Code: Select all

if (isset($data['products'])) {
			foreach ($data['products'] as $product) {
				$this->db->query("INSERT INTO " . DB_PREFIX . "order_product SET order_id = '" . (int)$order_id . "', product_id = '" . (int)$product['product_id'] . "', name = '" . $this->db->escape($product['name']) . "', model = '" . $this->db->escape($product['model']) . "', quantity = '" . (int)$product['quantity'] . "', price = '" . (float)$product['price'] . "', total = '" . (float)$product['total'] . "', tax = '" . (float)$product['tax'] . "', reward = '" . (int)$product['reward'] . "'");

				$order_product_id = $this->db->getLastId();

				foreach ($product['option'] as $option) {
					$this->db->query("INSERT INTO " . DB_PREFIX . "order_option SET order_id = '" . (int)$order_id . "', order_product_id = '" . (int)$order_product_id . "', product_option_id = '" . (int)$option['product_option_id'] . "', product_option_value_id = '" . (int)$option['product_option_value_id'] . "', name = '" . $this->db->escape($option['name']) . "', `value` = '" . $this->db->escape($option['value']) . "', `type` = '" . $this->db->escape($option['type']) . "'");
				}
			}
		}
The function is: editOrder($order_id, $data)

Thank you!!
Event Triggers is rather suggested than editing core methods.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by JNeuhoff » Thu Dec 02, 2021 8:53 pm

Again, your description is quite vague! Don't use the Journal3 single-page checkout. Editing an order in the admin backend is a different thing and won't cause an order_total=0 from a frontend's order submission.

A standard OpenCart frontend adds all the ordered items to the 'oc_order_product' for the given order_id just fine during its checkout. And the customer can edit the order before the final checkout which triggers calls to OpenCart's system/library/cart.php for methods add, update or remove. There are no bugs there.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by gadalla » Tue Oct 24, 2023 4:24 pm

Is there any update on this issue? I'm currently encountering the same problem.

Newbie

Posts

Joined
Wed Nov 02, 2016 3:00 am

Post by JNeuhoff » Tue Oct 24, 2023 6:19 pm

Contact the Journal3 support for this. There are no issues with the OpenCart order total.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: sidclel and 86 guests