Hello Dynamicweb
During project development we ran into a issue with the "add product to group" feature in the admin panel. It would throw a timeout-exception when searching for products, since our solution contains an huge amount. To solve this we had one of you, from dynamicweb, develop a GroupProductAttacherAddIn to handle this instead, which it does, nearly.
Here's a small snippit:
var selectedProducts = "";
$('#attach_form :checkbox:not(:disabled):checked').each(function () {
selectedProducts += "[" + $(this).val() + "];";
});
$.get("/admin/module/ecom_catalog/dw7/edit/EcomUpdator.aspx?CMD=AppendProductsToGroup&GroupID=@groupId&ProdArr=" + selectedProducts)
.done(function () {
window.close();
});
Reading this, the problem suddenly becomes apparent. The entire form of products is being added to the url, so when the user reaches +300 products, the url becomes too large to handle. To this end i thought a simple fix would be changing the $.get to the following:
$.ajax({
type: "POST",
url: "/admin/module/ecom_catalog/dw7/edit/EcomUpdator.aspx",
data: {
CMD: "AppendProductsToGroup",
GroupID: "@groupId",
ProdArr: selectedProducts
},
success: function () {
window.close();
}
});
After the post has finished, nothing happened to the product-group-relation.
So my first guess would be that the EcomUpdator doesn't accept parameters as Form Data, or is there something else that i am missing?
Best Regards, Jeppe