Enhance Address Tag Processing in HTML Template Import: Updated the ImportHtmlTemplates command to replace address tags with a placeholder for contact address. This change improves the template processing by ensuring that address content is cleared and replaced dynamically, enhancing the overall integrity of imported templates.

This commit is contained in:
Ümit Tunç
2025-12-30 20:36:51 +03:00
parent 9d601cafda
commit b2e06ff101
@@ -223,6 +223,18 @@ class ImportHtmlTemplates extends Command
} }
// B. Genel İşlemler // B. Genel İşlemler
// 0. Address tag'larını setting.contact_address ile değiştir
$addresses = $xpath->query('.//address', $node);
foreach ($addresses as $address) {
// Address içeriğini temizle ve placeholder koy
while ($address->firstChild) {
$address->removeChild($address->firstChild);
}
$textNode = $node->ownerDocument->createTextNode('{setting.contact_address}');
$address->appendChild($textNode);
}
// 1. Resimler // 1. Resimler
$images = $xpath->query('.//img', $node); $images = $xpath->query('.//img', $node);
foreach ($images as $img) { foreach ($images as $img) {