Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Hello,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.
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 . "'");
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']) . "'");
}
}
}
Thank you!!
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.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Event Triggers is rather suggested than editing core methods.galbeazaionut wrote: ↑Thu Dec 02, 2021 3:46 pmHello,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.
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:
After this I have this function and I think the $data['products'] is empty.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 . "'");
The function is: editOrder($order_id, $data)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']) . "'"); } } }
Thank you!!
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
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
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Users browsing this forum: OSWorX and 418 guests