| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
4.2 Clean URLs | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() I am using 4.2 X-Cart Gold and just enabled Clean URLs mod. It is working fine. How can I change the schipt to get the whole path to a product, sub-category, etc:
Here is an example. I want this: www.website.com/category1-name/subcategory2-name/product-name.htm You can input the the entire URL in the Clean URL text box, but what happen when changing the name of category1? Yeah, a lot of modifications! Could it be done? For example to input in Clean URL text box some smarty variables, and X-Cart to evaluate them an fill with the set up values.
__________________
X-Cart Next: Business 5.2 (learning and testing) X-Cart Classic: Gold and Gold Plus 4.7 Lots of Modules and Customizations OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions) You can catch my ideas here: http://ideas.x-cart.com |
|||||||||
#2
|
|||||||||
|
|||||||||
![]() Find this part of the code in the "e { size: 8.5in 11in; margin: 0.79in } P { margin-bottom: 0.08in } -->skin1\admin\main\category_modify.tpl" file. I add or changed the lines that are bolded.
<tr> <td height="10" class="FormButton" nowrap="nowrap">{$lng.lbl_category}:</td> <td width="10" height="10"><font class="Star">*</font></td> <td height="10"> {capture name=the_cats} {assign var="the_cat" value=""} {assign var="the_count" value=0} {section name=position loop=$category_location} {strip} {if $the_count == 1} {assign var="cat" value=$category_location[position].0} {$the_cat|cat:$cat} {else} {assign var='the_count' value=1} {/if} {/strip} {/section} {/capture} {assign var="the_cats" value=$smarty.capture.the_cats|substr:1} <input type="text" name="category_name" id="category_name" maxlength="255" size="65" value="{if $category_error ne ""}{$smarty.post.category_name|escape:"html"}{else if $mode ne "add"}{$current_category.category|escape:"html "}{/if}" {if $config.SEO.clean_urls_enabled eq "Y"} onchange="javascript: if (this.form.clean_url.value == '') copy_clean_url(this, this.form.clean_url,'{$smarty.capture.the_cats|strip:"/"|substr:1}'+this.value)"{/if}/> {if $category_error ne ""} {if $category_error eq "2"} <font color="red"><< {$lng.lbl_category_already_exists}</font> {else} <font color="red"><< {$lng.lbl_category_wrong_value}</font> {/if} {/if} </td> </tr> also in the file "skin1\check_clean_url.js" i changed the commented line to the other line. //to_field.value = from_field.value.replace(/[\&]/g, '-and-').replace(/[^a-zA-Z0-9._-]/g, '-').replace(/[-]+/g, '-').replace(/-$/, ''); to_field.value = from_value.replace(/[\&]/g, '-and-').replace(/[^a-zA-Z0-9._/-]/g, '-').replace(/[-]+/g, '-').replace(/-$/, '');
__________________
x-cart 4.2.0 | centos 5.2 | php 5.2.6 | mysqld 5.0.45-log |
|||||||||
|
|
|||
X-Cart forums © 2001-2020
|