Post by sajuk » Wed Jun 12, 2019 5:13 am

Hi,

I want to add the product model and price in the <title> tag of the product page, is there any extension out there for this..? or can anyone guide me on the code i need to add to the files, i am using OC V 3.0.2.0

Thanks

Newbie

Posts

Joined
Tue Feb 07, 2017 7:10 pm

Post by Johnathan » Wed Jun 12, 2019 10:06 pm

I think this edit should do it:

Code: Select all

IN:
/catalog/controller/product/product.php

REPLACE:
$this->document->setTitle($product_info['meta_title']);

WITH:
$product_price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
$this->document->setTitle($product_info['meta_title'] . ' (' . $product_info['model'] . ') ' . $product_price);

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by sajuk » Thu Jun 20, 2019 8:42 pm

Added the code,.

Works perfect just what I wanted,

Thanks

Newbie

Posts

Joined
Tue Feb 07, 2017 7:10 pm
Who is online

Users browsing this forum: No registered users and 9 guests