Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

I was Under The Impression You Couldn't Have Links To Category Pages


timmle

Recommended Posts

I just wanted to know if there is some kind of problem with using the following code to link text or images to the category or sub-category pages - as i'm sure i was advised that it wasn't possible to do it.

 

 

For instance;

 

This is the link location of my first category- (the path=2_21 defines which category to jump to)

 

http://localhost/fresh2/catalog/index.php?cPath=2_21&osCsid=4i4p7njtukke8au0ro0umh9og2

 

So using those links outputted by oscommerce is it possible just to create image buttons or standard text in the column_left.php file which looks like the following?;

 

<a href="http://localhost/fresh2/catalog/index.php?cPath=2&osCsid=4i4p7njtukke8au0ro0umh9og2"> Categories </a>

 

It seems to work ok with the links etc, but i was wondering if this causes later complication in the running of the site.

 

I just think that this method leaves it open to add your own custom menus which can be a little more customized than either adding a contribution or changing the css style.

 

 

Anybody Shed Any Light?

Link to comment
Share on other sites

dont include an sid in your url

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

If you don't mind, could you explain what you mean by an sid?

 

Do you mean completely remove the 'sid' from the link so it just reads;

 

http://localhost/fresh2/catalog/index.php?cPath=2_21&osC=4i4p7njtukke8au0ro0umh9og2

 

as oppose to;

 

http://localhost/fresh2/catalog/index.php?cPath=2_21&osCsid=4i4p7njtukke8au0ro0umh9og2

 

 

 

Thankyou.

Link to comment
Share on other sites

http://localhost/fresh2/catalog/index.php?cPath=2_21

 

as opposed to

 

http://localhost/fresh2/catalog/index.php?cPath=2_21&osCsid=4i4p7njtukke8au0ro0umh9og2

 

The sid carries all the information about the session for that person that is at your store so if you include it then everyone clicking on that link will have the same session which is not a good thing. The session can hold information such as their log in info so theoretically everyone using the same sid can access the same account.

Link to comment
Share on other sites

remove &osCsid=4i4p7njtukke8au0ro0umh9og2

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Thankyou very much, i hadn't got a clue that was the case.

 

So if i remove those on all my links, and people use the images to navigate and purchase products etc , will their information still be stored in session for that individual person and run just as it would normally?

Link to comment
Share on other sites

Yes remove the sid or it will get indexed and trapped in the search engines.

If you can use php within your descriptions that you include the links in, then you should code it as follows:

<?php echo'<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1', 'NONSSL') . '">' . CATEGORY_NAME . '</a>'; ?>

Then define the CATEGORY_NAME in your various used languages files.

If just using HTML then you could just do this:

<a target="_self" href="/index.php?cPath=1">Category Name</a>

Follow the community build:

BS3 to osCommerce Responsive from the Get Go!

Check out the new construction:

Admin Gone to Total BS!

Link to comment
Share on other sites

Yes remove the sid or it will get indexed and trapped in the search engines.

If you can use php within your descriptions that you include the links in, then you should code it as follows:

<?php echo'<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1', 'NONSSL') . '">' . CATEGORY_NAME . '</a>'; ?>

Then define the CATEGORY_NAME in your various used languages files.

If just using HTML then you could just do this:

<a target="_self" href="/index.php?cPath=1">Category Name</a>

 

No, you must use the first of those, otherwise you will lose the clients sid, unless you have force cookie use on.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

I am actually just learning php as i am not too confident with it, and i have never used php language before this project so it is a learning curve for me.

 

So by just inputting;

 

<a target="_self" href="/index.php?cPath=1">Category Name</a>

 

Everything will work as normal, obviously replaceing the cPath=1 with the path of either the category page or sub category page accordingly.

 

 

 

If it is this simple to link to the category pages, why do people bother with menu contributions to change the look of the menu when you can do this?

Is it purely because a contribution will constantly update from the database, where this is a time consuming process which you have to do manually?

Link to comment
Share on other sites

No, there are several issues, as I said you will lose the clients sid, unless you have force cookie use on.

 

Try it, log in, go to your custom page then follow your link, you wont be logged in anymore!!

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Damn. That's Rough. See what you mean.

 

So forcing cookies will be the only way to make that work, and can't the customer on the site choose not to use cookies therefore render my site pretty much useless?

Link to comment
Share on other sites

Damn. That's Rough. See what you mean.

 

So forcing cookies will be the only way to make that work, and can't the customer on the site choose not to use cookies therefore render my site pretty much useless?

 

People actually buying will be happy to accept cookies, so its not that big an issue (might be for aol users though). Only other way is to code in php, follow the rules & keep all pages in catalog.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Just out of curiosity, How do i force cookies on my site?

 

 

I don't have near enough skill to code in php at the moment so that's out of the question. All i am looking into doing is just replacing the drop down menu with either my own image menu or something of that sorts in the column_left.php. I don't imagine i will be adding many extra pages really.

Link to comment
Share on other sites

Just out of curiosity, How do i force cookies on my site?

 

 

I don't have near enough skill to code in php at the moment so that's out of the question. All i am looking into doing is just replacing the drop down menu with either my own image menu or something of that sorts in the column_left.php. I don't imagine i will be adding many extra pages really.

 

Setting is in admin config, under sessions

 

Read the Docs http://www.oscommerce.info/kb/osCommerce

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

No, you must use the first of those, otherwise you will lose the clients sid, unless you have force cookie use on.

 

Hello Sam, it should be possible to get the categorys name, since its cpath is known in

 

<?php echo'<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1', 'NONSSL') . '">' . CATEGORY_NAME . '</a>'; ?>

 

Then define the CATEGORY_NAME in your various used languages files.

 

something like

 

$categories_query = tep_db_query("select c.categories_id,cd.categories_name, c.parent_id from " . TABLE_CATEGORIES .

" c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id

and cd.language_id='" . (int) $languages_id ."'order by sort_order, cd.categories_name");

 

(A code snippet from my header)

 

Regards

Sara

Link to comment
Share on other sites

Hello Sam, it should be possible to get the categorys name, since its cpath is known in

 

<?php echo'<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=1', 'NONSSL') . '">' . CATEGORY_NAME . '</a>'; ?>

 

Then define the CATEGORY_NAME in your various used languages files.

 

something like

 

$categories_query = tep_db_query("select c.categories_id,cd.categories_name, c.parent_id from " . TABLE_CATEGORIES .

" c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id

and cd.language_id='" . (int) $languages_id ."'order by sort_order, cd.categories_name");

 

(A code snippet from my header)

 

Regards

Sara

 

You seem to have gone off topic!!! Were talking about custom page links & loss of sid!!

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

You seem to have gone off topic!!! Were talking about custom page links & loss of sid!!

 

Sam is correct in focusing on the Session ID. I would forget about the whole force cookie routine and stick with retaining the Session ID.

 

Some HTML examples:

 

Custom link to a specific Category (the following example links to category 21):

<a href="<?php echo tep_href_link('index.php', 'cPath=21&', 'NONSSL'); ?>">Category Name Here</a>

 

Custom Link to a product (the following example links to product ID=53):

 

<a href="<?php echo tep_href_link('product_info.php', 'products_id=53&', 'NONSSL'); ?>">Product Name Here</a>

 

Custom link to your conditions.php page:

<a href="<?php echo tep_href_link('conditions.php', 'NONSSL'); ?>"

 

Each of the above examples would retain the Session ID so that the customers shopping cart would not be emptied once the link was clicked upon.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

This is really good information, thankyou.So i would theorectically be able to create a really flexible image menu now linking to every category in my store.

 

Does anyone see any problem with doing this if i use the above code?

Link to comment
Share on other sites

You seem to have gone off topic!!! Were talking about custom page links & loss of sid!!

 

So, you are actually saying that even when the cpath is known, it is impossible to make a query to find the name of the category?

 

The code snippet is in use at Visit My Website

 

I found it in Monika Mathes cookbok for OScommerce

 

Warm Regards

Sara

Link to comment
Share on other sites

So, you are actually saying that even when the cpath is known, it is impossible to make a query to find the name of the category?

 

The code snippet is in use at Visit My Website

 

I found it in Monika Mathes cookbok for OScommerce

 

Warm Regards

Sara

 

 

Not at all, but that's not the topic!!

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

This is really good information, thankyou.So i would theorectically be able to create a really flexible image menu now linking to every category in my store.

 

Does anyone see any problem with doing this if i use the above code?

 

Tim,

 

The biggest issue would be that the menu is no longer dynamic, meaning, every time you add a new category, sub-category, etc. in the admin; you would have to manually manipulate the static image menu. However, if you only have a few categories and they do not change very often, then the above code would be ideal.

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

Cheers Bill for the information. Although my store will have a large amount of products they are, i believe, going to be stored under a small number of categories so i might give this a go.

 

This is exactly what i have been searching for to make a menu in column left which really fits in with the site design.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...