Hello,
in my category page i have this code which show product name of product:
<div class="Title">
<?php echo JHTML::link(JRoute::_($product->link.$ItemidStr), shopFunctionsF::limitStringByWord($product->product_name,'50','...'), array ('title' => shopFunctionsF::limitStringByWord($product->product_name, 50, '...') ) ); ?>
</div>
I want to add the category name before the product name as this : "Catégory name : product name"
How can i get this with category_name?
I try this code but it does'nt work :
<div class="Title">
<?php echo JHTML::link(JRoute::_($product->link.$ItemidStr), shopFunctionsF::limitStringByWord($category->category_name, ':', $product->product_name,'50','...'), array ('title' => shopFunctionsF::limitStringByWord($category->category_name, ':', $product->product_name, 50, '...') ) ); ?>
</div>
Thank you for your help.
regards.
$products[0]->category_name
Hello John,
thank you for your answer. I replace code by :
<?php echo JHTML::link(JRoute::_($product->link.$ItemidStr), shopFunctionsF::limitStringByWord($products[0]->category_name,'50','...'), array ('title' => shopFunctionsF::limitStringByWord($products[0]->category_name, 50, '...') ) ); ?>
I have category name in place of product name. I want to have category name and product name.
Example : Category : bags
Product : Black Bag
I want this title : " Bag : Black Bag".
Thank you for your help.
Regards.
Hamid.
$products[0]->category_name.' : '.$product->product_name
More simple
$product->category_name.' : '.$product->product_name
Thank you very much John and Merci @studio 42 ! It's ok now. I will see if this change improve SEO ranking :)