Post by magzen » Wed May 20, 2015 8:34 am

Can someone please help me with a query i can run to remove image links from the body description?

Following is a example:
<br><img src="image/catalog//products/homegarden/petsupplies/descriptionImage1.jpg"><br><br><img src="image/catalog//products/homegarden/petsupplies/descriptionImage2.jpg"><br>

I prefer not to export all products (200,000) and use excel, it would take to much time.

this query shouldnt be so difficult for someone who knows mysql.

Thanks

Active Member

Posts

Joined
Tue Jun 05, 2012 7:04 pm

Post by Avvici » Tue May 26, 2015 1:32 am

Using MYsql won't help you when it comes to NEW items. It can only remove the existing ones :) O0

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by artcore » Tue May 26, 2015 1:39 am

You could just hide them using CSS, including future ones ;D

Code: Select all

.product-description img{display:none;}
<!--change selector accordingly-->

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by OpenTeam » Tue May 26, 2015 1:43 am

Hello,

If I am not mistaken, you want to remove the images from the product description?

If so, you must go to catalog/controller/catalog/product.php and replace the line below:

Code: Select all

$data['description'] = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');
with

Code: Select all

$data['description'] = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');
$data['description'] = preg_replace("/<img[^>]+\>/i", "", $data['description']);
Hope it helps.

User avatar
Active Member

Posts

Joined
Tue May 19, 2015 2:31 am

Post by magzen » Sat May 30, 2015 11:13 pm

Thanks for all the answers! O0 ^-^

Active Member

Posts

Joined
Tue Jun 05, 2012 7:04 pm
Who is online

Users browsing this forum: Google [Bot] and 9 guests