Page 1 of 1

Designating Product Types

Posted: Sun Aug 21, 2016 7:08 am
by kwikstand
Is there a way to designate product pages as part of a category or some other type?
There are various things you can do depending on the product type that is viewed. For example, you can serve appropriate ads to people that have viewed a type of product on your website. You can have a pop-up or widget display for product pages belonging to a certain category. This is usually done with the URL, but it needs to have the category name in it, like http://www.website.com/catgoryA/prodcutB. Able's URL's don't have that anymore.

I am just wondering if there is some way to work around this.

Thanks

Re: Designating Product Types

Posted: Sun Aug 21, 2016 11:30 pm
by jmestep
You can try a couple of different things. In ProductPage.ascx.cs, it uses

Code: Select all

_CategoryId = AbleCommerce.Code.PageHelper.GetCategoryId();
You could also do something like the following to see if a product is in category 2 and act upon that.

Code: Select all

if(_Product.Categories.IndexOf(2)>-1)
{
//do something
}

Re: Designating Product Types

Posted: Sun Aug 21, 2016 11:34 pm
by mazhar
If its just about showing different content then without any code changes you can do it via Product Batch editing and setting product specific display page. For example you can batch edit products under certain category and choose some specific display page for each of them. Those products will be served using selected display page instead of store's default product display page.

Regarding URL having certain format, either you can use custom URL feature or write your own UrlRewriter.