Jump to content



- - - - -

Allow customer to upload file with order


This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1   mark

mark
  • Members
  • 21 posts

Posted 18 October 2002 - 08:13 PM

Hi,

I"m looking to build a mod which will allow the customer to upload a file along with his order, I.E. A document/image etc..

I think I've progressed in my php skills in the past few months, and I know how to upload files, keep track in db etc.

I am just a little tangled with all the functions and sub functions osCommerce use's for the order placing, database entries..etc..

Can anyone point me in the right direction? Is anyone else working on something like this ?

:lol:

#2   mark

mark
  • Members
  • 21 posts

Posted 18 October 2002 - 08:48 PM

Ok..

I am thinking I could add the file upload section in the same place where the user enters comments etc.. for the order .
checkout_payment.php

I guess I can also do the file upload on the following page -
checkout_confirmation.php

and then pass the variable to the Order object ..rewriting the Order.php to include the name of the file, obviously adding a new field in the order table.

Anyone know on which page the actual order object and query functions are ran which create the order entry in the db ?

Thanks..

I think I'm getting there just talking to myself.

#3   Ajeh

Ajeh
  • Members
  • 6,327 posts

Posted 18 October 2002 - 09:00 PM

You might want to be able to do that on checkout_success.php and account_history_info.php

Make it similar to downloads but different. :D

#4   mark

mark
  • Members
  • 21 posts

Posted 18 October 2002 - 09:29 PM

You might want to be able to do that on checkout_success.php and account_history_info.php

Make it similar to downloads but different.

Well..I'll make it so you could download that iamge through the admin when viewing the order details....or in account history under order details as well..

I'm still not sure about the functions..any help linda?

#5   blue_fire

blue_fire
  • Members
  • 1 posts

Posted 22 October 2002 - 03:05 AM

i have this self problem :D sorry for my bad englisch  :oops:

i have replaced the coments box in checkout_payment.php

          <tr>

            <td><?php echo tep_draw_textarea_field('comments', 'virtual', '60', '5'); ?></td>

          </tr>
to
          <tr>

            <td><?php echo tep_draw_file_field('comments', 'file'); ?></td>

          </tr>

and add this funktion in includes/functions/html_output.php
this code assimilatet from admincenter upload funktion

[code}
// Output a form input field
  function tep_draw_input_field($name, $value = '', $parameters = '', $type = 'text', $reinsert_value = true) {
    $field = '<input type="' . $type . '" name="' . $name . '"';

    if ( (isset($GLOBALS[$name])) && ($reinsert_value == true) ) {
      $field .= ' value="' . htmlspecialchars(trim($GLOBALS[$name])) . '"';
    } elseif (tep_not_null($value)) {
      $field .= ' value="' . htmlspecialchars(trim($value)) . '"';
    }

    if (tep_not_null($parameters)) $field .= ' ' . $parameters;

    $field .= '>';

    return $field;
  }

////
[/code]


this works good

unfortunately left into the data base it must succeed still somehow that the file uploaded becomes registered only

the upload funktion find in admin/categories.php i hope anyone cant help us :D

sorry for my bad google englisch  :P

#6   mark

mark
  • Members
  • 21 posts

Posted 22 October 2002 - 06:07 PM

Ok,

That piece, from what I know, just allows the user to input a file.

I'm going to try doing this,

On the page after the "comments" page, I'm going to write the file to a directory on the server using a copy command.

Then, update the database with the name of the file.

Are you there yet?