• Resolved Chris

    (@mastertechmag)


    Is there a special filter we can add to the “Misc. Settings / Custom PHP code to modify output” section that would remove HTML tags from the export?

    Case example – some of our product titles have bold (<b></b>), break (<br/>), and style (<span style=""></span>) tags. When we export these products we want a clean export, without the HTML tags. Is that possible?

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author algol.plus

    (@algolplus)

    hi

    try this code.
    thanks, Alex

    add_filter( 'woe_xml_prepare_record', function($rec ) {
     array_walk_recursive($rec, "strip_tags");
     return $rec;
    });
    Thread Starter Chris

    (@mastertechmag)

    Thanks – After entering the code, the Preview came back beautifully. It actually converted the HTML as regular text – bolding where the “<b>” tags were and changing the styles where the “<span style>” tags were. But, when exporting and opening the .xlsx file in LibreOffice, it still showed the HTML tags.

    Any thoughts?

    I found a way to search/find/replace html tags in LibreOffice. So, if a php custom code doesn’t work, I have this as a back up. It just adds an extra step and time to the process that’s already too long.

    Plugin Author algol.plus

    (@algolplus)

    hi Chris

    My bad, here is tested code with fixed error.

    add_filter( 'woe_fetch_order', function($rec ,$order) {
     array_walk_recursive($rec,  function(&$a) {
       $a = strip_tags($a);
     } );
     return $rec;
    }, 10, 2);
    
    Thread Starter Chris

    (@mastertechmag)

    Thanks! Works like a charm.

    Plugin Author algol.plus

    (@algolplus)

    you’re welcome

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove HTML tags from export’ is closed to new replies.