Kristoff Posted October 30, 2013 Share Posted October 30, 2013 We've just updated our store and on 4.4.4 (I think it was) we had a hidden category, but we could link directly to products for people to buy (think things like tickets that only certain clients are invited to. The problem is though, since updating, when you view a product in a hidden file now, it is just a plain blank page. Anyone know how to sort it? It doesn't make much sense seeing as the items show up in search results, but then when you click them, it's just blank?! Any help appreciated! Many thanks Quote Link to comment Share on other sites More sharing options...
Al Brookbanks Posted October 30, 2013 Share Posted October 30, 2013 Hi Kristoff, I think you found a hidden undocumented and possibly unintentional feature of v4 (unless custom code was added to achieve this). I think other merchants want the behaviour in v5 to make sure that unpublished categories don't allow its inventory to be purchased. I expect a tweak to the code is needed to get these products to load. Have a look at the catalog class which is most likely to be responsible for this. Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 30, 2013 Share Posted October 30, 2013 I temporarily hid the Miscellaneous category on our v5 estates store. You should be able to still see item 0004a080811a04 by searching for it on http://dirtybutterestates.com. This did NOT work with our Fusion skin store. It pulled up the item, but when I tried to look at the full description I did get a blank page. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 30, 2013 Share Posted October 30, 2013 And by 'blank' page, it is actually the store's top, left and right sides, but empty space where the product details should be? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 30, 2013 Share Posted October 30, 2013 Correct - it's not a crash for me. Quote Link to comment Share on other sites More sharing options...
Kristoff Posted October 30, 2013 Author Share Posted October 30, 2013 That's what we get, but we actually want to be able to see the item. I will take a look in catalog class Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 30, 2013 Share Posted October 30, 2013 What skin are you using, Kristoff? It DOES work on our kurouto skin store, as I indicated. Quote Link to comment Share on other sites More sharing options...
Kristoff Posted October 30, 2013 Author Share Posted October 30, 2013 A custom skin, can't even remember which we used as a base skin. I will take a look at kurouto and see if I can see anything as a give away. Cheers Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 30, 2013 Share Posted October 30, 2013 OK. I'm unhiding my category, but will do that again if needed for troubleshooting. Just let me know. Quote Link to comment Share on other sites More sharing options...
Kristoff Posted October 30, 2013 Author Share Posted October 30, 2013 I've just tried kurouto and still nothing showing up. I've just noticed I need to update my sig, we're now on 5.2.4 Hi Kristoff, I think you found a hidden undocumented and possibly unintentional feature of v4 (unless custom code was added to achieve this). I think other merchants want the behaviour in v5 to make sure that unpublished categories don't allow its inventory to be purchased. I expect a tweak to the code is needed to get these products to load. Have a look at the catalog class which is most likely to be responsible for this. Thanks for this Al, for me it makes no sense to show items in a search, but not to be able to link to them directly. Surely it makes more sense to have them hidden on a search whether or not the item is available to view? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 30, 2013 Share Posted October 30, 2013 It helps to add your setup info to your sig as well, for just such converstations as this. Also, any time you have a potentially skin related issue it's best to test your problem on a stock skin to see what happens. Can you provide a link to your store and a product code for a hidden item? Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 30, 2013 Share Posted October 30, 2013 One would think a search would be filtered. Also, the Featured Product box will also show a product in a hidden category (CC512, heavily edited, so that may be just my case). Quote Link to comment Share on other sites More sharing options...
Kristoff Posted October 30, 2013 Author Share Posted October 30, 2013 It helps to add your setup info to your sig as well, for just such converstations as this. Also, any time you have a potentially skin related issue it's best to test your problem on a stock skin to see what happens. Can you provide a link to your store and a product code for a hidden item? Afraid not as the store is currently offline to public. One would think a search would be filtered. Also, the Featured Product box will also show a product in a hidden category (CC512, heavily edited, so that may be just my case). We're not using a featured product box, so we're ok there. I found this in catalogue.class, but removing and changing the hide=0 (for all instances) hasn't resulted in any joy. $query = sprintf("SELECT I.*, %2$s AS Relevance FROM %1$sCubeCart_inventory AS I LEFT JOIN (SELECT product_id, MAX(price) as price, MAX(sale_price) as sale_price FROM %1$sCubeCart_pricing_group $group_id GROUP BY product_id) as G ON G.product_id = I.product_id $joinString WHERE I.product_id IN (SELECT product_id FROM `%1$sCubeCart_category_index` as CI INNER JOIN %1$sCubeCart_category as C where CI.cat_id = C.cat_id AND C.hide = 0) AND I.status = 1 AND (%2$s) >= %4$f %3$s %5$s %6$s", $GLOBALS['config']->get('config', 'dbprefix'), $match, $whereString, $match_val, $order_string, $limit); if (($search = $GLOBALS['db']->query($query)) !== false) { $q2 = sprintf("SELECT COUNT(I.product_id) as count, %2$s AS Relevance FROM %1$sCubeCart_inventory AS I LEFT JOIN (SELECT product_id, MAX(price) as price, MAX(sale_price) as sale_price FROM %1$sCubeCart_pricing_group $group_id GROUP BY product_id) as G ON G.product_id = I.product_id $joinString WHERE I.product_id IN (SELECT product_id FROM `%1$sCubeCart_category_index` as CI INNER JOIN %1$sCubeCart_category as C where CI.cat_id = C.cat_id AND C.hide = 0) AND I.status = 1 AND (%2$s) >= %4$f %3$s GROUP BY I.product_id %5$s", $GLOBALS['config']->get('config', 'dbprefix'), $match, $whereString, $match_val, $order_string); Quote Link to comment Share on other sites More sharing options...
Kristoff Posted October 30, 2013 Author Share Posted October 30, 2013 For what it's worth, is there a way of me hiding a category ID from the navigation? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 30, 2013 Share Posted October 30, 2013 I just tried a Hidden Category on 5.2.4 Lite, and it pulls up the hidden product, but only shows the surrounding columns, header, and footer. So there may well be an edit somewhere in my kurouto store that is allowing this behavior. Could Kristoff accomplish what is needed via the Customer Groups? The addition of such groups as a method of controlling who sees what may well be why this is not working in 5.2.4. Quote Link to comment Share on other sites More sharing options...
Kristoff Posted October 30, 2013 Author Share Posted October 30, 2013 Is there a way of me hiding a category ID from the navigation? Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 30, 2013 Share Posted October 30, 2013 There is always a way -- some elegant, some very sloppy. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 30, 2013 Share Posted October 30, 2013 If you are using a custom skin, let's work with that. Find the template file element.navigation_tree.php, and take note of the $BRANCH array. Fortunately, CubeCart gives to Smarty (the template rendering engine) this for BRANCH: name, cat_id, url, and children. We can construct a test against the cat_ids known by you to be not included in the navigation: {if $BRANCH.cat_id ne 9} existing code {/if} For an array of cat_ids known by you to be not included in the navigation: {if !in_array( $BRANCH.cat_id, array(9,10) )} Quote Link to comment Share on other sites More sharing options...
Kristoff Posted October 31, 2013 Author Share Posted October 31, 2013 That works perfectly thanks my friend. The only issue i've got now (I think it may be a bug?) is that after hiding and unhiding the category called "Hidden" we now can't add any products to it? On Dashboard » Products » Item » Categories, it doesn't even show our category, yet the category is there and active in Categories... Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 31, 2013 Share Posted October 31, 2013 Just a shot in the dark, try clearing the cache. Quote Link to comment Share on other sites More sharing options...
Kristoff Posted October 31, 2013 Author Share Posted October 31, 2013 Just a shot in the dark, try clearing the cache. Have done, again, and again, and again Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 31, 2013 Share Posted October 31, 2013 Check the database and make sure the category you no longer want to be hidden is not still marked as hidden in the category table. Quote Link to comment Share on other sites More sharing options...
Kristoff Posted October 31, 2013 Author Share Posted October 31, 2013 That and a clear of the cache has worked. Cheers! Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 31, 2013 Share Posted October 31, 2013 Glad it finally worked for you! So did your "unhidden" category still have a 1 where it should have been 0 in the database? I ask, because my "hidden" category had a zero whether it was hidden or not. I did not do anything to cache, but didn't think that would be necessary to effect a change in the database. A little confused right now. Quote Link to comment Share on other sites More sharing options...
Kristoff Posted October 31, 2013 Author Share Posted October 31, 2013 Yep, obviously an issue with unhiding the categories or something with the database? 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.