Post by adi_555 » Mon Jul 30, 2012 10:11 pm

Hi,

Whenever an order is placed either through admin or front end. OC automatically adds products to the order after clicking confirm page/step. Now the strangest part is that every product has specific items which is added.

For example
- if i buy product 1 then product x and product y are added which are disabled in admin
- if i place order for product 2 then product c, product d, product m are also added in order history page's.


EDIT: Database repair command solved the issue (Problem redundant data) Thanks Daniel.
Last edited by adi_555 on Fri Aug 03, 2012 1:12 am, edited 3 times in total.

Active Member

Posts

Joined
Mon Nov 08, 2010 6:21 pm

Post by uksitebuilder » Mon Jul 30, 2012 10:37 pm

Most likely something went wrong when importing the database tables

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by adi_555 » Mon Jul 30, 2012 10:41 pm

tables seems to be proper, what could be other cause? if any?

Active Member

Posts

Joined
Mon Nov 08, 2010 6:21 pm

Post by adi_555 » Tue Jul 31, 2012 4:12 am

anyone?

Active Member

Posts

Joined
Mon Nov 08, 2010 6:21 pm

Post by uksitebuilder » Tue Jul 31, 2012 5:22 pm

Are all your order numbers sequential in the order table ?

Also check the order_product table to see if for instance there are entries in there with order numbers that have not ye occurred in the order table.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by adi_555 » Tue Jul 31, 2012 6:08 pm

uksitebuilder wrote:Are all your order numbers sequential in the order table ?

Also check the order_product table to see if for instance there are entries in there with order numbers that have not ye occurred in the order table.

Yes order number are in sequence. and order_product table only have the products which are placed in orders. nothing extra

Active Member

Posts

Joined
Mon Nov 08, 2010 6:21 pm

Post by uksitebuilder » Tue Jul 31, 2012 6:12 pm

The only other thing I can think of is that your account has a permanent cart stored in the DB

So, for example you go to the site (not logged) and add items to your cart.

Then you go to checkout and login during checkout. This will merge the cart items with any previously stored cart items in the account.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by adi_555 » Tue Jul 31, 2012 6:15 pm

uksitebuilder wrote:The only other thing I can think of is that your account has a permanent cart stored in the DB

So, for example you go to the site (not logged) and add items to your cart.

Then you go to checkout and login during checkout. This will merge the cart items with any previously stored cart items in the account.

Which table stores the temp cart information maybe i can check that and this problem is happening with new accounts also :(

Active Member

Posts

Joined
Mon Nov 08, 2010 6:21 pm

Post by uksitebuilder » Tue Jul 31, 2012 6:27 pm

If it is happening with new accounts, then that wont be the problem as the data for the cart is stored in the customer table

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by adi_555 » Tue Jul 31, 2012 6:31 pm

I am even checking the missing orders and i see one order on 18/7/2012 which is just one product that means it was working fine until 18th.

And checking the scripts nothing is modified post 16/7/2012. This is really very strange :S

Active Member

Posts

Joined
Mon Nov 08, 2010 6:21 pm

Post by Out2lunch » Tue Jul 31, 2012 8:33 pm

We had a similar thing happen to us, what we found out is that if the Office girls are shopping as customers, they end up sharing items in their carts. This seems to be due to the temp cart being logged to an IP address not to a cart id or something.

Could this be your problem?

New member

Posts

Joined
Wed Jun 29, 2011 9:32 pm

Post by adi_555 » Tue Jul 31, 2012 9:01 pm

Out2lunch wrote:We had a similar thing happen to us, what we found out is that if the Office girls are shopping as customers, they end up sharing items in their carts. This seems to be due to the temp cart being logged to an IP address not to a cart id or something.

Could this be your problem?

I had the very same question in mind but then I used another system with new IP and created a new account but still the same problem!

Active Member

Posts

Joined
Mon Nov 08, 2010 6:21 pm

Post by adi_555 » Wed Aug 01, 2012 5:16 am

UPDATE: I commented the following code in Catalog/model/checkout/order.php

Code: Select all

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'] . "'");
and the problem still persists! however the original product ordered is not added. I want to know from where is it getting the product because it is not there in product table!

Active Member

Posts

Joined
Mon Nov 08, 2010 6:21 pm

Post by straightlight » Wed Aug 01, 2012 6:52 am

We had a similar thing happen to us, what we found out is that if the Office girls are shopping as customers, they end up sharing items in their carts. This seems to be due to the temp cart being logged to an IP address not to a cart id or something.

Could this be your problem?
One point being correct on this question would be to state that the IP address is in fact being logged and not the cart ID since there are no cart ID involved but rather a cart string stored into the customers table in the database but this methodology is only applied with customers. Although, once the customer / guest is being sent to the checkout success page, the cart session is being destroyed since we no longer need it as the order has been created and stored in the orders table along with the products, options and downloads when applicable.

Based on what's been said above, if the order products table itself is flexible but only in the admin should you notice this strange behavior starting from a specific date time and that before that time period everything's fine, it would be first knowing if you're noticing these events from the core or with installed contributions which may affect specific orders based on specific queries or due to a mass size of data of orders your order database table may contain.

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 adi_555 » Wed Aug 01, 2012 7:44 am

I am also noticing that same products are being added. And these products are deleted from products table.

Active Member

Posts

Joined
Mon Nov 08, 2010 6:21 pm

Post by rph » Wed Aug 01, 2012 2:09 pm

Are you sure you're connecting to the right database?

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska

Post by adi_555 » Wed Aug 01, 2012 4:00 pm

rph wrote:Are you sure you're connecting to the right database?
Yes its the right database.

Active Member

Posts

Joined
Mon Nov 08, 2010 6:21 pm
Who is online

Users browsing this forum: No registered users and 80 guests