Jump to content

Resolved - Longer Short Description Under Title in Cat List View


Recommended Posts

I wanted a longer description which appears underneath the product title in the catalogue list view.

In templates/content.category.php I found this around line 94 which appears to be the line which gives us the short description under the title in list view

{$product.description_short|strip_tags:true}

but I can't find where the value is specified to give the character length for the $product.description_short so instead I've changed the line of code to this:
 

{$product.description|truncate:125:"…"|strip_tags:true}

this does work but I wanted a] to be sure I've not done something that breaks coding elsewhere, which it doesn't seem to have done, and b] is there somewhere obvious I've missed where I can change or add a value to specify the .description_short length?

Link to comment
Share on other sites

In a recent version of CC6 (CC605, I believe), a dedicated short description was added to the product details. In my version of the suggested change, HTML tags were not stripped off so that bulletted lists and other stylings could be used. The Foundation skin panel will grow to accommodate the short description.

Now, if you are using a skin where the panel will not grow (which is a limitation of the skin), then stripping the tags and truncating the length is appropriate -- as a display decision of the skin, not as a general limitation in admin settings that would affect any and every skin you choose to use.

 

Link to comment
Share on other sites

OK that all makes sense and clearly in a custom skin the code modification will work but if we were looking at the default skin shipped with CC6 surely there must be a value declared somewhere either in Foundation or within CC6 which sets the precis length of the following piece of code

$product.description_short
Link to comment
Share on other sites

In CubeCart versions prior to CC605, the short description was derived from the long (or rather, only) description of the product. In admin, Store Settings, Layout tab, there is "Length of Product precis". This value is used to truncate the length of the displayed description.

A new feature in CC605, there is a test made. If there exists an actual 'short description', as entered on the Edit Product screen, then use it. If there isn't a short description, then derive one from the regular description.

The truncation happens in the Catalogue class, productAssign() function. Which means, this happens for all skins.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...