This mod allows you to specify your own URLS for better SEO
Currently it only works on products and still requires a little work for search results, but this will be added as both me and Zyles develope it further…
[COLOR=red]BEFORE MAKING ANY CHANGES, BACKUP THE FOLLOWING FILES INCASE[/COLOR]
- admin/products_pages/products_update.tpl
- addons/seo/func.php
- include/customer/products.php
1. Edit database using somthing like phpMyAdmin
and find the table > cscart_product_descriptions.
Add a field named ‘url’ to the end, Set it as Varchar(255)
2. Edit template > admin/products_pages/products_update.tpl
Find this line :
```php
```
Add this below it:
```php
SEO URL Prefix:
```
[B]3. Next edit addons/seo/func.php[/B]
Replace this line
```php
$tpl_source = str_replace($match, '{$product.product|fn_generate_name:"p":$product.product_id}.html', $tpl_source);
```
With this :
```php
$tpl_source = str_replace($match, '{if $product.url != ""}
{$product.url|fn_generate_name:"p":$product.product_id}.html
{else}
{$product.product|fn_generate_name:"p":$product.product_id}.html
{/if}', $tpl_source);
```
[B]4. Edit include/customer/products.php[/B]
Add this code just before this at the very bottom of the file.
Above this code
[COLOR=red]} else {[/COLOR]
[COLOR=red]fn_set_exception('access_denied') ;[/COLOR]
[COLOR=red]}[/COLOR]
[COLOR=red]}[/COLOR]
[COLOR=red]?>[/COLOR]
```php
$url= db_get_field("SELECT url FROM $db_tables[product_descriptions] WHERE product_id='$product_id' LIMIT 1");
$smarty->assign('url', $url);
```
Now in the products pages of the admin you can enter your own SEO URL in the same way you can enter a page title or keywords. So typing in for instance : "this is my product"
Will give you a link like : this-is-my-product-p121.html
[B]So no more having to make your product title look untidy just for getting a few keywords into the url !![/B]
We are also going to be making these changes for the categories and other pages along with adding sub folders for the category the product is being viewed under so hopefully you will be able to have seo urls like : [URL="http://www.shop.com/sony/wide-screen-plasma-tv.html"]www.shop.com/sony/wide-screen-plasma-tv.html[/URL]
[B]To see this current version in action, look at the first featured products link here : [/B]
[URL="http://www.car-audio-accessories.co.uk/nissan-c127.html"]http://www.car-audio-accessories.co.uk/nissan-c127.html[/URL]
[COLOR=red][B]MOD DEVELOPMENT BY : SWS & ZYLES[/B][/COLOR]