tozi Posted January 5, 2014 Share Posted January 5, 2014 (edited) Hi all, how can i show the shordescription in modul productcategory? Link here http://simplydesign.sk/arris/index.php?id_product=2&controller=product&id_lang=1 Edited January 5, 2014 by tozi (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted January 5, 2014 Share Posted January 5, 2014 you can use variable: {$categoryProduct.description_short} in module .tpl file. {foreach from=$categoryProducts item='categoryProduct' name=categoryProduct} <li {if count($categoryProducts) < 6}style="width:60px"{/if}> <a href="{$link->getProductLink($categoryProduct.id_product, $categoryProduct.link_rewrite, $categoryProduct.category, $categoryProduct.ean13)}" class="lnk_img" title="{$categoryProduct.name|htmlspecialchars}"><img src="{$link->getImageLink($categoryProduct.link_rewrite, $categoryProduct.id_image, 'medium_default')|escape:'html'}" alt="{$categoryProduct.name|htmlspecialchars}" /></a> <p class="product_name"> <a href="{$link->getProductLink($categoryProduct.id_product, $categoryProduct.link_rewrite, $categoryProduct.category, $categoryProduct.ean13)|escape:'html'}" title="{$categoryProduct.name|htmlspecialchars}">{$categoryProduct.name|truncate:14:'...'|escape:'htmlall':'UTF-8'}</a> </p> {if $ProdDisplayPrice AND $categoryProduct.show_price == 1 AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} <p class="price_display"> <span class="price">{convertPrice price=$categoryProduct.displayed_price}</span> </p> {else} <br /> {/if} {$categoryProduct.description_short} </li> {/foreach} Link to comment Share on other sites More sharing options...
tozi Posted January 5, 2014 Author Share Posted January 5, 2014 (edited) Thanks works but in description show tag <p> <div id="{if count($categoryProducts) > 3}productscategory{else}productscategory_noscroll{/if}"> {if count($categoryProducts) > 3}<a id="productscategory_scroll_left" title="{l s='Previous' mod='productscategory'}" href="javascript:{ldelim}{rdelim}">{l s='Previous' mod='productscategory'}</a>{/if} <div id="productscategory_list"> <ul {if count($categoryProducts) > 5}style="width: {math equation="width * nbImages" width=107 nbImages=$categoryProducts|@count}px"{/if}> {foreach from=$categoryProducts item='categoryProduct' name=categoryProduct} <li {if count($categoryProducts) < 6}"{/if}> <a href="{$link->getProductLink($categoryProduct.id_product, $categoryProduct.link_rewrite, $categoryProduct.category, $categoryProduct.ean13)}" class="lnk_img" title="{$categoryProduct.name|htmlspecialchars}"><img src="{$link->getImageLink($categoryProduct.link_rewrite, $categoryProduct.id_image, 'medium_default')|escape:'html'}" alt="{$categoryProduct.name|htmlspecialchars}" /></a> <p class="product_name"> <a href="{$link->getProductLink($categoryProduct.id_product, $categoryProduct.link_rewrite, $categoryProduct.category, $categoryProduct.ean13)|escape:'html'}" title="{$categoryProduct.name|htmlspecialchars}">{$categoryProduct.name|truncate:14:'...'}</a> </p> {if $ProdDisplayPrice AND $categoryProduct.show_price == 1 AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} <p class="price_display"> <span class="price">{convertPrice price=$categoryProduct.displayed_price}</span> </p> {else} <br /> {/if} <div class="textdescription">{$categoryProduct.description_short|truncate:75:'...'|escape:'htmlall':'UTF-8'}</div> </li> {/foreach} </ul> </div> Any idea? edit: solved Edited January 5, 2014 by tozi (see edit history) Link to comment Share on other sites More sharing options...
fishingnet Posted January 22, 2014 Share Posted January 22, 2014 Thanks works but in description show tag <p> <div id="{if count($categoryProducts) > 3}productscategory{else}productscategory_noscroll{/if}"> {if count($categoryProducts) > 3}<a id="productscategory_scroll_left" title="{l s='Previous' mod='productscategory'}" href="javascript:{ldelim}{rdelim}">{l s='Previous' mod='productscategory'}</a>{/if} <div id="productscategory_list"> <ul {if count($categoryProducts) > 5}style="width: {math equation="width * nbImages" width=107 nbImages=$categoryProducts|@count}px"{/if}> {foreach from=$categoryProducts item='categoryProduct' name=categoryProduct} <li {if count($categoryProducts) < 6}"{/if}> <a href="{$link->getProductLink($categoryProduct.id_product, $categoryProduct.link_rewrite, $categoryProduct.category, $categoryProduct.ean13)}" class="lnk_img" title="{$categoryProduct.name|htmlspecialchars}"><img src="{$link->getImageLink($categoryProduct.link_rewrite, $categoryProduct.id_image, 'medium_default')|escape:'html'}" alt="{$categoryProduct.name|htmlspecialchars}" /></a> <p class="product_name"> <a href="{$link->getProductLink($categoryProduct.id_product, $categoryProduct.link_rewrite, $categoryProduct.category, $categoryProduct.ean13)|escape:'html'}" title="{$categoryProduct.name|htmlspecialchars}">{$categoryProduct.name|truncate:14:'...'}</a> </p> {if $ProdDisplayPrice AND $categoryProduct.show_price == 1 AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} <p class="price_display"> <span class="price">{convertPrice price=$categoryProduct.displayed_price}</span> </p> {else} <br /> {/if} <div class="textdescription">{$categoryProduct.description_short|truncate:75:'...'|escape:'htmlall':'UTF-8'}</div> </li> {/foreach} </ul> </div> Any idea? edit: solved Hello ! how you solved? Can you tell us? For me, the short description show tag <div> Please ! Link to comment Share on other sites More sharing options...
tozi Posted January 22, 2014 Author Share Posted January 22, 2014 Look my productscategory.tpl <div id="productscategory_list"> <ul {if count($categoryProducts) > 5}style="width: {math equation="width * nbImages" width=107 nbImages=$categoryProducts|@count}px"{/if}> {foreach from=$categoryProducts item='categoryProduct' name=categoryProduct} <li {if count($categoryProducts) < 6}style="width:60px"{/if}> <div class="product_name"> <h5><a href="{$link->getProductLink($categoryProduct.id_product, $categoryProduct.link_rewrite, $categoryProduct.category, $categoryProduct.ean13)|escape:'html'}" title="{$categoryProduct.name|htmlspecialchars}">{$categoryProduct.name|truncate:30:'...'|escape:'htmlall':'UTF-8'}</a></h5> </div> <a href="{$link->getProductLink($categoryProduct.id_product, $categoryProduct.link_rewrite, $categoryProduct.category, $categoryProduct.ean13)}" class="lnk_img" title="{$categoryProduct.name|htmlspecialchars}"><img src="{$link->getImageLink($categoryProduct.link_rewrite, $categoryProduct.id_image, 'medium_default')|escape:'html'}" alt="{$categoryProduct.name|htmlspecialchars}" /></a> <div class="textdescription">{$categoryProduct.description_short|truncate:60:'...'}</div> {if $ProdDisplayPrice AND $categoryProduct.show_price == 1 AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} <p class="price_display"> <span class="price">{convertPrice price=$categoryProduct.displayed_price}</span> </p> {else} <br /> {/if} </li> {/foreach} </ul> 1 Link to comment Share on other sites More sharing options...
fishingnet Posted January 22, 2014 Share Posted January 22, 2014 I understand that you clear the '| escape:' htmlall ':' UTF-8 '" part, in your code? Is it ok? Because it works Link to comment Share on other sites More sharing options...
tozi Posted January 22, 2014 Author Share Posted January 22, 2014 yes exactly 1 Link to comment Share on other sites More sharing options...
fishingnet Posted January 22, 2014 Share Posted January 22, 2014 (edited) Thanks a lot ! I already have a headache with this code.! Thank you again ! Bogdan Edited January 22, 2014 by fishingnet (see edit history) Link to comment Share on other sites More sharing options...
tozi Posted January 22, 2014 Author Share Posted January 22, 2014 You're welcome. Link to comment Share on other sites More sharing options...
fishingnet Posted January 29, 2014 Share Posted January 29, 2014 you can use variable: {$categoryProduct.description_short} in module .tpl file. {foreach from=$categoryProducts item='categoryProduct' name=categoryProduct} <li {if count($categoryProducts) < 6}style="width:60px"{/if}> <a href="{$link->getProductLink($categoryProduct.id_product, $categoryProduct.link_rewrite, $categoryProduct.category, $categoryProduct.ean13)}" class="lnk_img" title="{$categoryProduct.name|htmlspecialchars}"><img src="{$link->getImageLink($categoryProduct.link_rewrite, $categoryProduct.id_image, 'medium_default')|escape:'html'}" alt="{$categoryProduct.name|htmlspecialchars}" /></a> <p class="product_name"> <a href="{$link->getProductLink($categoryProduct.id_product, $categoryProduct.link_rewrite, $categoryProduct.category, $categoryProduct.ean13)|escape:'html'}" title="{$categoryProduct.name|htmlspecialchars}">{$categoryProduct.name|truncate:14:'...'|escape:'htmlall':'UTF-8'}</a> </p> {if $ProdDisplayPrice AND $categoryProduct.show_price == 1 AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} <p class="price_display"> <span class="price">{convertPrice price=$categoryProduct.displayed_price}</span> </p> {else} <br /> {/if} {$categoryProduct.description_short} </li> {/foreach} Hello again! I tried to do the same thing in crossselling module using variable {$orderProduct.description_short} and not working. Sorry for coming back to this solved topic again! Bogdan Link to comment Share on other sites More sharing options...
vekia Posted January 30, 2014 Share Posted January 30, 2014 Hello again! I tried to do the same thing in crossselling module using variable {$orderProduct.description_short} and not working. Sorry for coming back to this solved topic again! Bogdan about what crosseling module you're talking? Link to comment Share on other sites More sharing options...
fishingnet Posted January 30, 2014 Share Posted January 30, 2014 (edited) "Customers who bought this product also bought...". In product page, similar to productscategory module. I have attached pictures for a better understanding. I also want to put the label "new" to the new product images Edited January 30, 2014 by fishingnet (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted January 30, 2014 Share Posted January 30, 2014 this is default crosseling module? Link to comment Share on other sites More sharing options...
fishingnet Posted January 30, 2014 Share Posted January 30, 2014 Yes, is the default module with some changes in .tpl file, .js file and .php file, to display 4 products with "home" size images. And of course styles with .css file. Link to comment Share on other sites More sharing options...
tozi Posted January 31, 2014 Author Share Posted January 31, 2014 URL of page? Insert here also code from tpl. Link to comment Share on other sites More sharing options...
fishingnet Posted January 31, 2014 Share Posted January 31, 2014 (edited) Thanks for your reply, Tozi! In my live shop, the module is not active, but of course you can see on any product page, the productscategory module working, thanks to you. See this or any other page you want. Attached photos from previous post are taken from localhost, where I put my whole store for tests. For crossselling module I used the following code: <div class="product_desc"><a href="{$orderProduct.link}" title="{l s='More' mod='crossselling'}">{$orderProduct.description_short|strip_tags|truncate:70:'...'}</a></div> It does not work. It seems that the "$orderProduct.description_short" variable is not defined anywhere. Thank you again ! Edited January 31, 2014 by fishingnet (see edit history) Link to comment Share on other sites More sharing options...
tozi Posted January 31, 2014 Author Share Posted January 31, 2014 Did you try only <div class="product_desc"><a href="{$orderProduct.link}" title="{l s='More' mod='crossselling'}">{$product.description_short|strip_tags|truncate:70:'...'}</a></div> Link to comment Share on other sites More sharing options...
fishingnet Posted January 31, 2014 Share Posted January 31, 2014 Yes, not working. "Fatal error: Cannot use object of type Product as array in ..." Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now