Jump to content
Chemo

[Contribution] Ultimate SEO URLs - by Chemo

Recommended Posts

Secondly, I needed to make sure it works with my Article Manager contribution. Thanks to a fellow named Matti and a little tweaking, it is now working.Ari

 

Hi Ari,

 

How did you get Article Manager to work with SEO contribution? I've got the same problem and don't know what to do. Thanks in advance,

 

Kaitlyn

Share this post


Link to post
Share on other sites

I have the Ask A Question contribution installed and I think the search engines are following this on my items page. Is there any way to stop this?

 

thanks

Elizabeth

Share this post


Link to post
Share on other sites
I have the Ask A Question contribution installed and I think the search engines are following this on my items page. Is there any way to stop this?

 

thanks

Elizabeth

 

 

Are you using a robots.txt file - but I am not SE expert... but in theory that is what it is .


osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Share this post


Link to post
Share on other sites

Hi, I still have the problem where I can not view the manufactures. I have noticed that I can however view them when I browse in to a category and use the "Show All Manufactures" drop down filter. The urls this uses are completely different, like

 

http://www.mysite.com/index.php?filter_id=13&sort=2a&cName=category

 

The other two that use mName in the url still redirect me back to the index page.

 

Thanks Mike

Share this post


Link to post
Share on other sites

I'm hoping someone can help me with some code from the Category Tabs with Subs contribution. I'm having trouble with a piece of code that I think is related to the Ultimate SEO URLs contrib.

 

Here is the section of code that checks to see if the tab is for the current page's category and then gives it an "on" status:

 

// $tab_counter = category id $start = first tab $last_on = if the previous tab was selected
function show_category_tabs($tab_counter, $last_element, $start = 1, $last_on = false) 
{
global $foo, $categories_string, $id, $HTTP_GET_VARS;
   $onpage = false;

// Prepares new cPath if not home page	
if (($foo[$tab_counter]['parent'] == 0) and ($tab_counter!=0)) {
 $cPath_new = 'cPath=' . $tab_counter;
}
 
// We are on the home page
if (!isset($HTTP_GET_VARS['cPath']))  {
  if ($counter==0) $onpage = true;
}
  elseif (($HTTP_GET_VARS['cPath'] != 0) and ($counter!=0)){
 $base = substr($HTTP_GET_VARS['cPath'], 0, strpos($HTTP_GET_VARS['cPath'], '_'));
 if ($counter == $HTTP_GET_VARS['cPath']) {
	 $onpage = true;
 } elseif ($counter == $base) {
	 $onpage = true;
 } elseif (isset($cPath_array) && in_array($counter, $cPath_array)) {
	 $onpage = true;
 } elseif ($counter == $current_category_id) {
	 $onpage = true;
 }
  }

 

Here's my problem - the tab shows as "on" everywhere but the product info pages. You can see the work in progress here:

 

http://www.honeybeadjewelry.com/catalogtest

 

I've tried cutting and pasting pieces of code from the categories box but can't seem to get anything to work. Any guidance would be greatly appreciated.


Brian Neuman

Share this post


Link to post
Share on other sites

If a product has attributes, then in shopping_cart.php the links look like this:

"http://www.domain.com/catalog/product_info.php?products_id=718{3}8{1}145"

 

I see this in many Ultimate SEO carts. The links work for some, not for most.

 

In shopping_cart.php, the links are about line 78

<td class="productListing-data" align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">' . tep_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>

</td>' .
                      '    <td class="productListing-data" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '"><b>' . $products[$i]['name'] . '</b></a>';

This issue was posted a while ago, but I never saw it resolved (sorry if I missed it).

 

How should the links be corrected?

 

Thanks, EricK

 

PS: Thank you very much Chris for contributing your Site Map fix (it also works for YASU).

Share this post


Link to post
Share on other sites

You can see the "shopping_cart URL bug" in Chemo's demo cart at http://mesoimpact.com/

 

Add a product with attributes to the cart, then add one without attributes... and compare the URL's.

 

- Eric

Share this post


Link to post
Share on other sites
You can see the "shopping_cart URL bug" in Chemo's demo cart at http://mesoimpact.com/

 

Add a product with attributes to the cart, then add one without attributes... and compare the URL's.

 

- Eric

That's not a bug but rather it is a feature.

 

The default behavior of the code is to turn itself off at the first sign of trouble. If it cannot turn it into a clean SEO URL it outputs the default function return. In the case of attributes it turns itself off...the SEO equivalent is not defined. Hence, you get the stock URL instead.

 

I don't consider this a problem. The only ones that will see it are the customers and that is only for 1 click. Once they return to a page with all SEO links they won't even notice. The search engine spiders shouldn't get that far to begin with (you do have shopping_cart.php in your robots.txt file, right?) so no worries there.

 

Bobby

Share this post


Link to post
Share on other sites

Bobby,

 

Do you think that when we have ultimate seo installed and when it works properly we should install contributions such as sid killer or Spider Session Remover?


OSC2.2

Share this post


Link to post
Share on other sites

the sid killer is not really necessary if you have the robots.txt configured correctly and prevent spider sessions set to true.

 

However, use the "buy now" links to forms v1.2 that is also downloadable with the sid killer. (i could not get this to work with the reviews pages, so i removed the add to cart from this area)

 

The only thing someone needs to do would be to change the category page price and name sort links to forms as well. Also, it would be nice if the spiders could not follow the split search page results...

Share this post


Link to post
Share on other sites

Hi, I am still having a problem with viewing the manufactures on my site. The drop down list on the left does not work and I am always redirected back to the index page. I have the same problem for the "Manufacture Info" box on the right. However I can see the manufacturers when from a product category I use the drop down list entitled "Show".

 

I am using version 2.0b with the redirect beta3. Also I am using the cName method as opposed to the rewrite one. I have made no changes to my htaccess file for this contribution because I am using the cName option.

 

Initially my urls looked like

 

http://www.mysite.com/index.php?osCsid=9815906be9813564bfb4a8a60ca1b003&mName=mymanufacturer&osCsid=9815906be9813564bfb4a8a60ca1b003

 

Using the Manufacturer list on the left. Defiantly a problem there with the sid in the url twice. I have noticed this on another site too but their site did actually display the correct page.

 

http://www.mysite.com/index.php?mName=mymanufacturer&osCsid=ac4f3a17c63a2c876b855c0d2c7bdf9a

 

Using the Manufacturer Info box on the right. This looks like it should work.

 

With the advice of clarocque I fixed the cookie configuration and the URLs no longer contain the sid if you have cookies enabled. They now look like

 

http://www.mysite.com/index.php?mName=mymanufacturer

 

 

Unfortunately it did not fix the problem. Basically none of the urls with mName in them work. Ideally I would like to fix the problem if anybody can help, perhaps someone has had a similar problem. Alternatively If I cant fix the problem is it possible to disable the manufacture (mName) part of the code.

 

Any help with this would be very much appreciated.

 

Thanks Mike

Share this post


Link to post
Share on other sites

Ok I have fixed the problem. If your manufactures are not showing try this.

 

In "catalog/includes/application_top.php", search for the following code :

 

if ( isset($HTTP_GET_VARS['cName']) && defined(urldecode($HTTP_GET_VARS['cName'])) ) {
$cPath = str_replace( 'cPath=', '', constant(urldecode($HTTP_GET_VARS['cName'])) );
$HTTP_GET_VARS['cPath'] = $cPath;
}
if (isset($HTTP_GET_VARS['pName']) && defined(urldecode($HTTP_GET_VARS['pName'])) ) {
$pid = str_replace('products_id=', '', constant(urldecode($HTTP_GET_VARS['pName'])));
$HTTP_GET_VARS['products_id'] = (int)$pid;
}

 

DIRECTLY AFTER, add this :

 

if (isset($HTTP_GET_VARS['mName']) && defined(urldecode($HTTP_GET_VARS['mName'])) ) {
$pid = str_replace('manufacturers_id=', '', constant(urldecode($HTTP_GET_VARS['mName'])));
$HTTP_GET_VARS['manufacturers_id'] = (int)$pid;
}

 

 

 

 

mujina you gave me the right code pretty much but it didnt work because there is a type error in it, mnane should be mname. So I dont know if you have this error in the code you put in your site.

 

Mike

Share this post


Link to post
Share on other sites

Hi Bobby,

 

I have just installed this great contrib, but there is an error that I just can not resolve for the life of me.

 

It only happens when clicking on a category.

 

Parse error: parse error, unexpected T_ELSE in /home/mobiled/public_html/includes/modules/product_listing.php on line 156

 

This is what is on line 156 '} else {'

 

          case 'PRODUCT_LIST_BUY_NOW':
          $lc_align = 'center';
          $lc_text = '<a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'pName')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a> ';
          break;	

       $list_box_contents[$cur_row][] = array('align' => $lc_align,
                                              'params' => 'class="productListing-data"',
                                              'text'  => $lc_text);
     }
    $list_box_contents[][] = array(
            'params' => 'colspan="4" class="catpagerows"',
            'text'  => ' ' );    }

  new productListingBox($list_box_contents);
} else {  
  $list_box_contents = array();

  $list_box_contents[0] = array('params' => 'class="productListing-odd"');
  $list_box_contents[0][] = array('params' => 'class="productListing-data"',
                                 'text' => TEXT_NO_PRODUCTS);

  new productListingBox($list_box_contents);
}

 

Could it have something to do with the way I have changed my case 'PRODUCT_LIST_PRICE'

 

This is the code for that

 

case 'PRODUCT_LIST_PRICE':
           $lc_align = 'center';
           if (tep_not_null($listing['specials_new_products_price'])) {
             $lc_text = ' <br><br><font color="#ff0000"><b><s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> </b></font><p>TEXT_INC_DEL;</p><p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a></p> ';
           } else {
             $lc_text = ' <br><br><font color="#ff0000"><b>' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' </b></font><br>inc. free<br>delivery<p><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']) . '">' . tep_image_button('button_buy_now.gif', IMAGE_BUTTON_BUY_NOW) . '</a></p> ';
           }
           break;

 

Any ideas on how to solve this?

 

Thanks

 

Mark


Lifes a bitch, then you marry one, then you die!

Share this post


Link to post
Share on other sites
If you have any issues be sure to post:

 

Server info (Apache on *NIX machine, etc)

Exact problem

What you've tried to solve it

...and any debuggin you've done

 

When you get done with the install come back and give me some feedback on the install and functionality.  I'm particularly interested in making this as easy to install as possible.

 

Bobby

 

 

Chemo

 

Installed this today and 2 things spring to mind

 

1) On viewing the new cache table there is a message in phpMyAdmin

 

PRIMARY and INDEX keys should not both be set for column `cache_id`

 

Have I installed incorrectly - or is this as expected and does it cause any problems with the indexing ?

 

2) The install instructions from a standing start are very good and clear - The ony one I had a little trouble with was .htaccess - I have installed in my test site initially and the catalog directory is in /home/****/public_html/shoptest/catalog - does this mean the correct entry for .htaccess in the rewritebase is

RewriteBase /shoptest/catalog/ or is it still /catalog/ because my .htaccess is located in shoptest ?

 

Charles


A kite flies highest AGAINST the wind !

 

"Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, a lover in one hand, martini in the other, body thoroughly used up, totally worn out and screaming ~ WOO HOO!! What a ride!"

Share this post


Link to post
Share on other sites
Ok I have fixed the problem. If your manufactures are not showing try this.

mujina you gave me the right code pretty much but it didnt work because there is a type error in it, mnane should be mname. So I dont know if you have this error in the code you put in your site.

 

Mike

 

Sorry for the mistake!! Happy to hear it works now! ;)


OSC2.2

Share this post


Link to post
Share on other sites

How can I get rid of those characters in the url??

 

http://127.0.0.1/catalog/index.php?cname=%E9crans

 

I would like each ? to be replaced by e.

 

I've already modified catalog/includes/seo_cache.php file as follows :

$strip_array = array("'",chr(33),chr(34),chr(35),chr(36),chr(37),chr(38),chr(39),chr(40),chr(41),chr(42),chr(43),chr(44),chr(45),chr(46),chr(47),chr(58),chr(59),chr(60),chr(61),chr(62),chr(63),chr(91),chr(92),chr(93),chr(94),chr(95),chr(96),chr(123),chr(124),chr(125),chr(126) );  
$convert_me = str_replace($strip_array, '', $convert_me);
$convert_me = str_replace(array(' ', '  ', '__', '--', '?', '\'', '-'), '-', $convert_me);
$convert_me = str_replace(array('?', '?', '?', '?'), 'e', $convert_me);

 

Have I missed something?


OSC2.2

Share this post


Link to post
Share on other sites
How can I get rid of those characters in the url??

 

http://127.0.0.1/catalog/index.php?cname=%E9crans

 

I would like each ? to be replaced by e.

 

I've already modified catalog/includes/seo_cache.php file as follows :

$strip_array = array("'",chr(33),chr(34),chr(35),chr(36),chr(37),chr(38),chr(39),chr(40),chr(41),chr(42),chr(43),chr(44),chr(45),chr(46),chr(47),chr(58),chr(59),chr(60),chr(61),chr(62),chr(63),chr(91),chr(92),chr(93),chr(94),chr(95),chr(96),chr(123),chr(124),chr(125),chr(126) );  
$convert_me = str_replace($strip_array, '', $convert_me);
$convert_me = str_replace(array(' ', '  ', '__', '--', '?', '\'', '-'), '-', $convert_me);
$convert_me = str_replace(array('?', '?', '?', '?'), 'e', $convert_me);

 

Have I missed something?

 

Nope that should work - but make sure you delete your cache file... otherwise it will not take affect until you do :)

 

Chris


osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Share this post


Link to post
Share on other sites

Hi CHris!!

 

Silly me!!! Allright it works!

 

Thanks!

Edited by mujina

OSC2.2

Share this post


Link to post
Share on other sites

Bobby,

 

I use the contrib with great success.

 

Yesterday I finally installed the Show Sub-categories contrib and USEO doesn't seem to work with this. http://www.oscommerce.com/community/contri...l/search,expand

 

Are you (or anyone else) familiar with this contrib and perhaps with a work-around?

 

The problem is that when loaded for the first time and when on the catalogue index, it's all fine. But as soon as you go into the shop deeper, the links of the main categories (not the subs surprisingly) go back to the non-USEO format like /index.php?cPath=21_24_21 .

 

Any ideas on this anyone?

 

I reverted back to the OsC standard categories box but can show you a live example if necessary.

Edited by JoeMcManus

Johan a.k.a. T0PS3O elsewhere.

 

Contributed Barclay's ePDQ Payment Module though not originally mine. Made it work though...

Share this post


Link to post
Share on other sites
Bobby,

 

I use the contrib with great success.

 

Yesterday I finally installed the Show Sub-categories contrib and USEO doesn't seem to work with this. http://www.oscommerce.com/community/contri...l/search,expand

 

Are you (or anyone else) familiar with this contrib and perhaps with a work-around?

 

The problem is that when loaded for the first time and when on the catalogue index, it's all fine. But as soon as you go into the shop deeper, the links of the main categories (not the subs surprisingly) go back to the non-USEO format like /index.php?cPath=21_24_21 .

 

Any ideas on this anyone?

 

I reverted back to the OsC standard categories box but can show you a live example if necessary.

 

Not that this is going to help youi much, but...

 

I just dropped in the contribution to try it and it worked fine so I am not sure if it how your store may have been altered or something no configured right or what - but I can see the contribution itself works fine for using with SEO URL's

 

Chris


osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Share this post


Link to post
Share on other sites

Hello,

 

I have two questions.

 

First I added

 

$link = str_replace('?', 'ue', $link);
 $link = str_replace('?', 'oe', $link);
 $link = str_replace('?', 'ae', $link);
 $link = str_replace('?', 'ss', $link);
 $seo_link = str_replace('?', 'ue', $seo_link);
 $seo_link = str_replace('?', 'oe', $seo_link);
 $seo_link = str_replace('?', 'ae', $seo_link);
 $seo_link = str_replace('?', 'ss', $seo_link);
 $seo_rewrite_link = str_replace('?', 'ue', $seo_rewrite_link);
 $seo_rewrite_link = str_replace('?', 'oe', $seo_rewrite_link);
 $seo_rewrite_link = str_replace('?', 'ae', $seo_rewrite_link);
 $seo_rewrite_link = str_replace('?', 'ss', $seo_rewrite_link);

 

to my html_output.html to transform typical German characters.

Now I'm not sure: E.g. if I type "old cars" in a search engine ... would it also find

 

http://www.domain.de/catalog/oldcars.html

 

? :rolleyes:

If it wouldn't I would have to allow the hyphers '-' ... can I do that - so that I'd have

 

http://www.domain.de/catalog/old-cars.html

 

? :rolleyes:

 

Further I have added some own fields to the DB. They expand my products description ... e.g. my products_name is 'Chrysler' - and one of my new fields contains the color. How can I add this to the URL? E.g. I want to have

 

http://www.domain.de/catalog/chrysler-red-p-1.html

 

then.

 

I would be very happy about any1's help ... :)

Share this post


Link to post
Share on other sites

Hi,

 

I've installed the 2.0 SEO URL's on www.halloweenplayground.com. It's a *nix running Apache. Using ms2.2 of oscommerce. My only problem appears to be with regards to the shopping cart. I add an item to the shopping cart, then login and click checkout, but the shopping cart is then empty. It seems to be losing the information. Not sure where to begin as far as what information to post to obtain some assistance, so please let me know what is useful.

 

my cookie domain is .halloweenplayground.com

my https cookie domain is .halloweenplayground.fluidhosting.com

 

force cookies is false in admin

sef is off

 

Any help is greatly appreciated.

 

Thanks

Share this post


Link to post
Share on other sites
Hi,

 

I've installed the 2.0 SEO URL's on www.halloweenplayground.com.  It's a *nix running Apache.  Using ms2.2 of oscommerce.  My only problem appears to be with regards to the shopping cart.  I add an item to the shopping cart, then login and click checkout, but the shopping cart is then empty.  It seems to be losing the information.  Not sure where to begin as far as what information to post to obtain some assistance, so please let me know what is useful.

 

my cookie domain is .halloweenplayground.com

my https cookie domain is .halloweenplayground.fluidhosting.com

 

force cookies is false in admin

sef is off

 

Any help is greatly appreciated.

 

Thanks

 

Well if I was abetting man I would say you just answered your own question. once you loging you would have different cookies... so there would be nothing in the cart cookie :'(

 

Login first and try... I dont believe this a SEO URL issues

 

C-


osC Contributions I have published.

 

Note: Some I only provided minor changes, updates or additions!

Share this post


Link to post
Share on other sites

Unfortunately, through further testing, it occurs before logging in. I can click the buynow button and when it gets to the cart, the cart is empty. I haven't even logged in at that point. Any idea what is causing this? Thanks so much!

 

Well if I was abetting man I would say you just answered your own question.  once you loging you would have different cookies... so there would be nothing in the cart cookie :'(

 

Login first and try...  I dont believe this a SEO URL issues

 

C-

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

×