X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   XC SEO v1.1.0 Released (https://forum.x-cart.com/showthread.php?t=25297)

intel352 11-18-2006 11:24 PM

Re: XC SEO v1.1.0 Released
Sounds like you haven't implemented the .htaccess file that was provided in the download. The .htaccess file rules are what make those fake urls actually work.

Miniature-Giant 11-19-2006 05:09 AM

Re: XC SEO v1.1.0 Released
Thanks for the direction. In fact, that was the part of the instructions that I was least sure of (except for the optional multi-language edit -- couldn't find the line to modify).

The instructions state:
* If needed, you may have to manually copy/paste the content of the .htaccess file into your existing .htaccess file

I'm not sure what "if needed" or "may have to" mean -- sorry for my ignorance. I already had a ".htaccess" file in my store, but it only had one line:
DirectoryIndex index.html index.php

I first tried replacing this one-line file with yours, and this morning, I tried appending your file's contents to this one-liner. I then turned the module "XC SEO" on in my admin interface. Both ways resulted in the same error messages.

I read on the forum that one shouldn't have their store below the "root directory". I currently have mine in a folder called "store". Would this be causing this problem? Should I move everything up one folder?

Any help would be greatly appreciated!!


Miniature-Giant 11-19-2006 08:16 AM

Re: XC SEO v1.1.0 Released
OK, I feel stupid -- guess I should read more!
I started reading the content of the .htaccess files to see if I could figure them out (and fix what was wrong).
I found that there are instructions in your .htaccess (to remove some comment marks, #).
Did that.
It now works -- thanks!!
I'm going to try my luck and see if I can get my sku numbers to appear in my product page htmls.
Thanks again,

Miniature-Giant 11-19-2006 10:53 AM

Re: XC SEO v1.1.0 Released
I was wanting to include the sku in my product html urls (in my line, sku's are often searched for by customers).
I modified the xcart code to include the sku in the links from the thumbnails on the catalog pages, e.g.,

I then modified the .htaccess file to use the sku (or so I thought):

# Rewrite SEO product URL's
RewriteRule ^([^/]*/)?[^/]+-print-c-([0-9]+)-p-([0-9]+)-pr-([0-9]+)-sku-([0-9]+)\.html$ $1product.php?printable=Y&productid=$4&cat=$2&page =$3&sku=$5 [QSA,L]
RewriteRule ^([^/]*/)?[^/]+-print-c-([0-9]+)-p-([0-9]+)-pr-([0-9]+)\.html$ $1product.php?printable=Y&productid=$4&cat=$2&page =$3 [QSA,L]
RewriteRule ^([^/]*/)?[^/]+-c-([0-9]+)-p-([0-9]+)-pr-([0-9]+)-sku-([0-9]+)\.html$ $1product.php?productid=$4&cat=$2&page=$3&sku=$5 [QSA,L]
RewriteRule ^([^/]*/)?[^/]+-c-([0-9]+)-p-([0-9]+)-pr-([0-9]+)\.html$ $1product.php?productid=$4&cat=$2&page=$3 [QSA,L]
RewriteRule ^([^/]*/)?[^/]+-print-pr-([0-9]+)-sku-([0-9]+)\.html$ $1product.php?printable=Y&productid=$2&sku=$3 [QSA,L]
RewriteRule ^([^/]*/)?[^/]+-print-pr-([0-9]+)\.html$ $1product.php?printable=Y&productid=$2 [QSA,L]
RewriteRule ^([^/]*/)?[^/]+-pr-([0-9]+)-sku-([0-9]+)\.html$ $1product.php?productid=$2&sku=$3 [QSA,L]
RewriteRule ^([^/]*/)?[^/]+-pr-([0-9]+)\.html$ $1product.php?productid=$2 [QSA,L]

I then turned the XC SEO module off then on and tested.
The html url is the same as it was before, e.g.,

Any idea what I am doing wrong (or what I am neglicting to do)?

Thanks in advance!

Miniature-Giant 11-19-2006 12:35 PM

Re: XC SEO v1.1.0 Released
Found the problem -- needed to edit the outputfiler.seo.php

intel352 11-20-2006 05:20 AM

Re: XC SEO v1.1.0 Released
What did you have to edit in the outputfilter? (just curious)

Miniature-Giant 11-20-2006 08:13 AM

Re: XC SEO v1.1.0 Released
I made two edits -- for two different feature additions:
1) to include the "sku" in the url, I edited the function _product_filename by adding the line:
if ($options['sku'] && !defined("IS_ROBOT"))
$options['result_title'] .= $this->_sku_prefix.$options['sku'];
after the similar line for the $options['printable']

2) I have JavaScript on my home page that randomly cycles through products in my catalog, showing them off. I wanted the customer to be able to click on these images and be taken to the corresponding product. But, I did not have an easy way in JavaScript to translate the SKU (which is what I used to name the images) to productid values. So, I added the following line as the first code line in the same function:
if ( ($options['productid']=="1") && $options['sku']){
$options['productid'] = func_query_first_cell("SELECT productid
FROM $sql_tbl[products]
WHERE productcode = '".$options['sku']."'");

In my system, there is no product with a productid of "1", so, if one is requested, this code uses the sku to lookup the correct productid in the db. This way I could have all my auto-generated images have anchor tags to product.php?productid=1&sku=<sku number>

Works like a charm.
(I'm in the final stages of testing, but you are welcome to see it at www.miniature-giant.com )

Hope the above makes sense -- if not, let me know and I'll elaborate,

Miniature-Giant 11-20-2006 08:27 AM

Re: XC SEO v1.1.0 Released
Opps, sorry, I also had to add the following line to the function seo_filter():

$this->_sku_prefix = $this->_name_delim.'sku'.$this->_name_delim;

to define the url text. Now my url look like, e.g.,
http://www.miniature-giant.com/sophie-the-succubus-Reaper-sku-1406-pr-10.html or

Sorry for missing that edit in my previous post,

teddychan 11-20-2006 10:20 AM

Re: XC SEO v1.1.0 Released
is it a bugs?

I just installed the koaconsulting.com mulit currency mode.

it pass the variable : currency_code=XXX
to the URL.

I can show the correct currency in home.php
or https page, when the seo is auto off.

while in all other http page, which seo is on.

i can't show the correct currency.

any idea?

Miniature-Giant 11-20-2006 10:47 AM

Re: XC SEO v1.1.0 Released
"is it a bugs?"

No, none that I am aware of. I was adding a custom feature to my system to also have the sku listed in the html url.

All times are GMT -8. The time now is 10:03 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.