keat Posted March 17, 2016 Share Posted March 17, 2016 I've uncovered an issue with Order Count in the database. I have a number of customers who've placed orders, which I can find in the admin panel and in order_summary. Yet look at the customer table and it's showing order count as 0. Over the last 14 days, I have about 20 of these, all of which (except 1) are customers who've purchased but not registered. Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 17, 2016 Share Posted March 17, 2016 I found a SQL statement in a file that is run during an update to version CC609. I assume the code was also fixed to manage the order count correctly for ghost customers. Quote Link to comment Share on other sites More sharing options...
keat Posted March 17, 2016 Author Share Posted March 17, 2016 The site went live on the 5th, and all these entries happened after then, so I guess the code wasn't fixed. In the short term, could you point me to the sql code please, so I can correct these entries. Thanks Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 17, 2016 Share Posted March 17, 2016 Please find the file: /setup/db\upgrade/6.0.9.sql Quote Link to comment Share on other sites More sharing options...
keat Posted March 17, 2016 Author Share Posted March 17, 2016 I assume this is what you were referring to, but I run this and it doesn't affect anything. UPDATE `CubeCart_customer` SET `order_count` = ( SELECT COUNT( `id` ) FROM `CubeCart_order_summary` WHERE `CubeCart_order_summary`.`customer_id` = `CubeCart_customer`.`customer_id` ) Quote Link to comment Share on other sites More sharing options...
bsmither Posted March 17, 2016 Share Posted March 17, 2016 If your database has a table prefix, be sure to prepend it before every CubeCart, such as: pre_CubeCart_customer. Quote Link to comment Share on other sites More sharing options...
keat Posted March 17, 2016 Author Share Posted March 17, 2016 sorted. Thanks Incidentally, I've logged this on GitHub Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted March 17, 2016 Share Posted March 17, 2016 https://github.com/cubecart/v6/issues/1059 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.