Jump to content

Homefeatured products ids


Recommended Posts

here it is

$(document).ready(function(){
var products = new Array();
$("#homefeatured li").each(function(){
products.push($(this).find("a.ajax_add_to_cart_button").attr('data-id-product'));
});
});

code creates an array of products' id numbers from homefeatured block

if you will use console.log(products) the result will be:
 

["885", "811", "112", "248", "856", "772", "219", "135", "518", "713", "453", "882", "885", "811", "112", "248", "856", "772", "219", "135", "518", "713", "453", "882"]
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...