Read More Button Not Available

  • Posts: 149
  • Thank you received: 0
13 years 5 months ago #18000

well what we did,


1. Configuration>Main tab , the Read more set to Yes

2. we add the code

echo '<a href="'.$link.'">Read more</a>';

after the line:
echo preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->row->product_description);

at product / listing_img_desc.php

3.at the product description we use the <hr id="system-readmore" />


no luck with the changes above.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 5 months ago #18002

For 2., are you sure that you did the modification for the correct template ? If you have several templates on your website, you might have done it for another template than the one you're using.
Also, please make sure that you're using the "image and description" item box layout on your menu/module's hikashop options.

The following user(s) said Thank You: Bankthaworn

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

  • Posts: 149
  • Thank you received: 0
13 years 5 months ago #18017

i can have the read more on modules for example on "latest products" i choose image and description.

but can i have the read more.. option on the product page?

Last edit: 13 years 5 months ago by webarts.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 5 months ago #18020

Well, you can but where do you want to should the full description then ?
There is no point in writing a complete description if you never display the part after the read more tag...

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

  • Posts: 149
  • Thank you received: 0
13 years 5 months ago #18023

i want the readmore because for some products i have 2-3 pages of description . i dont want to show direclty the looooong description. first i want to show to the iser only one paragraph.


what i have to change for that its not working now.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
13 years 5 months ago #18024

You have two solutions then,
Either you put your long description as a joomla article and you put the link to the article in the URL link of the product so that the user will be able to click on that link in order to see the article; or you can modify the file show of the view product via the menu Display->Views in order to add some HTML/PHP/javascript in order to dynamically display the long description but that will require quite some knownledge.

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

  • Posts: 149
  • Thank you received: 0
13 years 5 months ago #18025

ok Nicolas thank you !

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

  • Posts: 24
  • Thank you received: 0
12 years 4 months ago #56229

I was wondering if anyone knew how to set it to show the first paragraph before the "Read more>>" section. I have got it working on the "Product Listing page but I am having an issue getting to show just the first paragraph and the "Add to Cart" link.

Below is the code I am using:

                <div id="hikashop_product_description_main_mini" class="hikashop_product_description_main_mini">

		<?php
		$resume = substr(strip_tags(preg_replace('#<hr *id="system-readmore" */>#is','',$this->row->product_description)),0,500);

		$resume .= "...<a href='$link'>See more</a>";

		echo JHTML::_('content.prepare',$resume);

		?>

	</div>

This allows it to use the first 500 characters but I would like it to show the first <p> </p> tag of each product.

Thanks,
Shawn :S

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
12 years 4 months ago #56274

You should use that code:

$resume = preg_replace('#</p>.*#is','',$this->row->product_description);

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

  • Posts: 24
  • Thank you received: 0
12 years 4 months ago #56338

this is not working correctly, any other idea?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
12 years 4 months ago #56424

Try like that:
$resume = preg_replace('#</p>.*#is','</p>',$this->row->product_description);

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

  • Posts: 540
  • Thank you received: 49
11 years 4 months ago #111552

how to fix that?


сайт з перекладами www.benefit.in.ua
PS. спасибо переводить Webmoney : Z207635098627 R152456839841 или ЯД 410011027999056
Attachments:

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

  • Posts: 13201
  • Thank you received: 2322
11 years 4 months ago #111572

Hi,

This is probably due to "substr" which return a part of a string but it can too cut a character so it return this symbol because the character is not complete.
I think that the function "mb_substr" allow you to avoid that.

The following user(s) said Thank You: master_b

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

  • Posts: 540
  • Thank you received: 49
11 years 4 months ago #111584

Xavier wrote: Hi,

This is probably due to "substr" which return a part of a string but it can too cut a character so it return this symbol because the character is not complete.
I think that the function "mb_substr" allow you to avoid that.

tnx its help:)


сайт з перекладами www.benefit.in.ua
PS. спасибо переводить Webmoney : Z207635098627 R152456839841 или ЯД 410011027999056

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

  • Posts: 7
  • Thank you received: 0
7 years 10 months ago #259831

I have added a Read More Button as you describe above and it works fine on my desktop, but on a mobile device i see the button but it doesn't work. Do you have a sollution for this?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 10 months ago #259834

Hi,

There is no reason the button would display on the desktop and not on your smartphone unless you have custom CSS code to hide the button in such case.
And without a link, we can't analyze the page and tell you anything more precise about that.

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

Time to create page: 0.120 seconds
Powered by Kunena Forum