Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEED SOME HELP


Recommended Posts

Posted

I am a programmer, but I have never used MYSQL or PHP.

 

I am thinking of adding a contribution, since a client of mine is asking for it and I thought it would be good for other people to use as well, which would add the category name to each product in an order. This is good for some stores which sill similar iutems under multiple categories (therefore only having to insert the product once with the proper usage of a contribution), but the items are slightly different depending on the category.

 

Anyways, I wanted to know where to start... I added to orders products a field called "products_cat", and wanted to knwo where the action of placing an order actually takes place so that I can implement this in the code.

 

Any help would be soooooooooooooo appreciated, so that I dont have to dig for hours, to find something that Im sure would be very simple.

 

Thanks so much! :thumbsup:

Posted

There's no reason to add that to the database. Use the products_to_categories table for retrieving the name. The checkout_process.php file is probably the one you want to edit.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted

Thanks for the Help Jack, but the problem here is that the same product has been copied into multiple categories. Products_to_categories would appear to me to return one of the categories the product was in, not necessarily the right one. Am I wrong?

 

There's no reason to add that to the database.  Use the products_to_categories table for retrieving the name.  The checkout_process.php file is probably the one you want to edit.

 

Jack

Posted

Actually, I just checked, and I noticed that I am correct. In the products to categories table, there are many entries for the same product (with dif categories)...

 

Perhaps any ideas based on my original thoughts?

 

Thanks..

 

Thanks for the Help Jack, but the problem here is that the same product has been copied into multiple categories.  Products_to_categories would appear to me to return one of the categories the product was in, not necessarily the right one.  Am I wrong?

Posted

I thought you were looking for the category name. The product id is tied to a particualr category id and that table is how you get to its name. At least that is how I do it. I don't work with products that are in more than one category but I'm guessing that that table will have two entries for such a case, pointing to the two different categories. Hopefully someone will correct me if I am wrong. A quick test wouldn't be that hard to do to verify it though if you want to be sure. You might also want to try the tep_get_product_path($products_id) function.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Posted
I am a programmer, but I have never used MYSQL or PHP.

 

I am thinking of adding a contribution, since a client of mine is asking for it and I thought it would be good for other people to use as well, which would add the category name to each product in an order.  This is good for some stores which sill similar iutems under multiple categories (therefore only having to insert the product once with the proper usage of a contribution), but the items are slightly different depending on the category.

 

Anyways, I wanted to know where to start...  I added to orders products a field called "products_cat", and wanted to knwo where the action of placing an order actually takes place so that I can implement this in the code.

 

Any help would be soooooooooooooo appreciated, so that I dont have to dig for hours, to find something that Im sure would be very simple.

 

Thanks so much!  :thumbsup:

 

if the products are slightly different then you should copy them from 1 category to another, not just copy the link.

Treasurer MFC

Posted

Each product is tied to more than one category, which is exactly the problem. I want to know "which category the customer was in when he purchased", not just any category that the poroduct is in. I believe the only way to do this is to record it at the time of purchase.

Any suggestions on how to do this?

 

Thanks for your help so far!

I thought you were looking for the category name.  The product id is tied to a particualr category id and that table is how you get to its name. At least that is how I do it. I don't work with products that are in more than one category but I'm guessing that that table will have two entries for such a case, pointing to the two different categories.  Hopefully someone will correct me if I am wrong.  A quick test wouldn't be that hard to do to verify it though if you want to be sure.  You might also want to try the tep_get_product_path($products_id) function.

 

Jack

Archived

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

×
×
  • Create New...