Jump to content

How to update/format IsCleanHtml field ?


RakXiss

Recommended Posts

Hello,

I would like to update the description and description_short of a product.

These fields are isCleanHtml fomat regarding the Prestashop ducmentation.

So in my PHP code I tried to do this:

$product = new Product(Product::getIdByReference($cod));

$res = "new description short";
$des = "new description";

$product->description_short = $res;
$product->description = $des;

$product-> update();

But the DB is not updated.

I added the p tags on each side of the variable:

$product->description='<p> '.$des.' </p>';

But to no avail :(

Is there a special formatting for isCleanHtml PrestaShop type?

Is someone can help me ?

 

 

 

Link to comment
Share on other sites

10 hours ago, DaLyR said:

Did you tried to remove the space between $product-> and update();? Because you have a space $product-> update(); and without dev mode you can have no errors

it's a typo mistake, in my code there is no space.

Link to comment
Share on other sites

10 hours ago, endriu107 said:

Check this: 

 

That's doesn't works :(

I also tried :

$res=$art['pslres'];
$res=$this->mkhtml($res);
$res=utf8_encode($res);
$des=$art['psldes'];
$des=$this->mkhtml($des);
$des=utf8_encode($des);

$product->description->language[0] = "$des";
$product->description_short->language[0] = "$res";

No results

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...