View Single Post
  #23  
Old 03-12-2005, 06:32 PM
 
jdiehl jdiehl is offline
 

eXpert
  
Join Date: Dec 2003
Location: Kansas City, MO
Posts: 270
 

Default 4.0.12 got it!

I'm new to X-Cart and just installed 4.0.12

I wanted this feature on my store especially for product pages and for category pages, possibly more in the future i.e. articles

I spent the last couple of days working out this mod for 4.0.12 and I have it working successfully except that I am using "MultiViews" in the httpd.conf file under directory>options. But using a symbolic link like Jon suggested works fine also.

The good news is that the mod isn't as extensive for 4.0.12 because the Paths are encoded, but just not for the links to the products which you have to change anyway.

With MultiViews turned on if I goto www.mystore.com/product/37/43/keywords.html then because the directory "product" doesn't exist it will automatically load product.php instead. Then I just explode the "PATH_INFO" in the product.php (or in the home.php for categories, we don't want the spiders to think the categories are dynamic and stop crawling) which results in the /37/43/keywords.html and I can use code to tell assign varibles for productid 37 in category 43.

I had to adjust the code though and I can paste it if you guys want, but here's what I found:

1. by default when exploding it assigns the "37" as a string not as an integer so I forced it into an integer (I don't know if this really matters)

2. In X-Cart 4.0.12 it checks to see if the variables have been assigned from the URL in the conventional GET Method, so if you assign these variables to $productid and $cat the X-Cart will forward you to an error message. So you have to adjust for this also

This might be as clear as mud due to my bad communication skills, but I understand it and got it to work so if anyone needs more help with this let me know and I'll post code and more. I am not quite finished with editing all the links but it is working for me.
Reply With Quote