Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Mage::getResourceSingleton('catalog/product')
- ->getAttributeRawValue($productId, 'attribute_code', Mage::app()->getStore());
- Mage::getResourceSingleton('catalog/product')
- ->getAttributeRawValue($productId, 'url_key', Mage::app()->getStore());
- $product_collection = Mage::getModel('catalog/product')->getCollection()
- ->addAttributeToFilter('entity_id', 16)
- ->addUrlRewrite();
- $product_collection_url = $product_collection->getFirstItem()->getProductUrl();
- $_item = Mage::getModel('catalog/product')->getCollection()
- ->addAttributeToSelect('product_url')
- ->addAttributeToFilter('entity_id', $productId)
- ->addUrlRewrite()
- ->load();
- foreach($_item as $product){
- echo $product->getProductUrl();
- }
- // returns string "http://www.your-domain.com/[category]/[product_url]"
- Mage::getResourceSingleton('catalog/product')
- ->getAttributeRawValue($productId, 'url_key', Mage::app()->getStore());
- // returns string "product-url-like-this"
- $productUrl = Mage::getResourceModel('core/url_rewrite')
- ->getRequestPathByIdPath('product/' . $productId, $storeId);
- // returns string "product-url.html"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement