Jordzjoestar
2020-07-31T05:07:15Z
Hi Guys,

I'm trying to separate products that have options with products that dont have options.

I wanted to do this via Product types but cannot find a way to reference ProductTypes in The Category Index.cshtml..

So currently I have the below written in one Category View,
But there seems to be an issue when the products are in multiple categories, they only show in the 1st category that was added when the options were added to the product.


@foreach (var item in Model.Products )
        {
		
		if (item.Item.HasOptions()){ 
		<div class="col-lg-2 col-sm-6">
                @Html.Partial("_RenderSingleProduct", item)
            </div>
			}
			else 
			{
		
			
			}
        

I hope this makes sense, any suggestions would be helpful ๐Ÿ™‚
Will Strohl
2020-08-01T07:46:52Z
Originally Posted by: Gilderroot 

Hi Guys,

I'm trying to separate products that have options with products that dont have options.



Honestly, I'm not sure I completely understand what you're trying to do. Maybe you can describe the use case further?
Will Strohl, Upendo Ventures
Hotcakes Cloud  | Get Support  | Code Support 
Official Cloud & Support provider for Hotcakes
Jordzjoestar
2020-08-02T20:50:52Z
Hi Will,

So what im trying to achieve is to have one category view displaying Products with Choices, and another displaying products without choices.
The products with the multiple choice (or options) will be what we sell, the products without choices will be just for display purposes.

I have tried to display the product that has choices (options) by using "if (item.Item.HasOptions())" but this doesnt seem to work when the product is in multiple categories (The Product will only display one of the multiple categories selected).

Also is there anyway to reference ProductType in the category view.cshtml so I could only display a specific Product Type in say the category view module?

Let me know if this still doesnt make sense.. i'll ease off the drinks ๐Ÿ˜›
Jordzjoestar
2020-08-14T00:05:34Z
My solution to this issue was the above code I had originally put in this post, But i had not set the number of products in my settings so it was only displaying the 1st few products.

As there are over 2k products in this shop, the purchaseable ones were near the bottom of the list, so you have to add the product number in settings over 2k (999999 is what i entered) for those product to display.

Hopefully this helps someone in the future ๐Ÿ™‚
Will Strohl
2020-08-17T16:10:05Z
Ah, yes... You should always have a limit in some way when you know the catalog is large enough to warrant it. ๐Ÿ™‚
Will Strohl, Upendo Ventures
Hotcakes Cloud  | Get Support  | Code Support 
Official Cloud & Support provider for Hotcakes
Loading
  • Sign-up for the Hotcakes Community Newsletter: