Page 1 of 1

Issues with Carrier Return/Line Feed in product description when use Facebook for OpenCart Extension

Posted: Sun Sep 20, 2020 10:57 pm
by Rod2k
Hello guys, this is a simple question, I have connected my store (www.rolistore.com) with my fanpage, but I can't resolve this:
I'm using HTML in the product description to format the text, but when the FB for OC submit the same description, it looks in only one line, I tried everything in the OC Product description, but nothing works.
for instance:
OC Product
https://www.rolistore.com/abyssus-lite-goliathus-mobile
FB Fanpage
https://www.facebook.com/marketplace/it ... 724912091/

Any Suggestion?

OC Version: 3.0.3.2

Re: Issues with Carrier Return/Line Feed in product description when use Facebook for OpenCart Extension

Posted: Mon Sep 21, 2020 4:06 am
by straightlight
If using an extension, contact the extension developer to resolved this issue.

Re: Issues with Carrier Return/Line Feed in product description when use Facebook for OpenCart Extension

Posted: Mon Sep 21, 2020 8:36 am
by letxobnav
That extension strips all html tags from the description so it will look like that.
Then again, perhaps it is a FB requirement that the description does not contain html, so better check that before trying to change the extension.

Code: Select all

    $description = $this->facebookcommonutils->getProperFormattedString(
      $product['description']);

Code: Select all

  public function getProperFormattedString($text) {
    if ((bool)$text) {
      return trim(strip_tags(html_entity_decode(
        html_entity_decode($text),
        ENT_QUOTES | ENT_COMPAT,
        'UTF-8')));
    } else {
      return '';
    }
  }