I have a shopping cart that can contain variable number of products based on the customer's preference. I would line to know how to create and pass an array containing all the items in php to the javascript code before order creation. Any help regarding this would be really helpful. createOrder: function(data, actions) {
return actions.order.create({
intent:"CAPTURE",
application_context:{
shipping_preference: 'SET_PROVIDED_ADDRESS',
return_url :"",
},
purchase_units: [{
amount: {
currency_code: "USD",
value: "<?php echo $total ?>"
},
items: { //THIS IS WHERE I WANT TO INCLUDE EACH ITEM USING PHP
}
}]
});
}
... View more