Can i add a phantom item with personalization to the cart?
Is it possible to add a phantom item to the cart, that has personalization?
I've tried the following code, but it didn't worked. The item is in the cart, but it has no personalizations.
var item = {
itemNumber: 123,
itemName: "personalizations test item",
price: 666,
quantity: 2,
personalizations: [{
personalization_id: 2,
question: "Your Name"
answer: "John"
}]
};
AC.cart.add(item, function(response) {
window.location = "/store/shopcart.aspx";
});
With the following code I've retrieved the cart:
AC.cart.get(function(response) {
var cart = response.cart || response.data;
console.log(cart.items);
});
-
Hi,
I think I found a solution, that works for me. Adding a phantom item still doesn’t work, but I was able to add a product with personalizations that already exists.
Important: the personalizations need to exists on the product, you can’t add them on demand. And the answers to this personalizations need to be in the correct orderInstead of:
var item = {
itemNumber: 123,
itemName: "personalizations test item",
price: 666,
quantity: 2,
personalizations: [{
personalization_id: 1,
question: "Question1?",
answer: "Answer1"
}]
};This was the correct formatting:
var item = {
itemNumber: 123,
itemName: "personalizations test item",
price: 666,
quantity: 2,
personalizations: “Answer1|Answer2”
};So I’m now using just one single product with one personalization, that gets added to the cart. A phantom product with personalizations still don’t seems to work :/
Best regards Patrick
0
Please sign in to leave a comment.
Comments
1 comment