Post by inets » Wed Nov 28, 2007 5:01 am

Hello,

Can anybody help with Title.
I want to echo title in product page like this -> Category name+Product name

In catalog->controller->product.php I found
this code: (line:62)


$template->set('title', $product_info['name']);

Can anobody help me how I can do this? I am not very competent with arrays.

Newbie

Posts

Joined
Thu Sep 20, 2007 3:50 am

Post by bruce » Thu Jan 10, 2008 7:51 pm

The breadcrumb on the page already shows this information and more but...

in response to your actual question, line 26 of the same file shows where the array is populated.
ie:

Code: Select all

$product_info = $database->getRow("select * from product p left join product_description pd on (p.product_id = pd.product_id) left join image i on (p.image_id = i.image_id) where p.product_id = '" . (int)$request->get('product_id') . "' and pd.language_id = '" . (int)$language->getId() . "' and p.date_available < now() and p.status = '1'");
You would need to modify the select statement to join with
  • product_to_category to give you the category_id of the product
  • category_description to give you the name of the category (need to alias 'name'  from this table this as, say 'category_name'
Don't forget to include the language_id if you want to support different languages on your store.

Now your title would be

Code: Select all

$product_info['category_name'] . ' ' . $product_info['name']

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by inets » Tue Jan 29, 2008 4:52 am

Thank you, its help me.
I found breadcrumb select too and make combination :)

Inets

Newbie

Posts

Joined
Thu Sep 20, 2007 3:50 am
Who is online

Users browsing this forum: No registered users and 3 guests