fix: add category associations to product XML for PS shop context
Including <associations><categories> in the product XML triggers Product::addToCategories() in PS, which may also invoke the shop association logic needed to populate ps_product_shop. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
776e761a94
commit
9c16d45c0e
|
|
@ -264,6 +264,13 @@ public class PrestashopClient {
|
|||
sb.append("<name><language id=\"1\">").append(escapeXml(name)).append("</language></name>");
|
||||
sb.append("<description><language id=\"1\">").append(escapeXml(description)).append("</language></description>");
|
||||
sb.append("<description_short><language id=\"1\">").append(escapeXml(descShort)).append("</language></description_short>");
|
||||
if (dto.idCategoryDefault() != null) {
|
||||
sb.append("<associations>");
|
||||
sb.append("<categories nodeType=\"category\" api=\"categories\">");
|
||||
sb.append("<category><id>").append(escapeXml(dto.idCategoryDefault())).append("</id></category>");
|
||||
sb.append("</categories>");
|
||||
sb.append("</associations>");
|
||||
}
|
||||
sb.append("</product>");
|
||||
sb.append("</prestashop>");
|
||||
return sb.toString();
|
||||
|
|
|
|||
Loading…
Reference in New Issue