Jump to content

Upgrade From 5.1.5 to 5.2.0 Set All My Items To Out Of Stock


Recommended Posts

Hello Everyone,

 

Just wanted to post the issue that I ran into today when upgrading from 5.1.5 to 5.2.0. After the upgrade, all of my items were set to (out of stock). I mean, I have thousands of products, and they were all set to (out of stock) after the upgrade. Now when I went to my admin panel and set the (allow out of stock purchases) set to accept. All products were back in stock.

 

I contacted cubecart staff, and they looked into it with no luck on a fix. They claim to think that it may be my vector v5 template from shopdev, or a bug. I wrote to shopdev as well to make them aware of the problem, and haven't herd back yet, so let's see what happens on there reply.

 

I really and sincerely don't think that this is caused by the vector v5 template since I had also switched back and forth to the cubecart standard templates to see if it had to do with a template or fusion issue, and the issue was the same. Then again, this is my personal opinion.

 

Note: As mentioned before I have contacted cubecart staff, as well as shopdev. I'm only posting this here since there's lot's of us that play around with cubecart as I also do, and maybe anyone comes across this issue or can provide some info or help with this issue.

 

I currently had to convert back to 5.1.5 just to avoid this issue, and will keep trying to get this resolved so that I can re upgrade since I'm looking forward, as much as lots of us to using the all in one shipping and more of the new features in 5.2.0.

 

 

Kind Regards,

Eddie

Link to comment
Share on other sites

Hello Eddie,

 

I believe this to be a bug in the latest CubeCart release.  After disabling the Fusion plugin and all of its hooks, line 116 of the cubecart.class.php file still returns false for all products (whether they are in stock or not):

$product['ctrl_stock'] = (!$product['use_stock_level'] || $GLOBALS['config']->get('config', 'basket_out_of_stock_purchase') || ($product['use_stock_level'] && $GLOBALS['catalogue']->getProductStock($product['product_id'], null, true))) ? true : false;

Digging a little deeper...  This line calls the Catalog::getProductStock() method, which is returning empty strings.  I can therefore only conclude that this issue is not being caused by either the Vector theme or Fusion plugin.

Link to comment
Share on other sites

Hello Homar, I thank you so much for your help. I had already replied to you via your shopdev ticket. I just new that this had to be a bug since I had also last all day playing with this issue, and no matter what I tried, had the same result. I will try and post this bug for cubecart staff can take a look at it.

 

 

Thank you once again!

 

Eddie

Link to comment
Share on other sites

I have no idea when this archive was "released". Timestamps in the ZIP file I just downloaded indicate the archive was built at 1/23/2013 11:25am (at whatever timezone Devellion is at) as opposed to the previous archive with timestamps of 1/22/2013 1:41pm.

 

I downloaded (let's call it CC5.2.0.1) about 1/2hr ago, at UTC: Thursday, January 24, 2013 at 02:27am

Link to comment
Share on other sites

Hi,

 

Got the same problem over here. Bug in CC 5.2.0. I guess. Upgraded wednesday jan. 23 on 2 pm GMT+1.

 

I found a temporarily fix: check the "Allow out-of-stock purchases" in the main settings - Stock.

 

Doing this the prices will be back again, That said this bug is still there and I have no clue how to upgrade since I have the latest version installed.

 

Help appreciated.

 

Kind regards,

 

Boudi

Link to comment
Share on other sites

Would you please verify a couple of observations regarding the Out of Stock scenario:

* When viewing the database directly, the 'stock_level' column of the CubeCart_inventory table shows valid numbers?

* When viewing the admin screen Product Inventory, the 'Stock' column shows valid numbers?

* When editing an existing product, the Stock Level filed shows a valid number?

* In admin, Store Settings, Stock tab, set 'Show stock levels' to a green check. Then when viewing the product on the storefront, there is indication that the product is in stock or out of stock?

Link to comment
Share on other sites

Hi, I have already reverted back to 5.1.5, but I can answer these question for you as too my experience with the issue when on 5.2.0.

 

 

* When viewing the database directly, the 'stock_level' column of the CubeCart_inventory table shows valid numbers? Yes

* When viewing the admin screen Product Inventory, the 'Stock' column shows valid numbers? Yes

* When editing an existing product, the Stock Level filed shows a valid number? Yes

* In admin, Store SettingsStock tab, set 'Show stock levels' to a green check. Then when viewing the product on the storefront, there is indication that the product is in stock or out of stock? Yes

 

Everything seems correct, but as mentioned before, when on the site, all products show (out of stock). Now keep in mind that if you check green via the admin panel, (allow out of stock purchases) all stock will come back to in stock.

 

As shopdev also concluded, the bug seems to be coming via: 

 

 

I believe this to be a bug in the latest CubeCart release.  After disabling the Fusion plugin and all of its hooks, line 116 of the cubecart.class.php file still returns false for all products (whether they are in stock or not):

$product['ctrl_stock'] = (!$product['use_stock_level'] || $GLOBALS['config']->get('config', 'basket_out_of_stock_purchase') || ($product['use_stock_level'] && $GLOBALS['catalogue']->getProductStock($product['product_id'], null, true))) ? true : false;

Digging a little deeper...  This line calls the Catalog::getProductStock() method, which is returning empty strings.  I can therefore only conclude that this issue is not being caused by either the Vector theme or Fusion plugin.



Sorry, answered this one wrong:

 

* In admin, Store SettingsStock tab, set 'Show stock levels' to a green check. Then when viewing the product on the storefront, there is indication that the product is in stock or out of stock? Out Of Stock

Link to comment
Share on other sites

If you can, would you please try this:

 

In /classes/catalogue.class.php, line 756, find:

if($products_matrix = $GLOBALS['db']->select('CubeCart_option_matrix', $rows, $where)) {
and make it look like:
if( ($products_matrix = $GLOBALS['db']->select('CubeCart_option_matrix', $rows, $where) ) !== false) {

Link to comment
Share on other sites

Hello bsmither,

 

Thank you very much, but the only problem right now, is that I have reverted back to 5.1.5. I don't have a 5.2.0 at the moment to try this on. I'm so tired of going back and fourth, that I just decided to leave it alone on 5.1.5 until an upgrade or fix was made.

 

Maybe someone will give this a try, or maybe I can do a subdomain test store to try it at a later time since I'm currently in my store and don't have the time to do it at this moment.

Link to comment
Share on other sites

If you can, would you please try this:

 

In /classes/catalogue.class.php, line 756, find:

if($products_matrix = $GLOBALS['db']->select('CubeCart_option_matrix', $rows, $where)) {
and make it look like:
if( ($products_matrix = $GLOBALS['db']->select('CubeCart_option_matrix', $rows, $where) ) !== false) {

 

Hi,

 

Does not make a difference on a 5.2.0 version (upgrade from 5.1.5)

 

Regards,

 

Boudi

Link to comment
Share on other sites

Then try this. In /classes/catalogue.class.php, near line 756, make this:

            if($products_matrix = $GLOBALS['db']->select('CubeCart_option_matrix', $rows, $where)) {    
                 if(!empty($products_matrix[0]['stock_level'])) {
                     $GLOBALS['session']->set('restock_note',$products_matrix[0]['restock_note']);
                 }
                 return $products_matrix[0]['stock_level'];
             }

look like this:

            if($products_matrix = $GLOBALS['db']->select('CubeCart_option_matrix', $rows, $where)) {    
                 if(!empty($products_matrix[0]['stock_level'])) {
                     $GLOBALS['session']->set('restock_note',$products_matrix[0]['restock_note']);
                     return $products_matrix[0]['stock_level'];
                 }
             }


(I really should get a testbed setup and do an upgrade. Run my typical diagnostics.)

Link to comment
Share on other sites

Then try this. Make:
            if($products_matrix = $GLOBALS['db']->select('CubeCart_option_matrix', $rows, $where)) {    
                 if(!empty($products_matrix[0]['stock_level'])) {
                     $GLOBALS['session']->set('restock_note',$products_matrix[0]['restock_note']);
                 }
                 return $products_matrix[0]['stock_level'];
             }

look like this:

            if($products_matrix = $GLOBALS['db']->select('CubeCart_option_matrix', $rows, $where)) {    
                 if(!empty($products_matrix[0]['stock_level'])) {
                     $GLOBALS['session']->set('restock_note',$products_matrix[0]['restock_note']);
                     return $products_matrix[0]['stock_level'];
                 }
             }

Then I get 2 blank screens, backend and frontend.

Link to comment
Share on other sites

I just want to thank all those helping with this issue. We have been totally overwhelmed the last few days since the release. I am going to try some of the code changes mentioned here and release 5.2.1 as soon as we have a solution. I'm sorry for the inconvenience caused to everyone. This version had a good two week beta period and this issue wasn't reported. 

Link to comment
Share on other sites

Hi - I am in the development stage of a site using CC5 and noticed the same problem after upgrading to 5.2.. 

 

bsmither, I tried the fix you suggested above to cataloque.class.php, and it didn't change anything on my site - ie products with stock still show the out of stock message on the site.  Further, I have the site set to not display the out of stock message (and it does) and to not display products with no inventory but it is still showing everything.

 

hope that helps fix this.

 

Sue

Link to comment
Share on other sites

I installed a fresh CC515, then immediately upgraded to (let's call it CC520.1).

 

I do not get an out-of-stock indicator, but even though I set "Show stock levels", the stock level is not showing on the View Product page.

 

Edit: Stupid... I didn't set the "Use stock level" and a fresh install of CubeCart has the Test Product with zero stock.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...