23
Oct/0616
Oct/0616
Zen Cart New Product Type Using Ultimate SEO URL Package
This post is to help those who are using Zen Cart and are using new product types with Ultimate SEO URL package installed. There are a couple of things to change in order to make everything work together as it took me a couple of hours to figure out. I hope this will help others save these couple of hours of hair pulling.
Prerequisite:
Zen Cart installed
New product type added
Ultimate SEO URL package installed
Goal:
Have the URLs for the products using the new product type show URLs in this format.
http://www.domain.com/[product name]-p-[product id].html
Changes Required:
NOTE: [handler_name] is the new product type name added.
- File – seo.url.php
Original:
$seo_pages = array(
FILENAME_DEFAULT,
FILENAME_PRODUCT_INFO,
FILENAME_POPUP_IMAGE,
FILENAME_PRODUCT_REVIEWS,
FILENAME_PRODUCT_REVIEWS_INFO,
);Result:
$seo_pages = array(
FILENAME_DEFAULT,
FILENAME_PRODUCT_INFO,
FILENAME_POPUP_IMAGE,
FILENAME_PRODUCT_REVIEWS,
FILENAME_PRODUCT_REVIEWS_INFO,
FILENAME_[handler name]_INFO
); - File – seo.url.php
Original:
$this->reg_anchors = array(
‘products_id’ => ‘-p-’,
‘cPath’ => ‘-c-’,
‘manufacturers_id’ => ‘-m-’,
‘pID’ => ‘-pi-’,
‘products_id_review’ => ‘-pr-’,
‘products_id_review_info’ => ‘-pri-’,Result:
$this->reg_anchors = array(
‘products_id’ => ‘-p-’,
‘cPath’ => ‘-c-’,
‘manufacturers_id’ => ‘-m-’,
‘pID’ => ‘-pi-’,
‘products_id_review’ => ‘-pr-’,
‘products_id_review_info’ => ‘-pri-’,
‘[handler name]_id’ => ‘-pji-’,
- File – seo.url.php -> function parse_parameters
Find “case ‘products_id’:”
Within this case statement, add the following.case ($page == FILENAME_[handler name]_INFO):
$url = $this->make_url($page, $this->get_product_name($p2[1]), ‘[handler_name]_id’, $p2[1], ‘.html’, $separator);
break; - File – [webroot]/includes/filenames.php
Add the following definition.define(‘FILENAME_[handler name]_INFO’, ‘[handler name]_info’); - File – [webroot]/.htaccess
Add the following rewrite rule.RewriteRule ^(.*)-pji-(.*).html$ index\.php?main_page=[ handler_name]_info&products_id=$2&%{QUERY_STRING} [L]
Comments (16)
Trackbacks (0) ( subscribe to comments on this post )
Leave a comment
No trackbacks yet.
1:11 pm on December 28th, 2006
Very nice, this is just what I needed. Thanks for the post!
7:23 pm on January 15th, 2007
np. I’m glad it helped someone.
8:43 pm on October 2nd, 2007
is there a problem using PayPal with this mod?
12:17 am on October 4th, 2007
No, I am using PayPal with ZenCart using this mod. I don’t remember having to do anything special to make it work.
5:38 am on October 4th, 2007
Which version of Ultimate Seo URL did you run on?
11:00 am on October 4th, 2007
I am using Zencart v 1.3.5 and Ultimate Seo URL v 2.103.
12:01 pm on October 24th, 2007
I’m getting a error in the browser when I try to enable Ultimate SEO
Parse error: parse error
Any ideas? Should I have a value instead of ‘handler name’ ?
12:35 pm on October 24th, 2007
Yes, where ever you see [handler_name], you need to replace it with your new product type name.
11:29 am on April 3rd, 2008
Is it possible to structure URLS like directories?:
http://www.keepitpersonal.co.uk/personalised-chocolate/chocolate-bars-c-65_66.html
instead of:
http://www.keepitpersonal.co.uk/personalised-chocolate-chocolate-bars-c-65_66.html
11:59 am on June 16th, 2008
Sure. You just have to add a category called “personalized chocolate” then add “chocolate bars” as a product under that.
7:44 am on November 4th, 2008
I have tried to get it working with document type, but fail.
Should the handler name be document_general?
using zencart 1.3.8 with latest ultimate seo
8:10 am on November 4th, 2008
I’ve solved the problem now
Thanks for the trick, work perfectly!
10:44 am on November 24th, 2008
Thank you! It works on my site..
5:15 pm on February 2nd, 2009
To have directory structure urls, as well as the ability to support multi languages and product types, you can check http://simple-seo-url.com/ which is free as well.
5:01 am on September 3rd, 2009
thanks for this, very helpful, worked out our site now, cheers!
2:17 am on September 4th, 2009
thanks for this, been doing my head in, finally got it sorted, cheers