Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seach Engine Friendly URL Support


BlueYon

Recommended Posts

  • Replies 968
  • Created
  • Last Reply

Top Posters In This Topic

nice mod if it worked!, i looked through every page in this thread no one seems to have a solution for the tpp problem, but thats not the point the mod should work for an out of the box installation or whats the point..

 

 

i have posted the ttp solution about 3 times.

 

Its because your server is not the same domain name as the daomain you are using.

 

You only need to delete one line of code.

Link to comment
Share on other sites

The page of my shopping cart always appears empty when I add a product. That this cuntribuition has been done with base in BTS, but that does not work without BTS? Supposing that if, it is necessary make more alterations in other different files that index.php?

Link to comment
Share on other sites

In "/admin/includes/functions/general.php" 
Before (around line 956):

 } 
Add this code (around line 956):

   @unlink(DIR_FS_CACHE . 'categories_array.cache'); 
   @unlink(DIR_FS_CACHE . 'manufacturers_array.cache'); 
   @unlink(DIR_FS_CACHE . 'products_array.cache'); 
Note: Should be the reset cache function!

I don't get this part of the instructions.

My general.php has 1258 lines and has been modified before.

So "} (around line 956)" is not very helpful.

In which function is that? Can you please post some more code around it?

 

Thanks!

 

Yeah, I don't understand this at all either. :blink: Please include some more information as to which code this is supposed to be near.

Link to comment
Share on other sites

Thats how I have mine set up. To be honest it Search Engine Friendly v1.5 and BTS v1.4 run better together.

 

I try to give instructions tomorrow as going to bed.

 

I can't find the followup to this. Was this ever posted? I would like to run BTS and SEF together as well.

Link to comment
Share on other sites

Yeah, I don't understand this at all either.  :blink:  Please include some more information as to which code this is supposed to be near.

 

it must be in the function tep_reset_cache before the final } of that function

 

 

Sory, I have not been looking at this for a while. At the monmet I'm setting up a ecommerce site from sractch and not alot of time to complete this.

 

Can you send me what you got? Maybe i can finish it :)

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

Sorry for not replying. I have thought of another solution to what we are trying to do here. No need to rely on on using caching to decode the url. This is a much better method. I won't go into detail, but I'm setting it up now for a new site I'm working on. It's going to make this mod much simpler aswell.

Link to comment
Share on other sites

it must be in the function tep_reset_cache before the final } of that function

Can you send me what you got? Maybe i can finish it :)

I have tried that but it all ends up in a lot off problems. Wrong searches in the productdatabase is one thing and counting. This is not your problem maybe I should learn more about PHP programming.... I'm trying, believe me.

 

Here is the code that I've found:

 

function tep_reset_cache_block($cache_block) {

global $cache_blocks;

 

for ($i=0, $n=sizeof($cache_blocks); $i<$n; $i++) {

if ($cache_blocks[$i]['code'] == $cache_block) {

if ($cache_blocks[$i]['multiple']) {

if ($dir = @opendir(DIR_FS_CACHE)) {

while ($cache_file = readdir($dir)) {

$cached_file = $cache_blocks[$i]['file'];

$languages = tep_get_languages();

for ($j=0, $k=sizeof($languages); $j<$k; $j++) {

$cached_file_unlink = ereg_replace('-language', '-' . $languages[$j]['directory'], $cached_file);

if (ereg('^' . $cached_file_unlink, $cache_file)) {

@unlink(DIR_FS_CACHE . $cache_file);

}

}

}

closedir($dir);

}

} else {

$cached_file = $cache_blocks[$i]['file'];

$languages = tep_get_languages();

for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

$cached_file = ereg_replace('-language', '-' . $languages[$i]['directory'], $cached_file);

@unlink(DIR_FS_CACHE . $cached_file);

}

}

break;

}

}

}

 

Can you tell me where to put your changes.

 

// Storeman:- :blush:

Link to comment
Share on other sites

I have tried that but it all ends up in a lot off problems. Wrong searches in the productdatabase is one thing and counting. This is not your problem maybe I should learn more about PHP programming.... I'm trying, believe me.

 

Here is the code that I've found:

 

function tep_reset_cache_block($cache_block) {

    global $cache_blocks;

 

    for ($i=0, $n=sizeof($cache_blocks); $i<$n; $i++) {

      if ($cache_blocks[$i]['code'] == $cache_block) {

        if ($cache_blocks[$i]['multiple']) {

          if ($dir = @opendir(DIR_FS_CACHE)) {

            while ($cache_file = readdir($dir)) {

              $cached_file = $cache_blocks[$i]['file'];

              $languages = tep_get_languages();

              for ($j=0, $k=sizeof($languages); $j<$k; $j++) {

                $cached_file_unlink = ereg_replace('-language', '-' . $languages[$j]['directory'], $cached_file);

                if (ereg('^' . $cached_file_unlink, $cache_file)) {

                  @unlink(DIR_FS_CACHE . $cache_file);

                }

              }

            }

            closedir($dir);

          }

        } else {

          $cached_file = $cache_blocks[$i]['file'];

          $languages = tep_get_languages();

          for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

            $cached_file = ereg_replace('-language', '-' . $languages[$i]['directory'], $cached_file);

            @unlink(DIR_FS_CACHE . $cached_file);

          }

        }

        break;

      }

    }

  }

 

Can you tell me where to put your changes.

 

// Storeman:-    :blush:

 

It should look like this:

function tep_reset_cache_block($cache_block) {
   global $cache_blocks;

   for ($i=0, $n=sizeof($cache_blocks); $i<$n; $i++) {
     if ($cache_blocks[$i]['code'] == $cache_block) {
       if ($cache_blocks[$i]['multiple']) {
         if ($dir = @opendir(DIR_FS_CACHE)) {
           while ($cache_file = readdir($dir)) {
             $cached_file = $cache_blocks[$i]['file'];
             $languages = tep_get_languages();
             for ($j=0, $k=sizeof($languages); $j<$k; $j++) {
               $cached_file_unlink = ereg_replace('-language', '-' . $languages[$j]['directory'], $cached_file);
               if (ereg('^' . $cached_file_unlink, $cache_file)) {
                 @unlink(DIR_FS_CACHE . $cache_file);
               }
             }
           }
           closedir($dir);
         }
       } else {
         $cached_file = $cache_blocks[$i]['file'];
         $languages = tep_get_languages();
         for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
           $cached_file = ereg_replace('-language', '-' . $languages[$i]['directory'], $cached_file);
           @unlink(DIR_FS_CACHE . $cached_file);
         }
       }
       break;
     }
   }

@unlink(DIR_FS_CACHE . 'categories_array.cache'); 
   @unlink(DIR_FS_CACHE . 'manufacturers_array.cache'); 
   @unlink(DIR_FS_CACHE . 'products_array.cache'); 
 }

Link to comment
Share on other sites

i'm using qtpro with sequenced dropdown menus for products. what that means is product attributes are displayed according to availability, and a customer selects the attributes one at a time.

 

i applied the SEF changes, and this qtpro functionality is seemingly broken when this part of SEF is applied to catalog/includes/functions/html_output.php

 

if(!strpos($link, 'action')){
     $url_rewrite = new url_rewrite;
     $link = $url_rewrite->transform_uri($link);
   }

 

 

any ideas?

 

ps the setting for sequenced dropdowns is set in: Configuration - Product Information - Product Info Attribute Display Plugin - sequenced_dropdowns

Link to comment
Share on other sites

Hi,

 

Good contribution !

 

My testshop www.watersport.mine.nu is in directory /var/www/demoshop and everything works alright.

 

My real site www.tapijtonline.com is in directory /var/www/tapijtonline/shop/catalog en when i turn the rewrite rule

RewriteRule ^(.*) index.php on in apache voor that directory i get a popup window on every loaded page saying there is a syntax error on line 1.

 

Any Sugestions ?

 

Ps. Only in IE with the debugger on.

Edited by joop
Link to comment
Share on other sites

Hmmm, well I took a stab at it, made all the changes... looked like everything was ok, but I got a 404 error when clicking on a product.

 

I noticed the new .htaccess didn't upload when I tried to FTP it. Could that have caused it ?

Link to comment
Share on other sites

After installed this module, I found my customers can't login. After they enter username and password, it still will show "Welcome Guest..."

I have tried to remark the step no.4 in the html_output.php then the customers can login. How to solve this problem?

 

4. In "/catalog/includes/functions/html_output.php"

 

After code (around line 58):

 

if (isset($_sid)) {

$link .= $separator . $_sid;

}

 

Add this code (around line 64):

 

if(!strpos($link, 'action')){

$url_rewrite = new url_rewrite;

$link = $url_rewrite->transform_uri($link);

}

Link to comment
Share on other sites

I'm having problems also, the actual installation seemed to work fine but I there now seem to be several problems.

 

Customers can't login, they're just returned to the welcome guest screen.

 

The default currency wont seem to stick with ? anymore, just constantly to dollars.

 

When clicking on an item to add to the cart it just says 'Your cart is empty!'.

 

Url to the site is http://gnome.i-rox.com

 

Any help greatly appreciated.

 

regards,

 

 

 

Tim.

Link to comment
Share on other sites

I had a problem with nested categories which had the same name and also products under different categories with the same name.

 

f.i.

1) Natuurtapijt->Matros->Kokos->Boucle

2) Kleden->Matros->Kokos->Boucle

 

2) Always went from the top category to the second category of 1) and also the product info of 2 came from 1.

 

I have solved this problem by creating an extra field in the $categories_array named ['parent_id'] and in the same test where rewrite_url.php tests also test if the parent_id of the current_id is the same as the previous_id or zero.

 

For the product level i created a field in the products_array ['category_id'] in which i put the category_id from table_products_to_categories.

 

On product level i test if the products_name is the same in the table and if the category of that product is the same as the last rewritten category.

 

It works for me now.

 

I don't know if there are more people with this problem then i will try to post an update or else i will just use it for myself and will not border to build it in the cache functions also.

Edited by joop
Link to comment
Share on other sites

Cheers.

I've a problem with this contrib. I've installed everything like it is described in the manual. The URL's were changed successfully. But the categories don't work now. If I click on one of my categories in the categories box, the start page simply reloads instead of loading the selected category. Does anybody have a solution for this problem? My URL is http://u0009495852.user.hosting-agency.de/test/

Thanks a lot in advance

Link to comment
Share on other sites

Hello, I have searched these forums on this subject and have not found the answer I was looking for so here is the question.

 

We have recently moved to PHPSuexec and know receive this error on the page when using Use search-engine safe urls.

 

Error!

 

Unable to determine the page link!

 

Webpage Error

 

Any help would be appreciated.

Link to comment
Share on other sites

Hello, I have searched these forums on this subject and have not found the answer I was looking for so here is the question.

 

We have recently moved to PHPSuexec and know receive this error on the page when using Use search-engine safe urls. 

 

Error!

 

Unable to determine the page link!

 

Webpage Error

 

Any help would be appreciated.

 

 

Never mind found the fix in these forums.

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

I installed this on a site about two months ago.

 

i have now started a new domain name, and wish to put the same details opn another installation of oscommerce but keeping all the mods I have done and the database of products.

 

From the index page everything looks fine. I have edited the config files to point to the new domain and database and have copied the old database to the new on. All of the product links look search engine friendly but when I click on the I just get taken to an error, page not found page.

 

Can't see why it won't work.

 

The original shop is at http://spcrafts.co.uk

 

New: http://home-garden-ornaments.com

 

Any ideas?

Link to comment
Share on other sites

This is a great contribution - but I would highly suggest that newbies not mess with this one. It has some flaws such as "ttp" showing up in the URLS (is mentioned quite a bit in the forums, but no actual fix can be found). Also, if you have a subcategory that has the same name as another subcategory, you will get problems also. Also, had categories like "Software" show up! Software? I don't even sell software - where did that come from???

 

I hope work continues on this contribution, because it will be awesome once completed - but I think I will have to pass on it at this time.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...