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:
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...
Magento Products Overview
How To Add And Manage Products
This tutorial provides a brief overview of how to add and manage p...
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...
How to remove SID from URL?
Sometimes you can see SID part appears in your Magento URLs.
This part is needed for keep customers...