| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Passing Category Clean URL | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Hello, I am having trouble getting the clean url of product category then pass it to a variable template.
here's my sample code in bread_crumbs.tpl: Code:
I am getting Code:
instead of Code:
clean url are working if you use that in href tags
__________________
christian |
|||||||
#2
|
|||||||||
|
|||||||||
![]() I see several ways to get the clean URL, not sure which to advise you to use. For instance, on a category page we have:
{$php_url} - returns the whole string "http://yourdomain.com/this-category-url/" {$canonical_url} - returns just "this-category-url/" {$current_category.clean_url} - returns "this-category-url/" as well On the product page {$canonical_url} returns "this-product.html" and {$php_url} gives "http://yourdomain.com/this-product.html" Hope that helps.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#3
|
|||||||
|
|||||||
![]() Those solution might work if I am on the category page, But since I am on the product page it would return the product clean url. What I want is get the clean URL on the bread_crumbs.tpl on which the product categories are located.
__________________
christian |
|||||||
#4
|
|||||||||
|
|||||||||
![]() Okay. Now I understand. That is going to be difficult, I'm afraid.
You are going to have to query the DB, and assign the product's category's clean URL to an array. I think I can put you on the right track. On the product page, it looks like the $location array is being built near line 292, with this snippet of code: Code:
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
#5
|
|||||||
|
|||||||
![]() I was able to get the clean url of categories by using func_clean_url_get function on my product page and then add an entry to my location array.
__________________
christian |
|||||||
|
#6
|
|||||||||
|
|||||||||
![]() Chistian, thanks for providing your final solution. It would be even better if you shared the completed code.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
|||
X-Cart forums © 2001-2020
|