Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding a field to the shopping cart...


The Annoyed Man

Recommended Posts

Posted

As you can see from the gif displayed below, I've had to add a field to the shopping cart so that customers may provide additional data for each line item in the order, such as a person's name, or a purchase order number, or something like that. Unfortunately, my PHP skills are fading (along with my hair color and my eyesight). I need to accomplish two things:

  1. I need to assign each field a unique field name as PHP writes the html appending a new row;
  2. I need to be able to echo the variables back into each field's value each time the shopping cart is updated by the addition of a new line item.

shoppingcart_snapshot.gif

 

I've already added a column to orders_products to accommodate the new information. If anybody has any ideas, I'm all ears (or eyes).

Posted

I'd look at how qty is processed and mirror that, but wouldn't multiply unit cost by the new field :-)

 

Naturally order emails and the admin order display would also need to be amended.

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Posted

Wouldn't it be easier (and possibly make more sense) to add that info to the item as a text field using the Option Type contrib? The way you are doing it in the cart, if I'd order 2 sets of business cards that have two separate job names, I couldn't do it. If you input the job name in the product_info screen, two business card sets with different job names would show up as separate items. You follow?

Even at a Mensa convention someone is the dumbest person in the room.

Posted
Wouldn't it be easier (and possibly make more sense) to add that info to the item as a text field using the Option Type contrib? The way you are doing it in the cart, if I'd order 2 sets of business cards that have two separate job names, I couldn't do it. If you input the job name in the product_info screen, two business card sets with different job names would show up as separate items. You follow?

I follow, but once I showed this idea to my employer, he added a new twist: He wants the customer to be able to upload an art file for each product being ordered (we are a printing company), and he wants the file name and instructions to be appended to the item information as it is carried forward to the checkout process, but he doesn't want the files to actually upload until the customer is checking out. He also wants the upload script to create a unique folder to which all of the files associated with that order will be uploaded.

 

I'm in deep kim chi now. :-"

Posted

OK, I installed the Option Type contrib (v2.02) and inserted the sql into my database, and I now get the following error if I try to create a product option in the admin panel:

 

1054 - Unknown column 'products_options_type' in 'field list'

 

insert into products_options (products_options_id, products_options_name, language_id, products_options_type, products_options_length, products_options_comment) values ('1', 'Job Name', '1', '1', '25', 'Give us the job name')

 

[TEP STOP]

 

Now what?

Posted

Never mind. I'm an idiot. I left out one of the sql insertions... :blush:

OK, I installed the Option Type contrib (v2.02) and inserted the sql into my database, and I now get the following error if I try to create a product option in the admin panel:

 

1054 - Unknown column 'products_options_type' in 'field list'

 

insert into products_options (products_options_id, products_options_name, language_id, products_options_type, products_options_length, products_options_comment) values ('1', 'Job Name', '1', '1', '25', 'Give us the job name')

 

[TEP STOP]

 

Now what?

Posted

I have another question....

 

I am currently unable to remove shopping cart items that have option type attributes. In the contribs list, there is one called OTF_remove_product_fix.txt which supposedly solves that problem. However, when I open includes/classes/shopping_cart.php to perform the edits, the "find" code does not exist in either my original version of shopping_cart.php (v.2.02), nor in the file I downloaded with "product_attributes_option_type_2.02", so I don't know what to do with the "replace with" code.

 

I apologize for not stating it more clearly, but does anyone know how to get around this?

Archived

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

×
×
  • Create New...