For example, to fetch Product data from Magento shop in any external script.
If you have any further queries, please feel free to comment on it.
/**
* Include Mage.php of your Magento installation
*/
require_once("../magento/app/Mage.php");
Mage::app('default');
/**
* To get Product Data
* For example productId is '11'
*/
$productId = 11;
$product = Mage::getModel('catalog/product')->load($productId);
/**
*To Print name,,sku, price and quantity of the product
*/
echo "Name: ".$product->getName();
echo "Sku: ".$product->geSku();
echo "Price: ".$product->getPrice();
echo "Quantity: ".$product->getStockItem()->getQty();
/**
* To Get all products
*/
$allProducts = Mage::getModel('catalog/product')
->getCollection();
Thank you so much, you saved me a lot of work :)