Forums / General Questions / Uploads attached to a product

Uploads attached to a product

Locked

Views: 1,132

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
28 Jun 2006, 2:30 AM
#1
mark_kimsal avatar

mark_kimsal

New Zenner

Join Date:
Jun 2006
Posts:
14
Plugin Contributions:
0

Uploads attached to a product

I'm trying to attach an uploaded file to a product. The size of the file determines the price. I thought that adding a step in between the product_info page and the add_product action would work, but it doesn't. I put an include into extra_cart_actions, but the subsequent add_product action erases what I put into the session cart. Example:

Extra Cart Action file

switch ( action ) {
  case 'add_product':
  if (the session has no upload) 
    redirect to upload page
    exit
  else 
    break;  //this is where $_GET['action'] == 'add_product' overwrites what I put into $_SESSION['cart']->contents['product_id']
  

  case 'upload':
   attach to session // $_SESSION['cart']->contents['product_id']['filesize']
   redirect to add_product action
}

Any suggestions on how to better structure a file upload BEFORE the product enters the session? I don't want a product w/o an uploaded file to enter the session because then it will have 0 price... Maybe that isn't so bad... hmm.