magento 1.9 get all product

//to overwrite limit but you need first to increase your memory limit

 $collection = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*') // select all attributes
->setPageSize(5000) // limit number of results returned
->setCurPage(1); // set the offset (useful for pagination)

// we iterate through the list of products to get attribute values
foreach ($collection as $product) {
  echo $product->getName(); //get name
  echo (float) $product->getPrice(); //get price as cast to float
  echo $product->getDescription(); //get description
  echo $product->getShortDescription(); //get short description
  echo $product->getTypeId(); //get product type
  echo $product->getStatus(); //get product status

  // getCategoryIds(); returns an array of category IDs associated with the product
  foreach ($product->getCategoryIds() as $category_id) {
      $category = Mage::getModel('catalog/category')->load($category_id);
      echo $category->getName();
      echo $category->getParentCategory()->getName(); // get parent of category
  }
  //gets the image url of the product
  echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).
      'catalog/product'.$product->getImage();
  echo $product->getSpecialPrice();
  echo $product->getProductUrl();  //gets the product url
  echo '<br />';
}

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
get product info magento 2 how to show all product using api magento 1.9 get all product with api magento 1.9 get all source of a product magento 2 get all source of product magento 2 magento 2 get all product attributes magento 2 get all data of a productr $product-&gt;getOptions() magento 1.9 magento 2 get all product categories magento 2 get all products magento get all products how to get all product attributes value in magento 2 get all avalible product magento 2 get current product in magento 2 magento get product get all category product magento 1 get product list magento 2 get product list magento 1.9. from a category get all product by object manager in Magento 2 magento 1 get all product info magento 1 get product description magento 1 product get category magento 2 get current product collection from category magento 2 get current product collection get productused magento 1 get product magento 2 magento 2 get product collection get total product magento 2 get product options magento 2 magento 2 get all product from categort get all product by categroy magento 1 get all product collection in magento 2 get all products magento 2 display all category from product magento 1.9 show all category in product page magento 1.9 get product details in magento 2 get all product magento 2 get all new product in magento 2 how to get all product data in magento 2 magento 2 get product magento 2 get all product details in product detail page get product details magento 2 get product details in magento2 magento 2 get current product magento 1.9 get product options id get current product magento 2 magento 1.9 get data with where magento 2 product categroy get products magento magento 1.9 get price product by sku magento 1.9 get product by sku magento 1.9 get all product
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source