const plpElementsData = {
  productCodeAttribute: 'data-product-code',
  productCardClass: '.product-card',
  productListClass: '.products-list'
}

const getProductId = (favouriteElement) => {
  const productCard = favouriteElement.closest(plpElementsData.productCardClass);
  return productCard.attr(plpElementsData.productCodeAttribute)
}

$(document).ready(function () {
  Wick.FavouriteProduct.init(plpElementsData.productListClass, getProductId)
})