The issue is that I don't know until run-time when I add an item to the basket what the properties will be and I want the correct names and not generic ones so that the options are shown correctly in the basket and order confirmation screens.
Thanks, but how do you specify different property names if you don't know what the names of the properties will be until you add the item to the basket? For reference I am using the following function and I need to be able to specify what the different property names will be at the time a product is added to the basket.
You can loop the cfg objects and see which ones have values and then build an array with the key and value pairs that you want to be in properties. Search for basic Javascript and jQuery :)
Many thanks, that information has pointed me in the right direction. Still getting to grips with some aspects of jquery and javascript so apologies if some of my questions seemed a little silly...
Custom order properties
I am using the Javascript API to add order lines to an order and I am trying to add custom properties as in the following example:
TC.addOrUpdateOrderLine({storeId:1, productIdentifier:1262, quantity:1, properties:{color:'red', size: '40'}});
The issue I have is that the property name can vary depending on the product, so for example one product might have the following properties:
Colour Bezel
Whereas another might have:
Top Colour Bottom Colour Voltage
How do I add the name of the option as a property, currently I have:
However if I try the following:
It doesn't like the .name part. I am not 100% with jQuery yet so can anyone tell me if there is a way around this??
Hi Graham
You can't do naming with config.name in JavaScript - it expects an object to do this. So you will do config1Name instead.
Hi Anders,
Does that mean that I am unable to have property names that can vary, a couple of examples are as follows:
The issue is that I don't know until run-time when I add an item to the basket what the properties will be and I want the correct names and not generic ones so that the options are shown correctly in the basket and order confirmation screens.
You can easily have different property names. You can add all the things you want to.
Thanks, but how do you specify different property names if you don't know what the names of the properties will be until you add the item to the basket? For reference I am using the following function and I need to be able to specify what the different property names will be at the time a product is added to the basket.
You can loop the cfg objects and see which ones have values and then build an array with the key and value pairs that you want to be in properties. Search for basic Javascript and jQuery :)
Many thanks, that information has pointed me in the right direction. Still getting to grips with some aspects of jquery and javascript so apologies if some of my questions seemed a little silly...
is working on a reply...