Jump to content
spidometrs

[CONTRIBUTION] Ultimate SEO URLs v2.1 - by Chemo

Recommended Posts

Skittle,

You are wonderful, thank you!!!

I installed your changes and installed the other changes and it appears to be working!!! The only thing not working is that when a customer types in their cc info and hits continue instead of getting the confirmation page they getting the login screen and the add to cart buttons show an empty cart, but I believe I read a fix for this somwhere in this forum.... i will look for it now. Thank you so much for your help!

You're welcome. I'm just glad I could help.

 

-Skittles

Share this post


Link to post
Share on other sites
Thanks for picking that up Anita.

 

Its all good now,

 

Thank You :)

You're welcome.

 

-Skittles

Share this post


Link to post
Share on other sites

I hope someone can help me out here...

 

I installed this contribution and everything works just like it should except for when you try and leave a product review. I get the following error everytime I leave this contribution turned on:

 

0 -

 

insert into osc_reviews_description (reviews_id, languages_id, reviews_text) values ('0', '1', 'This is a fantastic gift for that special someone that has everything.')

 

[TEP STOP]

 

It seems that the review id is not getting set properly for some reason. The url looks like:

 

http://marybethsjewelrybox.com/product_reviews_write.php?action=process&products_id=291

 

so it should be picking up the products_id as 291; instead it keeps setting it to zero.

 

I even tried adding the following line to the .htaccess file:

 

RewriteRule ^(.*)-prw-([0-9]+).html$ product_reviews_write.php?products_id=$2&%{QUERY_STRING}

 

Any ideas?

Edited by dawgbytte

Share this post


Link to post
Share on other sites

I've tried multiple times to install Ulimate SEO URLs but keep having the same problem. The links from the home page will change to the seo urls but when clicked on don't go to the categories or products. It just says the page can't be found.

 

Does anyone know what I'm doing wrong?


My site: Medieval Swords

Share this post


Link to post
Share on other sites
I've tried multiple times to install Ulimate SEO URLs but keep having the same problem. The links from the home page will change to the seo urls but when clicked on don't go to the categories or products. It just says the page can't be found.

 

Does anyone know what I'm doing wrong?

bullseye09,

 

Have you made the changes to your .htaccess file as outlined in Step 5?

STEP #5 - Edit .htaccess file (in your catalog directory)

 

If you don't have an .htaccess file in your catalog directory create one.

 

If you've made the changes, check to make sure RewriteBase points to the correct directory. Chemo shows it as "RewriteBase /directory/", but "directory" needs to be replaced with the actual name of the directory osCommerce (osc) is installed in.

 

For example, if you installed osc into "catalog", it should look like: RewriteBase /catalog/

 

and if you installed osc into the site's main directory, it should look like: RewriteBase /

 

If the wrong directory is specified, the link will be redirected to a file that doesn't exist.

 

In any event, it sure looks like something is amiss in the .htaccess file.

 

-Skittles

Share this post


Link to post
Share on other sites
Thanks! That fixed the problem! I had actually replaced the directory already but stupidly had made a typo.

bullseye09,

 

Howevre cuold taht haev hapepned? :D

 

Unfortunate, but not stupid...

 

And, trust me, you are not alone. It happens to all of us one time or another.

 

I'm just glad to hear you got it worked out.

 

-Skittles

Share this post


Link to post
Share on other sites

Hello,

 

I have added this contribution a while back. Seems to run fine.

But now that I want to add it to other pages, I can't seem to figure out how to add the extra pages.

I've tried searching this forum and Google, but have not found any answers.

 

I've tried the .htaccess rewrite, but that doesn't seem to work by itself.

When I looked in the DB, I've noticed there were extra fields in the configuration table for SEO URLs, and a cache table.

 

Am not sure where to go from here. Any help or direction on getting the SEO URLs to work with other pages (example: links.php) in the store would be greatly appreciated. Thank you.

Share this post


Link to post
Share on other sites

After some digging around, it appears that if I want to add SEO URLs to other pages, I'll need to add some code to the seo.class.php page. Wish I understood this php stuff better.

Oh well, I guess I'll try some experiments tomorrow.

Share this post


Link to post
Share on other sites

Hi there

 

If a question: the procuts path is only displayed when selecting a cathegory from the column_left box...

 

But the product itself has only displayed the product name. How can I make, that also on the product level the categories are displayed in the url?

 

thanks!

 

Andreas

Share this post


Link to post
Share on other sites
Hi there

 

If a question: the procuts path is only displayed when selecting a cathegory from the column_left box...

 

But the product itself has only displayed the product name. How can I make, that also on the product level the categories are displayed in the url?

 

thanks!

 

Andreas

Andreas,

 

There is an option in the configuration to "Add category parent to begining of URLs". If you set this to true, the category the product is in will become part of the 'filename'. For example:

would become

instead of

 

Ultimate SEO URLs is not written to show the full path

 

I hope this answers your question.

-Skittles

Share this post


Link to post
Share on other sites
After some digging around, it appears that if I want to add SEO URLs to other pages, I'll need to add some code to the seo.class.php page. Wish I understood this php stuff better.

Oh well, I guess I'll try some experiments tomorrow.

lostndazed,

 

Ultimate SEO URLs only covers dynamic pages that are part of the default installation of osCommerce. You are correct. To add other dynamic pages that are created by add ons, you will need to write the new code yourself.

 

Chemo has included the support class(es) and functions for this contrib, which adds a lot of code to the file. the SEO_URL class actually starts on line 434 of the unmodified seo.class.php file. You probably don't need to do anything to the code before this line.

 

In the class constructor, line 548 begins the declaration for the $seo_pages array, where you will need to include the constant for each file you are adding. For example

		if ( defined('FILENAME_LINKS') ) $seo_pages[] = FILENAME_LINKS;
//this constant needs to be defined in filenames.php, or the page will not be added to the array.

 

line 585 begins the declaration for the $this->reg_anchors array, where you will need to include the base and what it changes to. For example:

								   'links_id' => '-l-',
//this change needs to be reflected in your .htaccess file, too.

 

In the function parse_parameters, you will need to add a 'case' for each type of page (links, etc) to the switch beginning on line 785. Each case has it's own switch for the possible variations. Very clever, really, the switch is looking for the state of true, and each case uses a statement which will resolve to either true or false.

 

This switch is where the filename is put together. A function is passed parameters that let it find the name used for the filename. I am assuming that your links files have their own categories, so you would need to write a function to retrieve the link category's name. The function would probably be quite similar to the get_category_name function, but I can only guess as I am unfamiliar with the contribution you are trying to integrate.

 

While I have made modifications to my copy of Ultimate SEO URLs, I have not tried to add support for any new page types. The info above is the best I can do to help you.

 

I hope this information will cut down on the time needed to make your modifications.

 

Best of luck.

-Skittles

Share this post


Link to post
Share on other sites

Thanks Skittles for your help on my last problem. I am able to now get into the catagories but when I try to add a product...... I am unable to add any text. Instead I get this warning:

 

TEXT_PRODUCTS_SEO_URL

Fatal error: Call to undefined function: tep_get_products_seo_url() in /home2/pearlcom/public_html/admin/categories.php on line 529

 

I can't see what the problem would be since categories.php is a file uploaded from the seo_url package instead of a file edit. Any ideas anyone?

 

Thanks,

 

TJ

Share this post


Link to post
Share on other sites
Thanks Skittles for your help on my last problem. I am able to now get into the catagories but when I try to add a product...... I am unable to add any text. Instead I get this warning:

 

TEXT_PRODUCTS_SEO_URL

Fatal error: Call to undefined function: tep_get_products_seo_url() in /home2/pearlcom/public_html/admin/categories.php on line 529

 

I can't see what the problem would be since categories.php is a file uploaded from the seo_url package instead of a file edit. Any ideas anyone?

 

Thanks,

 

TJ

Hi TJ.

 

The instructions for adding functions tep_get_products_seo_url and tep_get_category_seo_url are in the text file 'additional_install_instructions.txt' that came with contribution. It is Step 7 of the install. (Seems to be an easy step to miss... :) I've seen a variety of questions over the nearly 80 pages of this thread that are answered by going back and doing Step 7.)

 

STEP #7 - Additional Instructions

 

Follow the install instructions in the file, in this release, called additional_install_instructions.txt.

 

In any event, it sounds like you're almost there.

 

Have fun,

-Skittles

Share this post


Link to post
Share on other sites

Ok I now feel like an idiot! I thought I completed all the steps including the additional instalment. When I went back to check the files the changes had not been made. I now have all the steps done and when I log into my admin I now get this error....

 

Fatal error: Cannot redeclare tep_get_category_seo_url() (previously declared in /home2/pearlcom/public_html/admin/includes/functions/general.php:1311) in /home2/pearlcom/public_html/admin/includes/functions/general.php on line 1333

 

This contrib is giving me huge problems, but it'll be worth it when its finished.

 

TJ

Share this post


Link to post
Share on other sites
Ok I now feel like an idiot! I thought I completed all the steps including the additional instalment. When I went back to check the files the changes had not been made. I now have all the steps done and when I log into my admin I now get this error....

 

Fatal error: Cannot redeclare tep_get_category_seo_url() (previously declared in /home2/pearlcom/public_html/admin/includes/functions/general.php:1311) in /home2/pearlcom/public_html/admin/includes/functions/general.php on line 1333

 

This contrib is giving me huge problems, but it'll be worth it when its finished.

 

TJ

TJ,

 

First and foremost, there is no reason for you to feel badly about yourself. These contributions require one to go into a number of files and make changes. There are numerous steps, and many of the changes need to be done in both catalog and admin files which are named the same but located in different places, like filenames.php for example. It is really easy to skip a step along the way, and we have all done it! The reason I can help you is because of what I've learned from my mistakes!

 

One of those lessons is that some 'included' files cause problems of the sort you're seeing when there is white space following the closing php tag: ?> That's what this error message looks like to me.

 

I like to delete all lines and spaces after the last > in all my php files, 'cause I can never remember which files need to end immediately after the end tag. If you know which files you've been working on, open each of them and verify your cursor cannot be moved beyond the > with your arrow keys. Delete the extra spaces and lines, save the files and try again.

 

And for the record, this is a very common problem...

 

Talk to you soon,

-Skittles

Share this post


Link to post
Share on other sites
Okay. Maybe I should have thought that through a little harder before answering... :blush:

 

After re-reading Paradisebg's request, it occurs to me he is asking how to add specific characters via the Admin Configuration.

 

I've never tried this, but I suspect the examples "char=>conv,char2=>conv2" translate to "®=>conv,©=>conv,£=>conv". (I'm using the characters, not the html equivalents. If you don't see the characters, they are the circle-R for Registered, circle-C for Copyright and the currency symbol for English Pounds.)

 

Hope this helps.

-Skittles

 

I want to translate Cyrillic alphabet to Roman alphabet but Cyrillic alphabet have 32 letters and I can't make translation for all.

Ex.

д=>d,Д=>D,З=>Z,з=>z .....................

 

Can you help me?

Share this post


Link to post
Share on other sites
I want to translate Cyrillic alphabet to Roman alphabet but Cyrillic alphabet have 32 letters and I can't make translation for all.

Ex.

д=>d,Д=>D,З=>Z,з=>z .....................

 

Can you help me?

Paradisebg,

 

I can try. Just remember this is new to me, too.

 

Perhaps we can learn this together...

 

I know nothing about the Cyrillic alphabet. I'm guessing there are some characters that covert into Roman character pairs, like 'ch' for example. Is this correct?

 

I don't know if the convert function will allow you to convert a single character to more than one character, but we can try it, if the above guess is correct.

 

Have you been able to convert any of the characters so far?

 

-Skittles

Share this post


Link to post
Share on other sites
TJ,

 

First and foremost, there is no reason for you to feel badly about yourself. These contributions require one to go into a number of files and make changes. There are numerous steps, and many of the changes need to be done in both catalog and admin files which are named the same but located in different places, like filenames.php for example. It is really easy to skip a step along the way, and we have all done it! The reason I can help you is because of what I've learned from my mistakes!

 

One of those lessons is that some 'included' files cause problems of the sort you're seeing when there is white space following the closing php tag: ?> That's what this error message looks like to me.

 

I like to delete all lines and spaces after the last > in all my php files, 'cause I can never remember which files need to end immediately after the end tag. If you know which files you've been working on, open each of them and verify your cursor cannot be moved beyond the > with your arrow keys. Delete the extra spaces and lines, save the files and try again.

 

And for the record, this is a very common problem...

 

Talk to you soon,

-Skittles

 

I am up to 100% now. I must have screwed up a line or 2 in the general.php file. I just edited the stock one again and now everything is running fine. Thanks again Skittles for all your help.

Share this post


Link to post
Share on other sites
I am up to 100% now. I must have screwed up a line or 2 in the general.php file. I just edited the stock one again and now everything is running fine. Thanks again Skittles for all your help.

liebgott,

 

I'm always happy to help, when I can.

 

Take care.

-Skittles

Share this post


Link to post
Share on other sites
What exactly does 'automatic redirects' do?

 

Rob

 

Hi,

 

I am not exactly sure what it does do - I hope someone could tell us both?!

 

And I'm intested to know why the manufacturers drop down list works with 'Automatic redirects' switched off but not with it switched on? What are we missing out on by turning it off?

 

Thanks

 

Becki

Share this post


Link to post
Share on other sites
Paradisebg,

 

I can try. Just remember this is new to me, too.

 

Perhaps we can learn this together...

 

I know nothing about the Cyrillic alphabet. I'm guessing there are some characters that covert into Roman character pairs, like 'ch' for example. Is this correct?

 

I don't know if the convert function will allow you to convert a single character to more than one character, but we can try it, if the above guess is correct.

 

Have you been able to convert any of the characters so far?

 

-Skittles

 

I use this code

ь=>io,я=>ia,а=>a,о=>o,ж=>j,г=>g,т=>t,н=>n,в=>v,м=>m,ч=>ch,у=>u,е=>e,и=>i,ш=>sh,щ=>sht,

к=>k,с=>s,д=>d,з=>z,ц=>c,б=>b,л=>l,р=>r,п=>p,х=>h,ф=>f,ъ=>a,й=>io,ю=>iu,Ь=>IO,Я=>IA,

А=>A,О=>O,Ж=>J,Г=>G,Т=>T,Н=>N,В=>V,М=>M,Ч=>CH,У=>U,Е=>E,И=>I,Ш=>SH,Щ=>SHT,К=>K,

С=>S,Д=>D,З=>Z,Ц=>C,Б=>B,Л=>L,Р=>R,П=>P,Х=>H,Ф=>F,Ъ=>A,Й=>IO,Ю=>IU

Edited by Paradisebg

Share this post


Link to post
Share on other sites

I'm looking at installing this for my site.

 

The instructions read "he file categories.php should be uploaded to admin/categories.php. If you want to know the edits within this file - use a compare program like winMerge."

 

I'm sure with the contributions I installed i've modified admin/categories.php - I had a look using Kcompare to compare the two files and program stats source 1 destination line 1 Changed 24 lines. thats fair enough next it says source line 26 destination line 5 changed 1040 lines"

 

How am i suppose to be able to merge these two documents, when they are only 1100 line long anyway. Surely over 1040 is a completely new document.

 

Can anyone help me please

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×