Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

This thread is for the cName and pName contribution.

 

Replaces the osC stock method of passing products_id and cPath. This contribution uses the actual category and product name in the URL.

 

Does not use mod_rewrite and all data is cached.

 

Supports multiple languages.

 

SCREEN SHOTS

Category name in URL

cname.gif

 

Product name in URL

pname.gif

 

Category and product name in URL

pname_cname.gif

 

DOWNLOAD

cName and pName contribution

Posted

Hello I have some problem:

 

Fatal error: Call to undefined function: implode_assoc() in /home/jeans/public_html/includes/functions/html_output.php on line 67

 

I use:

1. OS: Linux 2.4.21-15.0.3.EL

2. DB: MySQL 4.0.22-standard-log

3. WWW: Apache/1.3.33 (Unix) mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_ssl/2.8.22 OpenSSL/0.9.7a

4. PHP: 4.3.9 (Zend: 1.3.0)

5. osCommerce 2.2-MS2

 

Thanks for help.

Posted

Sorry...forgot a function :(

 

Add this just above tep_href_link() in includes/functions/html_output.php

function implode_assoc($array, $inner_glue='=', $outer_glue='&') {
      $output = array();
      foreach( $array as $key => $item )
              $output[] = $key . $inner_glue . $item;

      return implode($outer_glue, $output);
}

I'll get the contribution updated directly...

Posted
Ok I install everything one more time and I found secound problem:

 

pName and cName is missing from link.

 

Links is:

 

http://www.my-site.com/index.php?new-gift

First, delete the cache file to start fresh. Then visit the store and generate the new cache file. Verify that the cache file is being generated and stored.

 

Make sure you have uploaded the included files to your server.

 

If all else fails comment out the settings in *catalog*/includes/seo_cache.php for compression (2 settings). Delete the cache file and now it should be in plain text (not encoded). Make sure each entry is being formed properly.

 

Also, what is your URL?

Posted

Hi,

 

This looks great, but i think i am using a too old version of PHP at the moment, i get a error regarding a unknown function GLOB , i am using PHP v4.22 - would this be the cause? this error was only on the admin side, the catalog gave no erros but the urls appeared to not have changed

 

Any ideas?

 

Thanks

 

Matt

Posted (edited)

Thanks now is ok.

 

I also have problem with specific letter in ISO 8859-2, I try use unicode like &.#281; but this looks not good in link.

Before I solve this problem I add this letter to $convert_me and now everything work very good.

 

Best regards.

Edited by nisarek
Posted
Hi,

 

This looks great, but i think i am using a too old version of PHP at the moment, i get a error regarding a unknown function GLOB , i am using PHP v4.22 - would this be the cause?  this error was only on the admin side, the catalog gave no erros but the urls appeared to not have changed

 

Any ideas?

 

Thanks

 

Matt

In *admin directory*/includes/reset_seo_cache.php replace the code with this:

<?php
# Enter your cache directory below!!
$cache_dir = ''';
if ( function_exists('glob') ){
foreach (glob($cache_dir."*.cache") as $filename) {
  	 unlink($filename);
}
} else {
$dir = $cache_dir;
if (is_dir($dir)) {
   if ($dh = opendir($dir)) {
    while (($file = readdir($dh)) !== false) {
   unlink($file);
    }
    closedir($dh);
   }
}
}
?>

Tell me if that works for you...

 

Thanks now is ok.

 

I also have problem with specific letter in ISO 8859-2, I try use unicode like &.#281; but this looks not good in link.

Before I solve this problem I add this letter to $convert_me and now everything work very good.

 

Best regards.

Check this thread here: http://www.oscommerce.com/forums/index.php?sho...=0entry510788

Posted

Contribution has been updated to include support for PHP versions < 4.3

 

As a side note, if your host has not upgraded to the latest PHP version it's time to find another host who will keep the server software up-to-date.

 

Bobby

Posted
Contribution has been updated to include support for PHP versions < 4.3

 

As a side note, if your host has not upgraded to the latest PHP version it's time to find another host who will keep the server software up-to-date.

 

Bobby

 

 

Thanks, the catalog side works great - but on the admin side, im assuming when a new product is added or the name modified then the cache file should be deleted/emptied? this is the part that will not seem to work

 

Both the full paths are defined, and must be correct as the catalog side works fine, but on teh admin side when i click 'new product' i get:

 

Warning: unlink() failed (Is a directory) in /home/xxxx/xxxx/xxxx/xxxx/www/html/admin/includes/reset_seo_cache.php on line 14

 

this error appears twice, and then underneath:

 

Warning: unlink() failed (No such file or directory) in /home/xxxx/xxxx/xxxx/xxxx/www/html/admin/includes/reset_seo_cache.php on line 14

 

I have tried modifying the define for the cache location but although this removes the above error the cache file is not updated/emptied and the newly added product does not have a 'pname=' style link , i can just delete the cache file and then it rebuilds it and all is fine.

 

Thanks again for this, great idea!

Posted

hhhmmm...the path to the cache file is not correct. Make sure it is the ABSOLUTE filesystem path BEGINNING with a forward slash.

 

Bobby

Posted
hhhmmm...the path to the cache file is not correct.  Make sure it is the ABSOLUTE filesystem path BEGINNING with a forward slash.

 

Bobby

 

Thanks for the quick reply!

I have just double checked (even copy/pasted from the seo_cache.php catalog side file) to ensure the path is correct.

 

I only get the errors mentioned when i have the 'correct' path, if i change the path to, say, /this/is/not/the/path/ then i get no errors at all, the errors only appear when the pach is identical to that defined on the catalog side (which im sure is the correct path, as i used the same path on other contributions).

 

Thanks again for your help

Posted

Just tested with 2 products on your site, seemed to work fine.

KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Posted

Chemo,

 

Could you please direct me to the section of code I will need to modify in order to include more than two category levels? I'll explain my issue in greater detail than necessary for those following:

 

My site has sub categories and sub/sub categories with identical names. This causes oscommerce to effectively lose it's bearings after entering the third level of navigation. For example:

 

When I try to enter: rings/ladies-rings/colored-stone/topaz

it bounces me to: earrings/colored-stone/topaz

 

because both urls are: http://www.mysite.com/catalog/index.php?cN...one-alexandrite. Its point of reference is (in my case) too shallow.

 

I'm in the early learning stages of php-so those who are more savvy than myself can probably find the code to reference this. But- I'm probably not the only noob to appreciate the value of this mod.

 

-akmac

Quidquid latine dictum sit, profundum viditur.

Posted
Chemo,

 

Could you please direct me to the section of code I will need to modify in order to include more than two category levels? 

Sure

cName & pName v1.4 has been uploaded that adds support for unlimited nested categories and duplicate names (both categories and products).

 

I took a look for you and ended up recoding the entire script...so this is much different than the previous versions and is much more functional and optimized for speed. In addition, it was coded to be extremely easy on system resources while generating the cache file.

 

Enjoy!

 

Bobby

Posted

BTW, to upgrade do the following:

 

1. overwrite the includes/seo_cache.php file with the new version

2. modify the file and change file path

3. in the admin control panel edit a product or category and hit save (don't have to edit the values). This will delete the cache file for you...

4. Visit the catalog to generate a new cache file

 

Bobby

Posted

Interesting...I'd like to hear people opinions as well!

 

Bobby

Posted

Bobby, I assume that means you have never seen this behavior? Anyone know how to view the cache of other search engines?

Posted

Never seen that before and don't know what would cause it...so cannot verify OR deny that the cName mod has anything to do with it. However, I offer a cached copy of my dev server where the cNames are fully functional: Google cache

 

So, I know at least one site with cName is being indexed and cached properly...but I'm still interested to hear from the Google-ites.

 

Bobby

Posted

I think I fixed this by hardcoding the $language variable in the seo_cache.php file. I only support english so this isn't a problem for me...

Posted
I think I fixed this by hardcoding the $language variable in the seo_cache.php file. I only support english so this isn't a problem for me...

 

This fixed my problem.

 

Google Cache

The Future of Style

 

The google bot doesn't register a session so the $language variable wasn't being set properly because of some other contribs I have installed. All is well with FoS now :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...