slic535 Posted September 14, 2022 Share Posted September 14, 2022 i have upgraded to the 6.4.7 and when i push the hide out of stock items it doesnt work. any ideas? Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 14, 2022 Share Posted September 14, 2022 A few conditions must exist: the person viewing (does not need to be logged in as a customer) the storefront must not be logged in as an admin (using the same browser which then shares a session cookie), the "Hide-out-of-stock" general setting must be checked, the product must have the "Use Stock Level" checked and have a stock level of zero, and possibly "Allow out-of-stock purchases" general setting must be unchecked. Then have CubeCart clear its internal cache. From what version of CubeCart did you upgrade from, where the Hide out-of-stock setting worked last? Quote Link to comment Share on other sites More sharing options...
shaununouk Posted January 5, 2023 Share Posted January 5, 2023 I have just used or ticked this hide out of stock feature myself to see what happens, as I have a few listings with different colours and have the odd colour option that is now out of stock and it seems to break my shop category's. All 7 shop categories are displayed correctly but they only link to category ID No.1 and only show ID no.1 category even when you click on category no 3, 4 or 5. All 7 categories link and display correctly when I untick this hide out of stock feature and I will just leave the shop like this as I usually have it 100% stocked. I am using CC 6.4.9 Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 5, 2023 Share Posted January 5, 2023 Is trying the Hide-Out-of-Stock feature new to you? Which is to ask, do you think this is new to CC649, or maybe this scenario has existed for many past versions? I see nothing in Amzin that might cause issues with links to category pages. Quote Link to comment Share on other sites More sharing options...
shaununouk Posted January 5, 2023 Share Posted January 5, 2023 Yes this is new to me, as never used this hide function before, may have been a problem that existed in the previous versions of my CC, I had just come across this thread and decided to test this hide out of stock function myself to see what would happen. Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 5, 2023 Share Posted January 5, 2023 Please keep in mind that if you are signed in to administration, and viewing the storefront, out-of-stock products will still be shown. So, be sure to Clear Cubecart's cache and log out after setting and saving this feature. Also, the seven categories listed are in Amzin's list of categories? Quote Link to comment Share on other sites More sharing options...
shaununouk Posted January 5, 2023 Share Posted January 5, 2023 I am logged out and have cleared cache, I have sent an email to you. Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 5, 2023 Share Posted January 5, 2023 On my development system, I am trying Amzin 1.05 on CC647 running under PHP8.1. (Found a bug in a template.) But the links appear correct. I have not yet installed CC649. But analyzing code differences between CC647 and CC649 shows no likely source of this situation. 1 Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 6, 2023 Share Posted January 6, 2023 Please try this edit: In the file /classes/catalogue.class.php, near lines 1781-1783, find: if($GLOBALS['config']->get('config', 'hide_out_of_stock')=='1') { $search_data['inStock'] = true; } CUT to the system clipboard, then PASTE these lines just below this line, just a few lines down: if (!empty($joins) || is_array($search_data)) { So that the resulting area of code looks like: // Presence of a join is similar to presence of a search keyword if (!empty($joins) || is_array($search_data)) { if($GLOBALS['config']->get('config', 'hide_out_of_stock')=='1') { $search_data['inStock'] = true; } if (!empty($search_data['priceVary'])) { Quote Link to comment Share on other sites More sharing options...
shaununouk Posted January 7, 2023 Share Posted January 7, 2023 The edit as requested now looks like if($GLOBALS['config']->get('config', 'hide_out_of_stock')=='1') { $search_data['inStock'] = true; } // Presence of a join is similar to presence of a search keyword if (!empty($joins) || is_array($search_data)) { if($GLOBALS['config']->get('config', 'hide_out_of_stock')=='1') { $search_data['inStock'] = true; } if (!empty($search_data['priceVary'])) { // Allow for a 5% variance in prices I believe this to be correct, But still the same problem. Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 7, 2023 Share Posted January 7, 2023 Earlier, I said, "CUT lines 1781-1783". But, now that they are copied to the target location, delete those three original lines that are above the line that is: // Presence of a join is similar to presence of a search keyword Quote Link to comment Share on other sites More sharing options...
shaununouk Posted January 7, 2023 Share Posted January 7, 2023 Ahh, to be honest I did not know what the system clipboard was, I have now deleted the three original lines above, etc as requested in your previous reply and all is now working as it should be with regards to the categories linking to the correct links. Thank you Quote Link to comment Share on other sites More sharing options...
shaununouk Posted January 7, 2023 Share Posted January 7, 2023 For a product with no colour options, when this is zero stock a banner across the image appears to say "Out of Stock" and with products with various colour options, any option then showing zero, the customer gets an error warning saying " Sorry but the chosen product option combination is out of stock or the last of the stock is already in your basket " when they attempt to add that item to the basket. Hopefully everything is now working correctly. Quote Link to comment Share on other sites More sharing options...
bsmither Posted January 7, 2023 Share Posted January 7, 2023 In my opinion, CubeCart is not yet coded to instantly detect when a given combination of option choices - including there being only one option - are not available. That is to say, red and blue, small and large, but only red small is not available, CubeCart still shows all assigned options. This is normal behavior. There are (or have been) plugins available to query CubeCart when the customer changes options. 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.