Post by HealthWyze » Fri Aug 17, 2018 10:22 pm

In my theme, the sentence or so of the description is shown underneath the images of the product on the category pages, and using the "latest" module. I would like to change this behavior to instead show the meta description, but I don't know how.

In the file ./catalog/view/theme/*/template/extension/module/latest.tpl, I found:

Code: Select all

<p><?php echo $product['description']; ?></p>
          <?php if ($product['rating']) { ?>
So I tried changing that to:

Code: Select all

<p><?php echo $product['meta_description']; ?></p>
          <?php if ($product['rating']) { ?>
But then the area just became white space (no description or meta description showed).

I'd really appreciate some help.

Newbie

Posts

Joined
Fri Oct 24, 2014 10:23 am


Post by HealthWyze » Fri Aug 17, 2018 10:48 pm

I fixed it!

The trick is to also alter catalog/controller/extension/module/latest.php.

Find this line:

Code: Select all

   'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..',
Define meta_description underneath it, as so:

Code: Select all

'meta_description'    => utf8_substr(strip_tags(html_entity_decode($result['meta_description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get($this->config->get('config_theme') . '_product_description_length')) . '..',
VQmod that alters both files is attached.

Attachments


Newbie

Posts

Joined
Fri Oct 24, 2014 10:23 am

Who is online

Users browsing this forum: No registered users and 3 guests