Tabular product layout description

  • Posts: 1125
  • Thank you received: 12
3 weeks 3 days ago #369499

-- HikaShop version -- : 6.1.1
-- Joomla version -- : 5.4.0
-- PHP version -- : 8.3

Hi,

I want to use tabular layout on the products and i see in the view file "mini description". Where do i add that on the product?
Basically what i would like to have is something like this if it is posible organic-beauty.themerex.net/product/anti-wrinkle-booster-serum/

On the right part a mini description and on the bottom part 2 tabs for different custom fields.

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 84853
  • Thank you received: 13812
  • MODERATOR
3 weeks 2 days ago #369500

Hi,

The mini description is already displayed on the right side on your product page. It is just hidden with CSS code.
You can add such CSS code on your website to have it appear:

#hikashop_product_description_main_mini {
    display: block !important;
}
Then, if you create a custom field of the table "product" and of the type "Wysiwyg" via the menu Display>Custom fields, and then you enter something in that field in your product, you'll see the tabs appear automatically at the bottom: one for the full description, and one for the custom fields.
And if you want to add extra tabs, we have the section "How to add a tab in the tabular view ?" of the FAQ which explains it:
www.hikashop.com/support/documentation/106-faq.html#layo

The following user(s) said Thank You: verzevoul

Please Log in or Create an account to join the conversation.

  • Posts: 1125
  • Thank you received: 12
3 weeks 2 days ago #369504

Hi!

Okay i see the mini description now but can i remove the read more button?
And also how many characters can the mini description be?

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 84853
  • Thank you received: 13812
  • MODERATOR
3 weeks 2 days ago #369507

Hi,

If you add a "read more" tag to the description, you can choose where to cut the description.

Without the read more tag, the system will cut at 300 characters after stripping the HTML tags from the description, if any.

Regarding the read more link, if you don't want it, you can hide it with a bit of CSS code:

[href='#hikashop_show_tabular_description'] {
    display: none;
}
Or you can simply have a read more tag before the 300th character.

The following user(s) said Thank You: verzevoul

Please Log in or Create an account to join the conversation.

  • Posts: 1125
  • Thank you received: 12
3 weeks 2 days ago #369515

Great thanks!

Can i also remove the ... at the end of the mini description?

Please Log in or Create an account to join the conversation.

  • Posts: 84853
  • Thank you received: 13812
  • MODERATOR
3 weeks 1 day ago #369516

Hi,

It is possible. For that, you would have to edit the product / show_tabular view file via the menu Display>Views and change the code after:

if (!empty($this->element->product_description) && strlen($this->element->product_description)>300)

The following user(s) said Thank You: verzevoul

Please Log in or Create an account to join the conversation.

  • Posts: 1125
  • Thank you received: 12
3 weeks 3 hours ago #369547

Hi,

Can the mini description display like HTML? Cause i added bullets for example but it shows the whole text as one plain text paragraph.
And also can i hide the intro description from the tab description? I mean only display the text that starts after the read more button in the tab area.

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 84853
  • Thank you received: 13812
  • MODERATOR
2 weeks 6 days ago #369551

Hi,

1.
Yes. On the line before:

$resume = $function(strip_tags(preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->element->product_description)),0,300);
it's the function "strip_tags" which remove the HTML tags.
You could have instead:
$resume = $function(preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->element->product_description),0,300);
and it wouldn't remove the HTML tags.
The problem however, is that the 300 characters cut can happen in the middle of a HTML tag in that case, which would break the HTML of the page.
So, if you do that change, I would recommend that you add a read more tag to tell the code where the cut should happen.
You might even want to remove the 300 characters cut because the HTML tags will be counted in the 300 limit. So maybe something like this would be better in that case:
$resume = preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->element->product_description);

2.
Yes. The description at the bottom is displayed with:
$description = trim(JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$this->element->product_description)));
If you want to remove the text before the read more tag, change it to:
$description = trim(JHTML::_('content.prepare',preg_replace('#.*<hr *id="system-readmore" */>#is','',$this->element->product_description)));

The following user(s) said Thank You: verzevoul

Please Log in or Create an account to join the conversation.

Time to create page: 0.045 seconds
Powered by Kunena Forum