ecoLogic
ecoLogic

Reputation: 75

Bigcommerce - add category name to product page layout

I'm changing a theme in Bigcommerce, and I should put the product Category name in Product page layout, but there isn't any panel that could do that, and I don't really know is it possible?

I can get the list of all categories, but that's not what I want, and I would like to do it without unecessary JavaScript.

So, for example.. I have few categories, and when I'm in each of that categories product, this product category should be writen.

Category - Product - Headline ( should be writen in this page )


Car - Honda - Car
Cloth - Shirt - Cloth

etc..

If anyone knows how it can be made, it would be very appreciated.
Thanks!

Upvotes: 0

Views: 1048

Answers (1)

tekstrand
tekstrand

Reputation: 1493

I believe the only place the category is pulled onto the product page is through the product breadcrumbs. You could use a simple Javascript to get the category set in the product breadcrumbs and then display it somewhere else.

Something like

  1. Get breadcrumbs
  2. Find the item before the ones that matches the product name
  3. Set it's text as a variable
  4. Set the element where you actually want the cat name to appear to contain the text of the var

Upvotes: 1

Related Questions