If you need to transform some string to url-friendly string in Magento you just need to call method “formatUrlKey” from Mage_Catalog_Model_Product_Url class
<?php $urlKey = Mage::getModel('catalog/product_url')->formatUrlKey($string); ?>
You can use this new variable $urlKey as url_key field for product or for some other attributes (for example: slug, sku, code etc)
Related posts:
Creating a Custom API for Magento
The Core API allows you to manage a set of common resources used in Magento. However, you may choose...
Check if you are in Admin area
Simple piece of code for checking are you on admin area or on frontend
<?php
if (Mage::a...
How To Install A Magento Theme
How To Install A Magento Theme
Installing a Magento theme is not as easy as you would have loved ...
How to Setup A different Languages
Setting Up Magento In Multiple Languages
By default, Magento sites are built with English languag...