| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Clean urls 5.2.3 | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Clean urls 5.2.3
I'm wanting to change my product clean urls. I want to use "/" instead of "html". It would be nice instead of having the locked html box at the end of the clean url line if you could just change it right there. Does anyone know how to change the extension that the cart uses for products away from the default html?
__________________
Ver 5.2.6 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Clean urls 5.2.3
Could you please let me know the reason why you want your product URLs be example.com/test-product/ ? Such URLs do look like category page and it might confuse your users.
Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#3
|
|||||||
|
|||||||
Re: Clean urls 5.2.3
We are bringing existing pages over from another cart and we want all of the page names to stay the same. The existing pages are already cached and well ranked with the search engines. This was easily accomplished with xcart 4 and even xcart 5.1 with some slight modifications.
__________________
Ver 5.2.6 |
|||||||
#4
|
|||||||
|
|||||||
Re: Clean urls 5.2.3
I'm trying to decorate the \XLite\Model\Repo\CleanURL class. From looking in the var/run it doesn't look my code is being included. I am adding this into my custom skin mod. My namespace is XLite\Model\Pmall\PmallSkin\Repo; and my class is class CleanURL extends \XLite\Model\Repo\CleanURL implements \XLite\Base\IDecorator
Not sure what I'm doing wrong. Any help would be greatly appreciated.
__________________
Ver 5.2.6 |
|||||||
#5
|
|||||||||
|
|||||||||
Re: Clean urls 5.2.3
@Phil,
\XLite\Model\Repo\CleanURL is the right class to decorate. Basically, you need to change the value of the CLEAN_URL_DEFAULT_EXTENSION constant and change it to '' (empty line). You would also need to change the postProcessURLProduct() method there, so it would reflect right product URL structure. Please, let me know if it helps. Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#6
|
|||||||
|
|||||||
Re: Clean urls 5.2.3
Quote:
__________________
Ver 5.2.6 |
|||||||
#7
|
|||||||||
|
|||||||||
Re: Clean urls 5.2.3
Oh, yes, right.
Your namespace should be \XLite\Module\Pmall\PmallSkin\Model\Repo and the file should be located in the <X-Cart>/classes/XLite/Module/Pmall/PmallSkin/Model/Repo folder.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#8
|
|||||||
|
|||||||
Re: Clean urls 5.2.3
Tony thanks for your help. With your suggestions I have got it to work partially, but with problems. The product shows the url with out the .html, but when you go to it you get a 404. If you want the page to show up you have to add the .html in the address bar. Honestly I think the clean urls worked better before the upgrade. I was able to get the clean urls to display the way I wanted with some minor tweaking to the /XLite/Core/Converter and the htaccess.
I would like for all the urls to appear directly from the root. For example rather than example.com/category/subcategory/product I want to see example.com/product or example.com/subcategory. Can this all be accomplished from \XLite\Model\Repo\CleanURL or do I also need to make changes to /XLite/Core/Converter.php ? Do you have any further suggestions or advice to help me out?
__________________
Ver 5.2.6 |
|||||||
#9
|
|||||||||
|
|||||||||
Re: Clean urls 5.2.3
Quote:
Right. In case X-Cart does not recognize the clean URL as product URL, you should dig into the getTargetByCleanURL() method of \XLite object. Most likely you will need to decorate the parseCleanUrl() method of \XLite\Core\Converter class in order to overcome the problem. Quote:
This change is planned for the core as per discussion here: http://forum.x-cart.com/showthread.php?p=385163#post385163 So, if you can wait, we will ship it in 5.2.5 or 5.2.6.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#10
|
|||||||
|
|||||||
Re: Clean urls 5.2.3
Quote:
I can't seem to figure out how to decorate the parseCleanUrl method so that xcart will recognize the product urls without the html. Do you know how this needs modified to make this work?
__________________
Ver 5.2.6 |
|||||||
|
|||
X-Cart forums © 2001-2020
|