Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Allow customer to upload file with order


mark

Recommended Posts

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:

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...