Skip to main content

meta description in listing table

9 years 6 months ago #269094 by danilo87rm
-- 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.

9 years 6 months ago - 9 years 6 months ago #269098 by Philip
Hello,

Why don't use an "if...else" in order to add this to your modification.
Something like this can make the trick :
Code:
<div class="description"> <?php if (!empty ($meta_description)) { echo $meta_description; } else { echo $description; } ?> ...
Hope this will help you.

Regards
Last edit: 9 years 6 months ago by Philip.
The following user(s) said Thank You: danilo87rm

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

9 years 6 months ago - 9 years 6 months ago #269194 by danilo87rm
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
Code:
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: 9 years 6 months ago by Jerome. Reason: replay => reply

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

9 years 6 months ago #269200 by nicolas
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.072 seconds
Powered by Kunena Forum