Jump to content

Products in hidden categories are hidden completely...?


Kristoff

Recommended Posts

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

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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);
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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) )}

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

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...