meta description in listing table

  • Posts: 3
  • Thank you received: 0
8 years 1 month ago #269094

-- HikaShop version -- : 2.6
-- Joomla version -- : 3.7
-- PHP version -- : 5.5
-- Browser(s) name and version -- : opera

hi

i would use meta description for my listing table , i modified show listing_table.php, and work, but if a product dont' have meta description ,i would show description ,

is possible to make it?

thanks

Please Log in or Create an account to join the conversation.

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
8 years 1 month ago #269098

Hello,

Why don't use an "if...else" in order to add this to your modification.
Something like this can make the trick :

<div class="description">
<?php
    if (!empty ($meta_description)) {
        echo $meta_description;
    }
    else {
        echo $description;
    }
?>
...
Hope this will help you.

Regards

Last edit: 8 years 1 month ago by Philip.
The following user(s) said Thank You: danilo87rm

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
8 years 1 month ago #269194

hi

thanks for the reply, i try but he show me meta and description , i want that in listing table i see only meta or only description , if meta was empty show me description, or show me meta_description if was no empty

this is the code for show meta 
<td class="hikashop_product_description_row">
            <span class="hikashop_product_description">
              <?php echo preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->row->product_meta_description); 
        ?>   </span>
          </td>
i try add a class and use if and else but i make an error and don't understand where

Last edit: 8 years 1 month ago by Jerome. Reason: replay => reply

Please Log in or Create an account to join the conversation.

  • Posts: 83987
  • Thank you received: 13603
  • MODERATOR
8 years 1 month ago #269200

Hi,

Philip is correct in suggesting to use a if...else condition like explained to do what you want.
So for example, instead of:
$this->row->product_meta_description
in your code, you would have:
(empty($this->row->product_meta_description)? $this->row->product_description : $this->row->product_meta_description)

Please understand that customization is outside of the user support. Please contact a developer if you need someone to help you with such customization.

The following user(s) said Thank You: danilo87rm

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum