There are two issues when the shortened version of the product description is created.
1. Two dots are added to the end of the description, when, in fact, what should be added is three to form a proper ellipse. Of course - if the shortened version already ends with a period, then added just 2 is OK. This should be pretty easy to fix.
2. HTML entities (like ) get truncated in certain circumstances. I have a product who's description ends like so: "Available on Amazon.com. &nb.." The non-breaking spaces were added, because I didn't want the first few characters of the next sentence. Hmmmm.... Now we get a little complicated. I suppose the short description creation should also remove or translate HTML entities so they don't get truncated. However - then we have no control over removing unwanted characters in the short description. Perhaps in an update you can add the ability to enter a SEPARATE short description rather than truncating the full description?
1. Two dots are added to the end of the description, when, in fact, what should be added is three to form a proper ellipse. Of course - if the shortened version already ends with a period, then added just 2 is OK. This should be pretty easy to fix.
2. HTML entities (like ) get truncated in certain circumstances. I have a product who's description ends like so: "Available on Amazon.com. &nb.." The non-breaking spaces were added, because I didn't want the first few characters of the next sentence. Hmmmm.... Now we get a little complicated. I suppose the short description creation should also remove or translate HTML entities so they don't get truncated. However - then we have no control over removing unwanted characters in the short description. Perhaps in an update you can add the ability to enter a SEPARATE short description rather than truncating the full description?
You could use the "meta_description" for your short description instead of the truncated full description.jennarif wrote:Perhaps in an update you can add the ability to enter a SEPARATE short description rather than truncating the full description?
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
It would require a modification. This would probably need to be done for the modules (bestsellers, featured, latest and special) as well as the product pages (category, compare, manufacturer, product, search and special).
In the controller for each of these, there is a block of code that looks similar to the following:
Replacing the 'description' line with the following should work:
In the controller for each of these, there is a block of code that looks similar to the following:
Code: Select all
$data['products'][] = array(
'product_id' => $result['product_id'],
'thumb' => $image,
'name' => $result['name'],
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'rating' => $rating,
'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']),
);
Code: Select all
'description' => html_entity_decode($result['meta_description'], ENT_QUOTES, 'UTF-8'),
Modules for OpenCart 2.3.0.2
Homepage Module [Free - since OpenCart 0.7.7]
Multistore Extensions
Store Manager Multi-Vendor/Multi-Store management tool
If you're not living on the edge ... you're taking up too much space!
Who is online
Users browsing this forum: No registered users and 10 guests