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-01-2007 06:31 AM

Re: XC SEO v1.1.0 Released
 
What is the goal? To remove that string, or to add it to the rewritten url? Or something else entirely?

But anyways, it's possible, mainly just depends on what you need it to do. The code is all open source, and there's only a couple of files that you would need to modify.

lovetree 11-01-2007 06:35 AM

Re: XC SEO v1.1.0 Released
 
Exactly a person I need help from!! Wow.

I pull additional products with "retailcatid=XX" string in addition to "cat=XX".

i.e. c-XXXX-r-XXXX.html something like that for cat=XXX&retailcat=XXXX

Thanks

intel352 11-01-2007 07:08 AM

Re: XC SEO v1.1.0 Released
 
k, you'll need to decide how in-depth you want your modification to go, i.e. - do you want to be able to pass retailcat on every category page? (page 2, page 3, etc, sorted ascending, descending, etc)

if so, you'll need to modify your .htaccess, where the category section starts:
# Rewrite SEO category URL's << (categories start at this line)


Then the rest of your changes would take place in the following files:
modules/XC_SEO/outputfilter.seo.php
modules/XC_SEO/seo.php

You're changes will have to effect pretty much anywhere you see "cat" mentioned, should be minor changes all over. Additionally, you shouldn't need to create any new functions, just inserting your retailcat information anywhere you find "cat" referenced.

If you're able to complete the mod successfully, you should document your changes to make it easy for someone else that needs to pass in a custom variable :-)

BTW, it also should be possible to skip all this, and just allow your retailcat variable to be appended to the end of the normal static category url.

lovetree 11-01-2007 08:22 AM

Re: XC SEO v1.1.0 Released
 
Thanks for a guide. Just did a mod/patch and it is working:

If I missed something, please send a comment.

GOAL:
modify XC_SEO to work with a custom variable called "retailcatid".
( i.e., "c-XXXX-r-XXXX.html" something like that for "cat=XXX&retailcat=XXXX")

BACKGROUND:
I pull additional products with this variable. i.e. "cat=XXX&retailcat=XXX"

MODS:

1. .htaccess : ADDED
Code:

RewriteRule ^([^/]*/)?[^/]+-c-([0-9]+)-r-([0-9]+)\.html$                                                                                                                        $1home.php?cat=$2&retailcat=$3                                                                                                        [QSA,L]
RewriteRule ^([^/]*/)?[^/]+-c-([0-9]+)-r-([0-9]+)-p-([0-9]+)\.html$                                                                                                $1home.php?cat=$2&retailcat=$3&page=$4                                                                                        [QSA,L]
RewriteRule ^([^/]*/)?[^/]+-(productcode|title|price|orderby)-up-c-([0-9]+)-r-([0-9]+)-p-([0-9]+)\.html$                        $1home.php?sort=$2&sort_direction=0&cat=$3&retailcat=$4&page=$5                                        [QSA,L]
RewriteRule ^([^/]*/)?[^/]+-(productcode|title|price|orderby)-down-c-([0-9]+)-r-([0-9]+)-p-([0-9]+)\.html$                        $1home.php?sort=$2&sort_direction=1&cat=$3&retailcat=$4&page=$5                                        [QSA,L]


2. modules/XC_SEO/outputfilter.seo.php

ADDED to class variable declaration
Code:

        var $_ret_prefix;
ADDED to function seo_filter()
Code:

$this->_ret_prefix  = $this->_name_delim.'r'.$this->_name_delim;

ADDED to function _category_filename
Code:

                if ($options['retailcat'])
                        $options['result_title'] .= $this->_ret_prefix.$options['retailcat'];


intel352 11-01-2007 08:43 AM

Re: XC SEO v1.1.0 Released
 
looks good enough to me, although I believe your htaccess rules may be lacking, but if you don't notice any issues, excellent :-)

thanks for posting your changes back, as well, i'm sure it'll be handy to other aspiring modders

dtfootwear1 11-06-2007 06:55 AM

Re: XC SEO v1.1.0 Released
 
I'm Running 4.1.8 gold on Apache 2.0.52 with PHP 4.39 and I can't get this to work. Mod is installed, re-write rules are in .htaccess but I don't know if they are correct...

Mod installed fine, no errors - When I move over the link it now points to a html page (instead of ...=cat1) which is great but the link does not work correctly as it say "page cannot be displayed"

I have put back the original auth.php file which turns off XC SEO and fixes the broken link on the live site... I don't have a dev site to test this on unfortunately!

Is there anything I should look at?

intel352 11-06-2007 07:22 AM

Re: XC SEO v1.1.0 Released
 
to disable XC SEO, you can leave all changes intact, just go into X-Cart Admin and disable the module there.

if the url is showing as an html url, but the page cannot be found, that suggests it's a problem with your .htaccess file

dtfootwear1 11-06-2007 07:45 AM

Re: XC SEO v1.1.0 Released
 
Hi intel352,

Thanks for quick response... Yes you are quite right... I didn't think about turning it off from the X-cart amin console.

...and as I thought the .htaccess file is not setup correctly!!

If I PM you with my details would you be able to look at my .htaccess file and tell me where you think I might be going wrong?

Regards

RM.

intel352 11-06-2007 04:15 PM

Re: XC SEO v1.1.0 Released
 
sure, you can PM me or email me (email is in the signature), I'll take a look at it for you (or you can send me the contents of your file and I'll correct it, and send back)

Cheers

Qdox 11-07-2007 05:54 AM

Re: XC SEO v1.1.0 Released
 
Would appreciate an answer from anyone about this. Having the same issue.
Quote:

Originally Posted by pumpkins
I found this is causing the problem:

RewriteEngine on
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]

but I added this line in my .htaccess to get Google Checkout to work . Does this mean I have to choose between Google checkout and XC SEO?



All times are GMT -8. The time now is 02:54 PM.

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