Preserve WooCommerce HTML in product descriptions with a rich text editor.
Deploy Ladill Woo Manager / deploy (push) Successful in 1m16s

Stop stripping tags on sync so paragraphs and bold book titles round-trip to Woo.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-07 00:47:01 +00:00
co-authored by Cursor
parent 085645fd0f
commit 551473f8e5
10 changed files with 192 additions and 19 deletions
+4 -3
View File
@@ -5,6 +5,7 @@ namespace App\Services\Woo;
use App\Models\WooCategory;
use App\Models\WooProduct;
use App\Models\WooStore;
use App\Support\WooHtml;
class CatalogWriteService
{
@@ -112,8 +113,8 @@ class CatalogWriteService
'sale_price' => $this->majorPrice($input['sale_price'] ?? null),
'manage_stock' => (bool) ($input['manage_stock'] ?? false),
'stock_quantity' => isset($input['stock_quantity']) ? (int) $input['stock_quantity'] : null,
'short_description' => $input['short_description'] ?? null,
'description' => $input['description'] ?? null,
'short_description' => WooHtml::sanitize($input['short_description'] ?? null),
'description' => WooHtml::sanitize($input['description'] ?? null),
'categories' => $categories,
'images' => $input['images'] ?? null,
], fn ($value) => $value !== null && $value !== '');
@@ -127,7 +128,7 @@ class CatalogWriteService
return array_filter([
'name' => (string) ($input['name'] ?? ''),
'slug' => $input['slug'] ?? null,
'description' => $input['description'] ?? null,
'description' => WooHtml::sanitize($input['description'] ?? null),
'parent' => $parent > 0 ? $parent : 0,
], fn ($value) => $value !== null && $value !== '');
}