First array:
var products_cart = [1, 2, 2]; (these are the products_id's)
Second array:
var cart_details =
[{
product_id: 1,
product_name: 'product love',
category_name: 'love'
},
{
product_id: 2,
product_name: 'product birthday love',
category_name: 'birthday'
}]
I want to loop through the elements of the array products_cart and use the product_id from products_cart to render details from cart_details (loop through them I suppose), how is this possible?
EDIT:
I think some of you got me wrong, I basically want this to render something like this:
[{
product_id: 1,
product_name: 'product love',
category_name: 'love'
},
{
product_id: 2,
product_name: 'product birthday love',
category_name: 'birthday'
},
{
product_id: 2,
product_name: 'product birthday love',
category_name: 'birthday'
}
]
My mistake, I wasn't clear enough.
product_cart!?