- Posts: 81
- Thank you received: 6
Limit Title Characters on Product Listing Page
Please Log in or Create an account to join the conversation.
The best way is to modify the view and add a limitation where the product name is displayed (using "substr").
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Yes, something like:
Be careful, in the string "$this->row->product_description" it could be html tags.
Please Log in or Create an account to join the conversation.
i.e
Click on a category and you see all your products in that category with add to cart button..
Which file edits this file via VIEW?
Please Log in or Create an account to join the conversation.
The view to edit is depending on your configuration, if you set a display in Div with image and title displayed, then the view is "product / listing_img_title".
Please Log in or Create an account to join the conversation.
Think i need sleep
Sorry for wasting you time that was a stupid question now awake had a bit of sleep
SORRY
Please Log in or Create an account to join the conversation.
So we have product name listed here:
<!-- PRODUCT NAME -->
<span class="hikashop_product_name">
<?php if($this->params->get('link_to_product_page',1)){ ?>
<a href="<?php echo $link;?>">
<?php }
echo $this->row->product_name;
if($this->params->get('link_to_product_page',1)){ ?>
</a>
<?php } ?>
</span>
<!-- EO PRODUCT NAME -->
I need to insert the title limit and manufactures name at the start i.e
<?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->element->product_manufacturer_id);
echo $manufacturer->category_name; ?>
Any time i input the codes i get nothing, but it works fine on show_block???
Please Log in or Create an account to join the conversation.
<span class="hikashop_product_name">
<?php if($this->params->get('link_to_product_page',1)){ ?>
<a href="<?php echo $link;?>">
<?php
echo substr($this->row->product_name, 0, 7); //To display 7 characters.
?>
</a>
<?php } ?>
</span>
<!-- EO PRODUCT NAME -->
That's the title limited Figured it out
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
<?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->element->product_manufacturer_id);
echo $manufacturer->category_name; ?>
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Yes I understood that you have solved the limit problem, and I was telling you to try to add the code:
Because I tried the code:
And it's working fine on my end.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
<!-- PRODUCT NAME -->
<span class="hikashop_product_name">
<?php if($this->params->get('link_to_product_page',1)){ ?>
<a href="<?php echo $link;?>">
<?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->element->product_manufacturer_id);
echo $manufacturer->category_name; ?><?php echo substr($this->row->product_name, 0, 30); //To display 7 characters.
?>
</a>
<?php } ?>
</span>
<!-- EO PRODUCT NAME -->
You want BK-End Access to explore or url to page to view source?
Please Log in or Create an account to join the conversation.
PS : You can use the tag "code" for pasting your code, it would be easier to read
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Have we not got a MYSQL Query to just bang the brand name in title of product cause i need it on checkout and cart...
Please Log in or Create an account to join the conversation.
<?php $class = hikashop_get('class.category');
$manufacturer = $class->get($this->element->product_manufacturer_id);
echo $manufacturer->category_name; ?>
Please Log in or Create an account to join the conversation.