Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mod = Mage::getModel('wishlist/wishlist')->getCollection();
- $data_wishlist = array();
- foreach($mod as $data)
- {
- $item_array = array();
- $load = Mage::getModel('wishlist/wishlist')->load($data->getId())->getItemCollection();
- $customer = Mage::getModel('customer/customer')->load($data->getCustomerId());
- $count = 0;
- foreach($load as $item)
- {
- $product = $item->getProduct();
- $stockItem = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product->getId());
- $item_array[] = array(
- 'product_id' => $product->getId(),
- 'product_name' => $product->getName(),
- 'qty_ordered' => $item->getQty(),
- 'stock_available' => $stockItem->getIsInStock()
- );
- $count++;
- }
- if($count){
- $data_wishlist[] = array(
- 'customer_id' => $data->getCustomerId(),
- 'customer_email' => $customer->getEmail(),
- 'customer_name' => $customer->getFirstname() .' '. $customer->getLastname(),
- 'last_update' => $data->getUpdatedAt(),
- 'item_list' => $item_array
- );
- };
- }
- echo '<pre>';
- print_r($data_wishlist);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement