ONCE upon a time not so long ago, one partner wanted to display a “short description” for the product, which is totally different from the description used in the product page. There are several good reasons for that:
- By default Zencart can help you to display the first X characters, however this cannot help you to give the customers a good summary of the product (good for customers)
- Using a customized short description can let you craft your own keyword-rich description on the listing page (good for seo, if you don’t overdo it)
So I took a look around and notice there is one module that can do it:
This approach has 2 major drawbacks, however
- It is more complicated than it should be
- It is not included in search (unless you edit the search code)
So we came up with another method which is way easier than that: what if we put both the short description AND the normal description in one field, and later we split them when we display on the front end? Now there is no need for additional field and no need to edit search code.
Obviously there are multiple options for you to choose, if you want a complete solution you can use xml for example, so you can put this into your description
Then you will have to parse this xml string before you display on the front end of course.
Alternatively, you can choose to use json, etc… However, if you want to keep it as simple as possible and you don’t have many additional field anyway (just the short description for example), the perhaps this is the easiest:
You can put this in your desc:
Then on your front end, you just have to “explode” the $products_description like this:
// now $desc will contain the short description; $desc will contain the short description
Hopefully this tip will help you
No related posts.