0

Using this I can update the category description but special characters are removed.

$category_Id = 6;
$category = $this->categoryFactory->create()->setStoreId(0)->load($category_Id);
$category->setDescription("Test1/4"" Test° ");
$category->save();

How can I keep a special character with description text?

any help will be appreciated. Thanks.

3
  • have you tried with - html_entity_decode(htmlentities(utf8_decode(strip_tags($description)))); ? Nov 26 '21 at 9:25
  • It's not working 1/4 removed Nov 26 '21 at 9:35
  • used only html_entity_decode() Nov 26 '21 at 9:42
0

$category_Id = 6;

$description="Test1/4"" Test";

$description=html_entity_decode($description)

$category = $this->categoryFactory->create()->setStoreId(0)->load($category_Id);

$category->setDescription($description);

$category->save();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.