- Posts: 3
- Thank you received: 0
meta description in listing table
- danilo87rm
-
Topic Author
- Offline
Less
More
9 years 6 months ago #269094
by danilo87rm
meta description in listing table was created 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
-- 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
Replied by Philip on topic meta description in listing table
Hello,
Why don't use an "if...else" in order to add this to your modification.
Something like this can make the trick :
Hope this will help you.
Regards
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;
}
?>
...
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.
- danilo87rm
-
Topic Author
- Offline
Less
More
- Posts: 3
- Thank you received: 0
9 years 6 months ago - 9 years 6 months ago #269194
by danilo87rm
Replied by danilo87rm on topic meta description in listing table
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
i try add a class and use if and else but i make an error and don't understand where
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>
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
Replied by nicolas on topic meta description in listing table
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.
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