Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] cName and pName in URL


Guest

Recommended Posts

  • 2 weeks later...

HI chemo!

 

I've installed your contribution and it works great except that I have a bug with Events calendar .

 

With this contribution you can place in each event a link to a product or a category. BUt the link appears like this :

 

http://127.0.0.1/catalog/product_info.php?products_id=4

 

instead of :

 

http://127.0.0.1/catalog/product_info.php?pName=unreal-tournament

 

Could you bring me some help?

 

Thanks in advance!

OSC2.2

Link to comment
Share on other sites

Apparently, that contribution does not use tep_href_link to construct the URLs. Ask the contribution coder to correct his files and use the standard osC API.

 

Bobby

Link to comment
Share on other sites

Hello,

 

I tried to install the contribution on localhost (running with easyPHP). The version of Oscommerce is 2.2 MS2.

 

The URL in the catalog are showed as follow:

 

http://localhost/shopfr/catalog/index.php?...outils-sans-fil&osCsid=c4aad574a877fd53baff071876720a20

 

The direct link to the page: http://localhost/shopfr/catalog/index.php?...outils-sans-fil

 

opens the same window. I don?t understand why the osCsid comes at the end of the URL when I navigate normally in the shop.

 

The really problem I have is that apache crasch when I try to edit a new product/categorie. The crash appens before the cache file is deleted.

 

Could the problem comes from the Apache settings?

 

Thank you in advance if you have a tip for me.

 

Regards

 

xcmro

Link to comment
Share on other sites

Normally if the osCsid is persistent (never goes away) that is a sure sign that the cookie domain settings are not correct.

 

As the cookie domain try using .localhost (notice the period in front) which will define the cookie SCOPE.

 

The usual way the osCsid works is that the first click on the site will have the osCsid then every other page after will pull it from the cookie. However, if the customer has cookies disabled OR the cookie domain is not configured correctly it will not be able to use cookies...hence, it will keep appending the osCsid to the URL.

 

Bobby

Link to comment
Share on other sites

Hello Bobby,

 

thank you for your reply!

After setting the cookie domain and also setting "force cookies" in Admin, the osCsid dissappeared from the URL!

 

Regarding the problem with the apache crash:

-this problem occurs when there is no more file to delete in the cache. (for exemple when I create 2 new products)

-when a file is present in the cache before I edit a new product, the function works normally (the cache file is deleted).

 

I try again to find where the problem come from.

 

I let you know.

Link to comment
Share on other sites

...

After setting the cookie domain and also setting "force cookies" in Admin, the osCsid dissappeared from the URL!

As a general rule it is not good to force cookie use. It may prevent the osCsid from appearing on the first page load but will turn some customers away when they get the "must have cookies enabled" screen.

 

Regarding the problem with the apache crash:

-this problem occurs when there is no more file to delete in the cache. (for exemple when I create 2 new products)

-when a file is present in the cache before I edit a new product, the function works normally (the cache file is deleted).

It's not an Apache crash...it's a PHP error message. There is a big difference!

 

What version of PHP are you running?

 

Bobby

Link to comment
Share on other sites

Hello Bobby,

 

thank you for your help!

I?m running PHP 4.3.3

That may be the cause of the trouble!

I read in the information note of PHP 4.3.7 following:

Fixed bug #28355 (glob() does not return error on Linux when it does not have permission to open the directory). (Ilia)

Fixed bug #28289 (incorrect resolving of relative paths by glob() in windows). (Ilia)

 

I will try to install a new PHP and hope that will work!

 

I also tried to change your code so I used only the second part of the file reset_seo_cache. I didn?t have more success with that!

 

As a beginner, I was not able to recognize a PHP error message when I get following window :

 

apache.gif

 

Sorry for my unknowledge!

Link to comment
Share on other sites

Hello Bobby,

 

I installed PHP5.0.3 yesterday and the Admin works now!

 

Regarding my cookie problem, I set back the "force cookie" on "off" and tried many different setting of my configure.php file. The osCsid still appears persistent in the URL.

 

I tried then to understand how the function "tep_href_link" works.

For the moment I cannot see how this function can return the link without the session Id:

 

// Add the session ID when moving from different HTTP and HTTPS servers, or when SID is defined
   if ( ($add_session_id == true) && ($session_started == true) && (SESSION_FORCE_COOKIE_USE == 'False') ) {
	 if (tep_not_null($SID)) {
       $_sid = $SID;
     } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
       if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
         $_sid = tep_session_name() . '=' . tep_session_id();
       }
     }
   }

In my case the variable $_sid is set to $SID, and then put at the end of the link.

When $SID is defined, is that not a sign that the Cookie works?

 

Marc

Link to comment
Share on other sites

$SID is defined in application_top.php and if cookies are enabled will equal ''. Thus, the code above says that $SID is not null then $_sid=$SID. Then, it checks to see if the customer is moving from NONSSL => SSL in which case it needs to check whether the domains match. If not then always append the oscSid.

 

It's rather simple...but let's not stray too far from the topic of this thread. If you want more information on how tep_href_link() constructs the URL please ask on the general channel.

 

Bobby

Link to comment
Share on other sites

  • 2 months later...
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

 

I am starting the installation process for this contribution; however, I noticed after downloading the contribution that catalog/includes is on the same level as the admin directory, whereas my file structure has catalog and admin on the same level. This has caused me a problem with the header tags controller contribution because the fill_tags fails because it is expecting the file structure to be catalog/includes and admin on same level.

 

Will I have a problem with implementing this contribution because my file structure is different?

 

I didn't want to have to change the location of my admin directories because it seems overwhelming and I thought that I might break something else.

 

Is there another alternative?

 

Thanks.

Link to comment
Share on other sites

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

 

 

 

I have changed the seo_cache.php as follows:

 

$cache_dir = '../../cachedir/';

 

since my file structure is:

 

mydomain

  catalog

      includes

          seo_cache.php

  admin

      includes

          reset_seo_cache.php

 

My problem is that the cache file is not created. I think it is something wrong with the definition for $cache_dir because it does not seem to get inside either of the conditions if file exists or if file does not exist.

 

What have I done wrong?

Link to comment
Share on other sites

you need to use the path:

 

ie:

 

/home/myaccount/www/osc/store/cachedire/

 

or c://cachedir

 

etc.

 

Thanks, that fixed it. The cache file is now being created.

 

 

 

I was looking at the file in cachedir and it doesn't seem to be changing. What does

<?php eval(gzinflate(base64_decode('...
mean? This is what is in my cachedir file but as I said this doesn't seem to be changing. It seems to be evaluating the same thing -- several characters, but no recognizable words.)

 

I have page cache installed also and I do get updates in the cache dir defined for that contribution. The content of those files are what I would expect.

 

Anyway, I'm still not sure pname,cname cache is working as expected. Of course, I'm very new at this, so I probably just don't understand how it works.

 

Could it have something to do with me trying to change the code for both page cache and pname,cname as follows:

 

/////

//Added for page cache

if (isset($_sid)) {

      $link .= $separator . $_sid;

  $seo_link .= $separator . $_sid;

 

if ($seo === true) return $seo_link;

else return $link;

 

}

elseif (!tep_session_is_registered('customer_id') && ENABLE_PAGE_CACHE == 'true' && class_exists('page_cache'))

      $link .= $separator . '<osCsid>';

 

}

 

Does this look correct?

 

I definitely do not notice an improvement in speed - if anything it seems to be slower. I know this should not be so, so perhaps it is my imagination, but it sure seems to be the case.

 

Any words of wisdom you can share with me?

Link to comment
Share on other sites

  • 5 weeks later...

Hello, I ve found this thread and I have a problem, with this contri, when I am watching a product and then I click on different language I get a 'no product found' error. I have installed 1.5 version, created cache directory and made the changes to different files. What can be this error?

 

I've this problem: sometimes there're products not show, as this http://www.100asa.it/product_info.php?pNam...facturers_id=34

but the product exist, view on Datalogic-->Gryphon BT100

Thank you

100asa what contri do you use after cname to get your product url like this http://whatever/urlname.html

 

thanks to all

Link to comment
Share on other sites

  • 1 year later...

Hello Chemo,

 

First I want want to thank you for this great contribution cName&pName without mod_rewrite. After installing the cName&pName 1.5 it worked without problem...

I changed the code and the international characters are converted. (ä --> ae, ü-->ue, etc...)

http://www.hamamshop.de/catalog/product_in...ife/cName/seife

http://www.hamamshop.de/catalog/product_in...olivenoel-seife

 

Yesterday I put some new categories and products in my shop... But link is not converted as above...

http://www.hamamshop.de/catalog/product_in.../products_id/47

 

What did I do wrong??? Is it a problem with caching? Or should I install cName pName again?

 

Thanks for you help!

 

Halas

Link to comment
Share on other sites

I am having an issue with a new category I have entered. It is not converting the cPath to cName in the URL. I have had this issue before & I thought it was resolved by turning off the SEO in the Admin... then turning it back on. However that didn't work. Does anyone know what I can do to fix this? Your assistance is appreciated.

 

Thank you,

Kristine

 

I am having this issue again. The last time it seemed to fix itself, but this time not at all. Is there something I should do to help it start reconizing? Please advise.

 

Thanks,

Kristine

Kristine

Link to comment
Share on other sites

I am having this issue again. The last time it seemed to fix itself, but this time not at all. Is there something I should do to help it start reconizing? Please advise.

 

Thanks,

Kristine

 

clearing the cache comes to mind.

Treasurer MFC

Link to comment
Share on other sites

I actually deleted the cache file, for it to create another. That;s how the issue became apparent...

 

The problem actually turned out that the permssions were somehow reset on the folder & nothing new could write to it.

 

All better now!!

 

Thanks,

Kristine

Kristine

Link to comment
Share on other sites

  • 1 year later...

I installed version 1.5 and it looks like it works fine. Thanks for contribution!

Anyway, I have a question: I found some contributions added later. Some claim it makes if faster (but contribution doesn't have anything except of couple images), some looks like they are not related to that contribution at all, but some how they are on same contribution page. Kinda confusing.

So, what the latest version of that contribution?

 

Thanks for any help.

Computers777dotcom

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