Post by elitza85 » Thu Dec 14, 2023 2:51 am

Hi,
please advise me how and where exactly to add code related to adding H1 tag to the page title (class="title page-title") on OC 2.0.2.0:

- what should be the code in PHP (something that should look similar to the first picture attached after pressing F12)
- where exactly I should add the code (directory->file->line)- the second picture is where I assume the code should be placed (in the product.tpl file in ...catalog/view/theme/theme_name/template/product) but I might be wrong.

I also use VQmod if this matters.

Thanks for helping me!

Attachments

image3.jpg

this is where I assime the could should be placed - image3.jpg (94.58 KiB) Viewed 2147 times

how it looks after pressing F12

Last edited by elitza85 on Wed Dec 20, 2023 10:04 pm, edited 1 time in total.

Newbie

Posts

Joined
Fri Nov 13, 2015 11:48 pm

Post by SohBH » Thu Dec 14, 2023 3:49 pm

Locate it in controller.

View all extensions | Request custom work | Pricing | Contact Me


User avatar
Active Member

Posts

Joined
Mon Nov 02, 2020 12:01 am
Location - Malaysia

Post by elitza85 » Thu Dec 14, 2023 5:59 pm

Thanks,
Please send me the exact piece of code of what should be added.

Thanks

Newbie

Posts

Joined
Fri Nov 13, 2015 11:48 pm

Post by straightlight » Thu Dec 14, 2023 7:29 pm

Custom job / service request.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by SohBH » Thu Dec 14, 2023 8:22 pm

What is required to be added?

View all extensions | Request custom work | Pricing | Contact Me


User avatar
Active Member

Posts

Joined
Mon Nov 02, 2020 12:01 am
Location - Malaysia

Post by ADD Creative » Thu Dec 14, 2023 8:36 pm

The file and location will different for each page. For a product page and in the default theme in will be catalog/view/theme/default/template/product/product.tpl at line 136.

Code: Select all

<h1><?php echo $heading_title; ?></h1>
It will be on a different line in a different theme. You should be able to search for h1 in your text editor.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by paulfeakins » Thu Dec 14, 2023 8:40 pm

elitza85 wrote:
Thu Dec 14, 2023 5:59 pm
Please send me the exact piece of code of what should be added.
As above if you want someone to do free work for you, you might be lucky here, but if not you'll have to pay a developer from Commercial Support.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by ADD Creative » Fri Dec 15, 2023 5:41 pm

To add you classes to the h1 tag, you would change.

Code: Select all

<h1><?php echo $heading_title; ?></h1>
To.

Code: Select all

<h1 class="title page-title"><?php echo $heading_title; ?></h1>
This would be for the default theme, a third party theme may be different.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by elitza85 » Fri Dec 15, 2023 9:08 pm

Thanks,
this seems to work BUT now the problem is that the heading title becomes visible on the product page two times: at the front-end at the top of the product page I see the product name (heading_title) two times on two separate lines.

Thanks,

ADD Creative wrote:
Fri Dec 15, 2023 5:41 pm
To add you classes to the h1 tag, you would change.

Code: Select all

<h1><?php echo $heading_title; ?></h1>
To.

Code: Select all

<h1 class="title page-title"><?php echo $heading_title; ?></h1>
This would be for the default theme, a third party theme may be different.

Newbie

Posts

Joined
Fri Nov 13, 2015 11:48 pm

Post by ADD Creative » Fri Dec 15, 2023 10:46 pm

Are you using the default theme? I seen some themes that use JavaScript to move headers about the page for some reason.

Make sure your product.tpl only contains one <?php echo $heading_title; ?>.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by elitza85 » Mon Dec 18, 2023 8:40 pm

Hi,
you are right I`m really lucky because two people already helped me for FREE! And yes, I pay developers BUT for something that is special, unique, and difficult to do by myself :) For a line of code- I rely on myself, not on a developer :)
Good Luck!
paulfeakins wrote:
Thu Dec 14, 2023 8:40 pm
elitza85 wrote:
Thu Dec 14, 2023 5:59 pm
Please send me the exact piece of code of what should be added.
As above if you want someone to do free work for you, you might be lucky here, but if not you'll have to pay a developer from Commercial Support.

Newbie

Posts

Joined
Fri Nov 13, 2015 11:48 pm

Post by elitza85 » Mon Dec 18, 2023 8:41 pm

Thank you for your help, seems to work :)
ADD Creative wrote:
Fri Dec 15, 2023 10:46 pm
Are you using the default theme? I seen some themes that use JavaScript to move headers about the page for some reason.

Make sure your product.tpl only contains one <?php echo $heading_title; ?>.

Newbie

Posts

Joined
Fri Nov 13, 2015 11:48 pm

Post by paulfeakins » Wed Dec 20, 2023 8:29 pm

elitza85 wrote:
Mon Dec 18, 2023 8:41 pm
Thank you for your help, seems to work :)
Great, so please now add [SOLVED] to the start of the post title.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 10 guests