Jump to content

Same sub-category name as H1


GaGz0r

Recommended Posts

Hi everyone,

 

I am googling about two days and I can´t find solution for my trouble.

 

I am configuring a new Prestashop webpage and I want to implement one special thing.

 

So my question is if there is some feature, how to copy category or subcategory name into H1 (name of product)?

 

For example: I have one product named Screwdriver, and I have two categories, Funny and Happy. And I want, that Product in category Funny has name Funny Screwdriver and in Happy category Happy Screwdriver, so I need to copy names of categories (Happy and Funny) into H1 tags of product,

But is is still the only one product with same parameters, photos, description etc, only another H1 Tag.

 

Is there some solution?

 

This solution here:

http://www.prestashop.com/forums/topic/244073-solved-name-of-the-category-to-meta-title/

 

is exactly what I want, but it copies category name to title meta tag, not to H1.

 

Thank you for you answers.

 

Have a nice day.

Link to comment
Share on other sites

Hello Gagzor,

 

To display catgory name in the <h1> of the product :

You have to modify your theme to add the category name in the <h1> tag of your product page (product.tpl file).

 

 

For example: I have one product named Screwdriver, and I have two categories, Funny and Happy. And I want, that Product in category Funny has name Funny Screwdriver and in Happy category Happy Screwdriver, so I need to copy names of categories (Happy and Funny) into H1 tags of product,

But is is still the only one product with same parameters, photos, description etc, only another H1 Tag.

 

I am not sure to understand what you mean here ?

 

If your product is in 2 categories, it does not have 2 different product page. You only have one product page, you would not be able to have one product page for each category..

 

Hope it helps,

Best regards,

Ciseur

  • Like 1
Link to comment
Share on other sites

Yes, that´s it.

 

I added {$category->name|escape:'htmlall':'UTF-8'} string into H1 tags of product.tpl and it is working!

 

Thank you.

 

But this displays only subcategory name in product name, not the main category also. Is there some way how to show both?

 

About the example: I am sorry, I forgot, that it is only one product.

 

Thank you.

 

GaGz0r

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...