Jump to content

Description of Products


SergioE

Recommended Posts

Hii,

 

I want to put only the content of the product in the long description , in order to show how short description about the first two or three lines long description by a truncate . There would have to make changes in the product.php and the .tpl guess not ?

 

Someone can tell me how to make these changes ?

 

Sorry for my English.

Edited by SergioE (see edit history)
Link to comment
Share on other sites

 

 

I want to put only the content of the product in the long description 

content of what? can you shed some more light on this please?

 

you mean that as a "short" description you want to show:

- several lines of product description

- create some kind of "more" button

- when someone press it, the rest of product description will appear

 

?

Link to comment
Share on other sites

Hello. Try this.

 

Open product.tpl

 

Find:

{if $product->description}
	<!-- More info -->
	<section class="page-product-box">

Replace with:

{if $product->description}
	<!-- More info -->
	<section class="page-product-box" id="full-desc">

And add to your link where you have "Read more" anchor so it would lead to full description.

 

For example: <a href="#full-desc">Read more</a>

Link to comment
Share on other sites

If you want to replace the short description with a truncated version of the long description, change the following at around line 181 of themes/default-bootstrap/product.tpl:

						<div id="short_description_content" class="rte align_justify" itemprop="description">{$product->description_short}</div>

to:

						<div id="short_description_content" class="rte align_justify" itemprop="description">{$product->description|truncate:300}</div>

Change 300 to the maximum number of characters you want to have.

Link to comment
Share on other sites

Yeah, but I see you do not understand what I want . Attached pictures to see it.

 

I want to put the content in the long description , and which have short description for example the first 100 words of the long description. Because if I copy and paste the contents of the short description in the long run would not duplicate content ?

 

With the pictures you understand now?

 

Thank you

post-857526-0-30220500-1471422137_thumb.png

post-857526-0-79852300-1471422137_thumb.png

Edited by SergioE (see edit history)
Link to comment
Share on other sites

It does not work, only appears when you insert a character in the short description. If empty , nothing appears.

 

This is the code:

	<div id="short_description_block">
					{if $product->description_short}
						<div id="short_description_content" class="rte align_justify" itemprop="description">{$product->description|truncate:300}</div>
					{/if}
 <section class="page-product-box">
            	<h3 class="page-product-heading">{l s='More info'}</h3>{/if}
        		{if isset($product) && $product->description}
           	 		<!-- full description -->
            		<div  class="rte">{$product->description}</div>
            </section>
Link to comment
Share on other sites

Oops. Try:

{*{if $product->description_short}*}
						<div id="short_description_content" class="rte align_justify" itemprop="description">{$product->description|truncate:300}</div>
{*					{/if}*}

Removing the if statement should allow it to work without a short description.

Link to comment
Share on other sites

Is for the condition "if" ??

{if $product->description_short || $packItems|@count > 0}
				<div id="short_description_block">
					{if $product->description_short}
						<div id="short_description_content" class="rte align_justify" itemprop="description">{$product->description|truncate:300}</div>
					{/if}
Link to comment
Share on other sites

I still blank out the description , only the sample in the long description.
 

Still blank out the description , only the sample in the long description . In the short description which should leave the repetition of the long description , but with 300 characters , nothing appears.

 

I attached my file.I 
Edited by SergioE (see edit history)
Link to comment
Share on other sites

Now it works , the code has been so tell me if it's okay:

{*{if $product->description_short || $packItems|@count > 0}*}
				<div id="short_description_block">
					{*{if $product->description_short}*}
						<div id="short_description_content" class="rte align_justify" itemprop="description">{$product->description|truncate:300}</div>
					{*{/if}*}

					{if $product->description}
						<p class="buttons_bottom_block">
							<a href="#descriptionTab" class="button">
								{l s='More details'}
							</a>
						</p>
					{/if}
                <!--{if $packItems|@count > 0}
						<div class="short_description_pack">
						<h3>{l s='Pack content'}</h3>
							{foreach from=$packItems item=packItem}

							<div class="pack_content">
								{$packItem.pack_quantity} x <a href="{$link->getProductLink($packItem.id_product, $packItem.link_rewrite, $packItem.category)|escape:'html':'UTF-8'}">{$packItem.name|escape:'html':'UTF-8'}</a>
								<p>{$packItem.description_short}</p>
							</div>
							{/foreach}
						</div>
					{/if}-->
            </div> <!-- end short_description_block -->
        {*{/if}*}

I guess this would not cause duplicate content , no?

Edited by SergioE (see edit history)
Link to comment
Share on other sites

  • 3 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...