Jump to content

Why is "$PRODUCT.description_short" so ... um ... short and without formatting?


Recommended Posts

Hello again,

over the weekend, I dove deeper into CC, especially to make it look the way I want to. I started with the "Minimalizer"-skin as a base, but I have made a lot of changes since.

Generally speaking, is there a list or something of every variable that is available for output in a template. For example, I had "$PRODUCT.description" in my template, but I had to search around to find "$PRODUCT.description_short" as a parameter.

On my product page, I want to have the image(s) top left, the general description to the right, just like the standard skin.

Below the image, I want to put the ingredients and allergen info to get a more pleasant layout.
In Admin, I entered this info into the short desciption.

In the store however, this description is cut short to a certain amount of characters. I believe in the list for it's intended for, this makes sense. But in my case I need the whole content to be displayed. I searched through all files, but I can't figure out where the limiting happens.

Also, it's displayed as plain text instead of HTML. By searching around, I found different parameters that could be added. I tried:

  • {$PRODUCT.description_short|unescape:"html"}
  • {$PRODUCT.description_short|escape:"html"}
  •  {$PRODUCT.description_short|unescape:"htmlall"}
  • {$PRODUCT.description_short|escape:"htmlall"}

None of those seems to do much.
How can I get the full short description inluding HTML to show?

Cheers.

Link to comment
Share on other sites

By definition, the "Short Description" is intended to be extraordinarily concise, as it is intended to be shown where screen real estate is at a premium (Category List view, for example).

The "original" short description feature request did not truncate the contents. It was expected that the admin would compose headline-like content. However, the final implementation did adopt the "precis limit".

In admin, Store Settings, Layout tab, "Length of product precis", this value is the limit on how many characters will be displayed. If the content, with HTML tags, exceeds this, CubeCart then tries a version after having stripped out all the HTML. If not exceeded, the content gets displayed with all styling. Otherwise, the "plain" version is used and if that still exceeds the limit, it gets truncated and an ellipsis is appended.

If you really want to use the Short Description for not-in-any-way concise content, set this limit to 65000 (the max the database can hold).

There are plugins available that will give you more product settings - additional fields for technical details and what-not.

If your site is not really available publicly, consider making a small change to the skin template main.php. Add {debug} to the very end. This will show a popup window listing all the template variables used and their values.

Link to comment
Share on other sites

As always, perfect help, thank you!

"Short" description works perfectly now, including HTML. In my setting its also acceptacle when in list-form.

More fields for products would be very desireable though. In another post I found a link to an extension like "More Product Fields", but it was dead.
Would you happen to know such a working extension?

Also the {debug} trick is great. I have to go through this massive list, but it seems very valuable to have.

As much as I like this forum and all your help, I don't want to bother you more than necessary. Is there any ressource, where I can learn about the basic things like this {debug} feature, or how to change templates and such?
I would also learn more about "hooks" and how to make (simple) changes to the functionality myself.

With all the time I have spent now and the client already ordered, I am sure there will be more shops to come with more reqirements.

Link to comment
Share on other sites

The vast bulk of that debug popup is the $LANG variable, which provides very little diagnostic relevance. I made a tweak so that this variable is unloaded from the debug popup.

The {debug} can be applied to any skin template to show only the variables and values that Smarty has "seen" so far. I suggested the main.php template as that is the last template to be rendered, and thus contains all the variables worked on in the myriad templates that are used in the main.php template.

Unfortunately, there is no User's Manual (nor SDK) for CubeCart. There is, however, a "tour" an admin can take. There are also various (uncurated) blog posts scattered throughout the Internet giving tours and very basic steps to set up a store.

CubeCart uses the template rendering engine Smarty. See: https://www.smarty.net/docs/en/

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...