Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] File uploads as an Option Feature


Guest

Recommended Posts

There are base MS2 files provided for comparison in the contribution zip. At least there were in the last one that I uploaded.

 

Most likely, you need to move the MessageStack lines from after the $action switch to before it (like in the provided application_top.php file).

 

Hth,

Matt

Always back up before making changes.

Link to comment
Share on other sites

  • Replies 482
  • Created
  • Last Reply

Top Posters In This Topic

Hello Everyone,

 

This module is great! After a couple hours I was able to get it installed. However, once its installed, it causes one of my other modules to not work (Quantity Price Breaks Per Product @ http://www.oscommerce.com/community/contri...earch,quantity). I can still add quantity price breaks through admin. But the price break table (which is shown instead of the product price) disappears and then it shows just the product price again. :(

 

Any Ideas?

 

Is anyone else using the Quantity Price Breaks Per Product module with the File Upload Module? The only files that they both use are catalog/checkout_process.php, catalog/product_info.php, catalog/shopping_cart.php.

 

I used WinMerge and I can see the differences, but I'm relatively new at PHP and don't know where I need to change what to get both modules to work in conjunction with each other.

 

I AM WILLING TO PAY SOMEONE $20 :D (OR MORE IF ITS VERY TIME CONSUMING) TO FIX MY PROBLEM AND GET BOTH MODULES TO WORK RIGHT TOGETHER. I know its probably something simple that I'm missing. Please help ASAP! $20! I'll paypal it over to you or via CC or whatever is convenient to you. I just need it done as soon as possible.

 

Thanks,

 

Brian

[email protected]

Link to comment
Share on other sites

Matt,

 

Nice module! It would be very helpful if there was a step-by-step document on how to alter files. The summary of changes in the README helps, but for people who have other modules installed, overwriting files will usually screw up other modules.

 

$20 to help me with the problem I stated in my last post. Anybody?

 

Thanks,

Brian

Link to comment
Share on other sites

Matt will do it for $50 on a per incident basis. He hasn't yet replied to me, however. It's worth it if you ask me. My price break mod works fine but my upload is busted (breaks after "Add to Cart"). Revert to an old version and be more careful.

 

Use a program like WinMerge to compare the Original OSC files with your Price Break mod files, and then compare those to the ones included in the Upload mod. Any files which the Upload mod needs to change which Price Break does not affect, change those first. Once those are crossed off, go ahead and carefully compare and modify those which are common to all three.

 

Does this help?

Link to comment
Share on other sites

Thanks Mike...

 

MATT,

 

I would happily pay you $50 for a professional installation. I need your expertise, can you help?

 

Thanks,

Brian

 

"Ask not what the code can do for you, ask what you can do for the code!!" :D

Link to comment
Share on other sites

Thanks Mike...Hope everyone is enjoying the 4th of July weekend. This module has got my head spinning circles. I actually have used WinMerge, it saved me about an hour because it told me exactly what files I had to change manually:

 

catalog/product_info.php

catalog/shopping_cart.php

catalog/checkout_process.php

 

Upon applying the differences, the price break tables disappear:

checkout the following page to see an example of the price break table.

http://imprintz.com/catalog/product_info.p.../products_id/80

 

When I install FileUpload, it works perfectly except it makes my essential pricing tables disappear.

 

MATT,

 

I would happily pay you $50 for a professional installation. I need your expertise, can you help?

 

Thanks,

Brian

 

"Ask not what the code can do for you, ask what you can do for the code!!" :D

Link to comment
Share on other sites

I have installed the uploads contrib and it works brilliantly, thanks Matt, I've been searching ages for this. The problem I'm having is that I have a number of text input fields as attributes to collect other info relevant to the product, the customers fills these in, a name, apersonal message and then downloads a file.

 

If the file is the wrong format ie .psd rather than . jpg it refreshes the product_info page, give the error message and clears all the info in the other input fields.

 

Any way around this? I thought maybe sending the info to the database before checking the file extensions and returning an error message. Only I have no idea how to do this.

 

Thanks is advance

Ryan

Edited by rhurd
Link to comment
Share on other sites

I would like to know ho0w I can make an uploaded image visible on the Packingslip, been trying and trying but can't get it to work.

Is very handy to handle the orders and to know which images belongs to which order. Specially if you handle ten or twenty orders at a time.

 

:D

Link to comment
Share on other sites

I have done the sql files, and admin php file changes as instructed. I thought I'd get the admin part working first. However, as other people have found out, I also get the error message:

 

1146 - Table 'my_db_name_com_1.TABLE_PRODUCTS_OPTIONS_TYPES' doesn't exist

 

select products_options_types_id, products_options_types_name from TABLE_PRODUCTS_OPTIONS_TYPES where language_id='1' order by products_options_types_id

 

[TEP STOP]

 

Please help! :rolleyes:

Link to comment
Share on other sites

When using the new version of the shopping_cart.php file, and adding an item to the basket, i get the error message:

 

Fatal error: Cannot instantiate non-existent class: productlistingbox in /*****/*****/*****/public_html/catalog/catalog/shopping_cart.php on line 152

 

Is anyone able to help me on this? (I always try to help others...).

Link to comment
Share on other sites

If the file is the wrong format ie .psd rather than . jpg it refreshes the product_info page, give the error message and clears all the info in the other input fields.
Around line 151 of product_info.php, try changing
            $tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'">  ' . $products_options_name['products_options_comment'];

to

            if (isset($HTTP_POST_VARS['id'][' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']) && tep_not_null($HTTP_POST_VARS['id'][' . TEXT_PREFIX . $products_options_name['products_options_id'] . '])) {
             $tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $HTTP_POST_VARS['id'][' . TEXT_PREFIX . $products_options_name['products_options_id'] . '] .'">  ' . $products_options_name['products_options_comment'];
           } else {
             $tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'">  ' . $products_options_name['products_options_comment'];
           }

It would be something along those lines to repeat the info.

 

Hth,

Matt

Always back up before making changes.

Link to comment
Share on other sites

Fatal error: Cannot instantiate non-existent class: productlistingbox in /*****/*****/*****/public_html/catalog/catalog/shopping_cart.php on line 152
I would check that you have
// infobox
 require(DIR_WS_CLASSES . 'boxes.php');

// initialize the message stack for output messages
 require(DIR_WS_CLASSES . 'message_stack.php');
 $messageStack = new messageStack;

// Shopping cart actions
 if (isset($HTTP_GET_VARS['action'])) {

around lines 316-24 of includes/application_top.php

 

Hth,

Matt

Always back up before making changes.

Link to comment
Share on other sites

Fatal error: Cannot instantiate non-existent class: productlistingbox in /*****/*****/*****/public_html/catalog/catalog/shopping_cart.php on line 152
I would check that you have
// infobox
?require(DIR_WS_CLASSES . 'boxes.php');

// initialize the message stack for output messages
?require(DIR_WS_CLASSES . 'message_stack.php');
?$messageStack = new messageStack;

// Shopping cart actions
?if (isset($HTTP_GET_VARS['action'])) {

around lines 316-24 of includes/application_top.php

 

Hth,

Matt

Many thanks Matt, I'd really love to get this going.

 

I then got an error for 'message stack', so I've commented that out.

 

I have 2 problems left.

 

1. The contents of the basket are not displayed on catalog/shopping_cart.php

 

2. Error Message on pressing the final order confirmation button - /catalog/checkout_process.php

 

*Fatal error*: Call to undefined function: tep_decode_specialchars() in*
/opt2/home3/crystal7/public_html/catalog/catalog/checkout_process.php*
on line* 213*

 

Yet the order does actually go through and can be viewed in the admin.

 

Thanks for any help you can give.

Link to comment
Share on other sites

2. Error Message on pressing the final order confirmation button - /catalog/checkout_process.php

 

*Fatal error*: Call to undefined function: tep_decode_specialchars() in*
/opt2/home3/crystal7/public_html/catalog/catalog/checkout_process.php*
on line* 213*

Solved by adding to general.php

 

////

//CLR 030228 Add function tep_decode_specialchars

// Decode string encoded with htmlspecialchars()

function tep_decode_specialchars($string){

$string=str_replace('>', '>', $string);

$string=str_replace('<', '<', $string);

$string=str_replace(''', "'", $string);

$string=str_replace('"', "\"", $string);

$string=str_replace('&', '&', $string);

 

return $string;

}

Link to comment
Share on other sites

1. The contents of the basket are not displayed on catalog/shopping_cart.php
This is usually a problem with the database settings. Make sure that you ran all three .sql files (the relevant one here is the one that has the inserts). It may also mean that code didn't get merged into one of the shopping_cart files.

 

Hth,

Matt

Always back up before making changes.

Link to comment
Share on other sites

Matt,

 

I've been trying for a few days now to use this contribution in a similar but different way....

 

I want to have a new customer be able to "upload" an image when they create a new account. Then have that be linked to their customer_id from their account & the database.

 

Your contribution has all the pieces it seems: the data base to store the image, upload "form", even the image extension limitations.

 

I tried to strip the product options code but it seems to blow up on me everytime.

 

Here is the upload form code:

 

<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td class="submain"><?php echo ENTRY_PROGRAM_UPLOAD; ?></td>
<td class="submain">
<input type="file" name="id[<?php echo $filesuploadedid['filesuploadedname'] . ' ' . (tep_not_null(ENTRY_PROGRAM_UPLOAD_TEXT) ? '<span class="inputRequirement">' . ENTRY_PROGRAM_UPLOAD_TEXT . '</span>': ''); ?>]"></td>
</tr>
</table>

 

Here's the database query/insert:

 

tep_db_perform(TABLE_FILES_UPLOADED, $sql_data_array);
$sesskey = tep_db_insert_id();
$sql_data_array =
array('files_uploaded_id' => $filesuploadedid, 'sesskey' => $sesskey,
'files_uploaded_name ' => $filesuploadedname);

 

I ended up driving myself nuts with the code in application_top.php which seems to be the key to this quandy I'm in.

 

Advice?

 

Thanks!

Thomas

Link to comment
Share on other sites

I'm just using the osCommerce code with a few modifications to work with a flexible number of images. For what you want to do, you may want to look at admin/categories.php instead, as that just loads one image per name. It should be closer to what you need. You also may want to ditch the separate table for uploads. You can rename to the userid (which must be unique) instead.

 

Hth,

Matt

Always back up before making changes.

Link to comment
Share on other sites

Hi All,

 

I've been using this great contribution with one of my sites, and now I want to install it on another site. The problem is that I'm going to base this other site on CRE Loaded 6, and I wonder if any of you had some expirience with it or can tell me what I should be aware of.

 

I'll also modify it so after the image is uploaded, it will be shown in the shopping cart.

 

Oh, by the way, does anyone modified the script to show a "Please wait" message while the file is being uploaded ?

 

Thanks in advance,

Eyal

Link to comment
Share on other sites

Hi,

 

i have installes the contribution "File Upload .77 (for PA - Option Type Feature)"

and it works fine.

 

but everytime i add an productattribute (text or file) i get a new optionvalue with ID "0". (there are now 3 optionvalues with different valuesnames)

 

Before, with the contribution "option_type_feature_v1.6" there was only 1 optionvalue with ID"0"

 

Is this an error or an feature, i don`t know !(?)

 

Can anyone help?

 

Patrick

 

*sorry for my bad english

Captain: I thought you were going to upgrade this.

Trip: That is the upgrade.

Well, if you want, I can change the color.

Link to comment
Share on other sites

For those looking to add an upload progress window to the upload mod you can try the following. It seems to work and is simple to install.

 

Create a new file: progress_upload.php and save in your osCommerce root directory

 

<html>
<head>
 <title><?php echo _("Uploading File...") ?></title>
</head>
<body>
<center>
<span style="font-size:8pt;font-family:arial,helvetica,sans-serif;font-weight:bold;color:#ffffff;background-color:#009900;padding:3px;"><?php echo _(" File upload in progress! ") ?></span>
<p>
<span style="font-size:8pt;font-family:arial,helvetica,sans-serif;">
<?php echo _("This page will go away automatically when the upload is complete.  Please be patient!") ?>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr>
 <td> <img src="images/computer.gif"></td>
 <td> <img src="images/uploading.gif"></td>
 <td> <img src="images/computer.gif"></td>
</tr>
</table>

</center>
</span>
</body>
</html>

 

 

Create a new file: uploading.js and save in your osCommerce root directory (usually catalog)

 

<script type="text/javascript">
<!--
var win = null;

function showProgress() {
 win = window.open("progress_upload.php","status",'width=350,height=150,scrollbars=no,statusbar=no,toolbars=no');
}
-->
</script>

 

Edit catalog/product_info.php

 

Right before

</head>

 

Add

<?php  require('uploading.js'); ?>

 

Find

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

 

Change to

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" onUnLoad="win.close()">

You are adding the onUnload option.

 

Around line 323

 

Find:

<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART,''); ?>

 

Change to:

<?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART,'onClick="showProgress()"'); ?>

You are adding the onClick option

 

The graphics used in the box are:

 

computer.gifuploading.gifcomputer.gif

 

The two image files that I used are from the "Menalto Gallery" project.

Right click and save from here or download the graphics from www.imijit.net/downloads/uploading.gif and www.imijit.net/downloads/computer.gif.

 

When you start your upload the popup box will appear. When the upload is finished and the product_info page is refreshed the box will close.

 

This is only tested when you do not show the shopping cart after adding the item. The window should close when the program closes but I have not tested it that way yet.

 

I hope that someone finds this useful.

 

Scott

Link to comment
Share on other sites

@Scott

 

your Upload-Page & Script works fine!

 

Thanks

 

@All

 

can anyone help me with my problem? (because i don`t know if it is a problem or not)

 

- have 3 or more optionvalues with different valuesnames instead of only 1

 

 

Patrick

Captain: I thought you were going to upgrade this.

Trip: That is the upgrade.

Well, if you want, I can change the color.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...