Jump to content
Zappo

[Contribution] Option Types v2

Recommended Posts

Hi Zappo

 

This is a great contribution and have been using it for some time and it has benefited my shop.

 

I am starting another website and I now need the only section I had not implemented yet which was "Option Type Images" but I cant seem to get any images to appear, I have checked the code, but cant find the problem?

 

Have you any suggestions?

 

Regards

 

Philip

Share this post


Link to post
Share on other sites

hi, sorry for my english.

 

I have a little problema with contribution.

 

if i use more option image attribues, in second option i see all value, first value options and second values options the problem i think are here

 

$ImageSelector_Name = $ProdOpt_Name . ': <script language="JavaScript" type="text/JavaScript">var ImageText'.$product_info['products_id'] . ' = new Array(' . $ImageText[$product_info['products_id']] . ')</script>';

 

 

but i can't how resolve it.

 

her its the link where you can see it

 

http://www.puntograph.it/shop/product_info.php?cPath=95_96&products_id=949

 

 

in option clip, values are

Azzurro(04)

Nero(02)

Rosso(03)

Verde(05)

 

in option Inchiostro values are

Blu(07)

Nero(02)

 

but i see also this

Azzurro(04)

Nero(02)

Rosso(03)

Verde(05)

 

i do only i modify to contributions

i change

 

$Real_Image_Name = OPTIONS_TYPE_IMAGEPREFIX . $Image_Name . ((OPTIONS

 

with this

 

$Real_Image_Name = $ProdOpt_Name .'_'. $Image_Name .

 

so i can use different image for different option but equal values. but also original file i have this problem,

 

i fix that change second value option see change first image so

 $ImageSelector_Dropdown = '<select name="' . $Image_Dropdown_ID . '" onChange="document.getElementById(\'ImageSelect' . $product_info['products_id'] . '\').innerHTML=ImageText'.$product_info['products_id'].'[this.selectedIndex];">' . $Image_Dropdown[$product_info['products_id']] . '</select> ' . $ProdOpt_Comment;

 

so

$ImageSelector_Dropdown = '<select name="' . $Image_Dropdown_ID . '" onChange="document.getElementById(\'ImageSelect' . $ProdOpt_Name . $product_info['products_id'] . '\').innerHTML=ImageText'.$product_info['products_id'].'[this.selectedIndex];">' . $Image_Dropdown[$product_info['products_id']] . '</select> ' . $ProdOpt_Comment;

 

but in second option not see right values, see only first values.

also for problem with image not see all, why?

Edited by thenexgen

Share this post


Link to post
Share on other sites

this is right code sorry

 

i fix that change second value option see change first image so

 <center><?php echo '<div class="main" id="ImageSelect' . $product_info['products_id'] . '">' . $First_ImageText[$product_info['products_id']] . '</div>';?></center>


so 
[code]<td class="main"><?php echo $ImageSelector_Dropdown .' <div class="main" id="ImageSelect' . $ProdOpt_Name  . $product_info['products_id'] . '">' . $First_ImageText[$product_info['products_id']] . '</div>';?></td>

Edited by thenexgen

Share this post


Link to post
Share on other sites

hi,

can some one let me know how to make a button to activate a java scrip. let say only on press of this button the java script should activate.

thanks

valerif

Share this post


Link to post
Share on other sites

@Zappo: First I want to thank for this great contribution. Installed and working just fine!

 

Maybe somebody can help me how I can make the Option Types contribution work together with PDF data_sheet maker (http://addons.oscommerce.com/info/1077).

 

When the generate pdf Link on the product_info.php is pressed then the generated datasheet pdf has all the options listed but without the values entered:

 

datasheet_pdf.jpg

 

The input values are not passed from the product_info.php to the pdf_datasheet_function.php.

 

product_info.php:

...
<!-- BOE: PDF Datasheets //-->
               <td align="left" valign="middle" class="main"><!-- <?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?> --></td>
	  <td align="center" valign="middle" class="main"><?php echo '<table border="0" cellspacing="0" cellpadding="0"><tr><td valign="middle"><a href="' . tep_href_link(FILENAME_PDF_DATASHEET, 'products_id=' . $product_info['products_id']) .'" target="_blank">' . TEXT_PDF_DOWNLOAD1 . '</a> </td><td valign="middle"><a href="' . tep_href_link(FILENAME_PDF_DATASHEET, 'products_id=' . $product_info['products_id']) .'" target="_blank">' . tep_image('images/pdf.png',TEXT_PDF_DOWNLOAD2) .'</a></td></tr></table>'; ?></td>
               <td align="right" valign="middle" class="main"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
<!-- EOE: PDF Datasheets //-->
...

 

pdf_datasheet_function.php:

...
if(PDF_SHOW_OPTIONS) {
     if (tep_db_num_rows($products_options_name)) {
       $this->MultiCell(0,8,TEXT_PRODUCTS_OPTIONS . $print_catalog_array['name'] .' :',0,'L',0);
       $this->Ln(-5);
     }
     while ($products_options_name_values = tep_db_fetch_array($products_options_name)) {
       $products_options_array = array();
       $products_options_name_values['products_options_name'];
       $this->Ln(6);
       $attributes_heading_font=explode(",",PDF_ATTRIBUTES_HEADING_FONT);
       $this->SetFont($attributes_heading_font[0],$attributes_heading_font[1],$attributes_heading_font[2]);
       $this->Cell(190,5,$products_options_name_values['products_options_name'],0,0,'L');
       $this->Ln();
       $products_options = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . $products_id . "' and pa.options_id = '" . $products_options_name_values['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'" . " order by 0+pov.products_options_values_name");
       $count_options_values = tep_db_num_rows($products_options);
  		$count_options = 0;

       while ($products_options_values = tep_db_fetch_array($products_options)) {
         $products_options_array[] = array('id' => $products_options_values['products_options_values_id'], 'text' => $products_options_values['products_options_values_name'],  'price_id' => $products_options_values['products_options_values_id'],   'text2' => $products_options_values['options_values_price']);
         $w=$this->GetStringWidth($products_options_values['products_options_values_name'])+2;
         $attributes_font=explode(",",PDF_ATTRIBUTES_FONT);
         $this->SetFont($attributes_font[0],$attributes_font[1],$attributes_font[2]);
         $this->SetTextColor(0,0,200);
         $option_string = $products_options_values['products_options_values_name'] . $option_value;
         if ( $products_options_values['options_values_price'] != ' 0.0000' && PDF_SHOW_OPTIONS_PRICE == '1') {
           $count_options++; $add_to = ($count_options_values != $count_options ? ',' : '.' );
           $this->Write(5,$products_options_values['products_options_values_name']. ' (' . $products_options_values['price_prefix'] . $currencies->display_price($products_options_values['options_values_price'], tep_get_tax_rate($print_catalog['products_tax_class_id'])) . ')' . $add_to);
         } else {
           $count_options++; $add_to = ($count_options_values != $count_options ? ',' : '.' );
           $this->Write(5,$products_options_values['products_options_values_name'] . $add_to);
         }
         $this->Cell(3,6,"",0,0,'C');
         $this->SetTextColor(0,0,0);
       }
     }
   }
...

 

Maybe somebody can help how to pass the custom input values to the pdf datasheet file?

 

Would be great me and an interesting extra feature for everybody who want a custom product datasheet pdf.

Share this post


Link to post
Share on other sites

Hi Zappo,

 

I have done a bit more playing around with this problem now and have come up with the following;

 

In catalog/includes/application_top.php the instruction call for identifying the following code;

 

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

 

And replacing it with the following;

 

//BOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir
                               $purgeDir = opendir(TMP_DIR) or die ('Could not open '.TMP_DIR);
                               while ($file = readdir($purgeDir)) {
                                 if ($file != ('.htaccess') && $file != ('.') && $file != ('..') && filemtime(TMP_DIR . $file) < strtotime(OPTIONS_TYPE_PURGETIME)) {
                                   unlink(TMP_DIR . $file);  // Delete file from server...
                                   tep_db_query("delete from " . TABLE_FILES_UPLOADED . " where files_uploaded_name = '" . $file . "'"); // Remove File's database entry....
                                 }
                               }
                               closedir($purgeDir);
                               //EOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir

                               //BOF - Zappo - Option Types v2 - ONE LINE - Set real_ids for processing
                               $real_ids = $HTTP_POST_VARS['id'];
                               //BOF - Zappo - Option Types v2 - File uploading: save uploaded files with unique file names, in the proper folder
                               if ($HTTP_POST_VARS['number_of_uploads'] > 0) {
                                 require(DIR_WS_CLASSES . 'upload.php');
                                 for ($i = 1; $i <= $HTTP_POST_VARS['number_of_uploads']; $i++) {
                                   $TEMP_FILE = $_FILES['id']['tmp_name'][TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i]];
                                   if (tep_not_null($TEMP_FILE) && $TEMP_FILE != 'none') {
                                     $products_options_file = new upload('id');
                                     //BOF - Zappo - Option Types v2 - Set Upload directory (Registered customers in Uploads, other in Temporary folder)
                                     if (tep_session_is_registered('customer_id')) {  // IF the customer is registered, use Upload Dir
                                       $products_options_file->set_destination(UPL_DIR);
                                     } else { // If the customer is not registered, use Temporary Dir
                                       $products_options_file->set_destination(TMP_DIR);
                                     }
                                     //EOF - Zappo - Option Types v2 - Set Upload directory (Registered customers in Uploads, other in Temporary folder)
                                     if ($products_options_file->parse(TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i])) {
                                       if (tep_session_is_registered('customer_id')) {
                                         tep_db_query("insert into " . TABLE_FILES_UPLOADED . " (sesskey, customers_id, files_uploaded_name, date) values('" . tep_session_id() . "', '" . $customer_id . "', '" . tep_db_input($products_options_file->filename) . "', '" . date("d-m-y") . "')");
                                       } else {
                                         tep_db_query("insert into " . TABLE_FILES_UPLOADED . " (sesskey, files_uploaded_name, date) values('" . tep_session_id() . "', '" . tep_db_input($products_options_file->filename) . "', '" . date("d-m-y") . "')");
                                       }
                                       //BOF - Zappo - Option Types v2 - Set File Prefix
                                       if (OPTIONS_TYPE_FILEPREFIX == 'Database') {  //  Database ID as File prefix
                                         $insert_id = tep_db_insert_id() . '_';
                                       } else {  //  Date, time or both as File prefix (Change date formatting here)
                                         if (OPTIONS_TYPE_FILEPREFIX == 'Date' || OPTIONS_TYPE_FILEPREFIX == 'DateTime') {
                                           $insert_id = 'D'.date("d-m-y_");
                                         }
                                         $insert_id .= (OPTIONS_TYPE_FILEPREFIX == 'DateTime' || OPTIONS_TYPE_FILEPREFIX == 'Time') ? 'T'.date("H-i_") : '';
                                       }
                                       //EOF - Zappo - Option Types v2 - Set File Prefix
                                       // Update filename in Database with correct prefix (For comparing database names with real files)
                                       tep_db_query("update " . TABLE_FILES_UPLOADED . " set files_uploaded_name = '" . tep_db_input($insert_id . $products_options_file->filename) . "' where sesskey = '" . tep_session_id() . "' and files_uploaded_name = '" . tep_db_input($products_options_file->filename) . "' and date = '" . date("d-m-y") . "'");
                                       $real_ids[TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i]] = $insert_id . $products_options_file->filename;
                                       $products_options_file->set_filename($insert_id . $products_options_file->filename);
                                       if (!($products_options_file->save())) {
                                         break 2;
                                       }
                                     } else {
                                       break 2;
                                     }
                                   } else { // No file uploaded -- use previously uploaded file (From Dropdown)
                                     $real_ids[TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i]] = $HTTP_POST_VARS[TEXT_PREFIX . UPLOAD_PREFIX . $i];
                                   }
                                 }
                               }
                               //EOF - Zappo - Option Types v2 - File uploading: save uploaded files with unique file names, in the proper folder
                               //BOF - Zappo - Option Types v2 - ONE LINE - Replace the posted array with the processed one.
                               $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $real_ids))+1, $real_ids);

 

 

If I leave the original code in place, the add to cart button works fine and the product is added to the cart, if however, I replace it with the Option Types V2 code, in its raw form I get an error in application_top.php as follows;

 

Parse error: syntax error, unexpected T_CASE in /homepages/0/d177551101/htdocs/pmashop/includes/application_top.php on line 444

 

This relates to what looks like an eronious } two lines below the original code, this is how the code looked before the update;

 

// customer adds a product from the products page

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

 

 

}

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

break;

 

The parenthesis that causes the problems when the new code is applied is the one in bold above.

 

Any advice you can give me would be much appreciated!

 

Cheers,

Peter.

 

 

Hi Peter did you find an answer for this I am having the same problem.

 

Thanks Raphael

Edited by maxemus

Share this post


Link to post
Share on other sites

Hello

Any one know if this is compatible with options as images and attribute sets? I have installed Options Types v2 and I'm not able to get a text box. Not able to get all the options on the Product attribute screen, Box: windows - English and Download: Windows - English wont show up in the Products Attributes are also can't find them in the database.

Share this post


Link to post
Share on other sites

Hi Peter did you find an answer for this I am having the same problem.

 

Thanks Raphael

 

 

Thanks anyway I Figured it out. Have different issue now.

Share this post


Link to post
Share on other sites

Hello

Any one know if this is compatible with options as images and attribute sets? I have installed Options Types v2 and I'm not able to get a text box. Not able to get all the options on the Product attribute screen, Box: windows - English and Download: Windows - English wont show up in the Products Attributes are also can't find them in the database.

Share this post


Link to post
Share on other sites

Hi Zappo,

 

I am trying to do the following function.

 

Example:

 

In the product listing there are different sizes T-shirts. I choose a size A and go to shopping cart. From there I can check out but also i am presented with 2 more options (add a pair of trousers to match the T-shirt and a add a coating to the T-shirts print for better protection). If i choose them the shopping cart updates including them too.

 

Let me know please if you could suggest how could I achieve such a functionality.

 

Thanks

valeri

Share this post


Link to post
Share on other sites

I just installed Option Types v2 and am trying to figure out how to add text boxes to a product. I am selling business cards and I need several text boxes where they can put in their information that they want on the business card during checkout.

 

I am searching the forums but feel like I'm going in circles.

 

Any assistance would be very appreciated!

Share this post


Link to post
Share on other sites

I just installed Option Types v2 and am trying to figure out how to add text boxes to a product. I am selling business cards and I need several text boxes where they can put in their information that they want on the business card during checkout.

 

I am searching the forums but feel like I'm going in circles.

 

Any assistance would be very appreciated!

 

Just make a new option and select the option type to be "text" There is no difference to the stock options, only thing to do is to choose the type

Share this post


Link to post
Share on other sites

Just make a new option and select the option type to be "text" There is no difference to the stock options, only thing to do is to choose the type

 

Thankyou. Now once I set that option and press insert I get this message

 

1136 - Column count doesn't match value count at row 1

 

insert into products_attributes values (null, '33', '3', '13', '0', '+')

 

[TEP STOP]

 

 

Sorry I am a complete novice here!

Share this post


Link to post
Share on other sites

Thankyou. Now once I set that option and press insert I get this message

 

1136 - Column count doesn't match value count at row 1

 

insert into products_attributes values (null, '33', '3', '13', '0', '+')

 

[TEP STOP]

 

 

Sorry I am a complete novice here!

 

Did you complete the installation? There was an .sql file to execute via phpMyAdmin, did you do this?

Share this post


Link to post
Share on other sites

Yes

 

How does it react when you try to insert a "regular" drop down attribute?

Do yoy use the "product attributes" apge of admin or the attribute manager on the product setup page?

Share this post


Link to post
Share on other sites

Hi,

 

I just wanted to say that I love this add-on and thank you for all your work. It has made my life much easier in building my store. :)

 

Is there any way to make the option fields required? I have my customers uploading a photo and typing text to customize their product, but sometimes we get orders with nothing typed or uploaded (both of which are required). Any help would be great.

 

Thanks!

Share this post


Link to post
Share on other sites

Hello Zappo & EveryOne:

 

First thanks for the contribution, I LUV IT!!!, just what I needed for my shop :). Everything was working perfectly, but, I just installed sam's contribution Simple Multi Image Addon with Pretty Photo, and now am having problems with the options not showing up on the shopping cart. When you first add the options you can see them when adding to cart:

 

barbieorder1.jpg

 

If you check in Cart Contents then they all appear as if they were files or images:

barbieorder4.jpg

 

And then when checking out they all appear blank:

order-confirm-barbie.jpg

 

The thing is the only file that both of these contributions edit in common is the product_info.php, and I really didn't see any of the codes conflicting, maybe I'm wrong, really don't know. I used winmerge and kdiff3 to make sure. Also I am really not getting any error messages on any of the test orders I have done, or my admin side, so I really don't know where to look, everything seemed to be working fine.

 

The Ajax attribute manager that is attached with this contribution edits categories in admin, and so does sam's contribution, but I believe the simple image multi addon, is not using javascript on this particular file, so it should not be conflicting. I am also using Minimum Quantity contribution. These are the three add ons that appear on my products page. The product that I have using all three for a test is Barbie All Dolled UP. My shop url is Click here

 

Please let me know if you have any ideas on what might be causing this issue, I really love both contributions and really need them. Thanks in advance!!!


I Hate PHP, LoLssss

Visit My Site, Any constructive comments and suggestions Welcome :)

WARNING: IT'S STILL UNDER CONSTRUCTION, LOLS

Share this post


Link to post
Share on other sites

Is this contribution compatible with Attribute Sets?

 

Can they be used together?

 

I tried to review the previous posts, but didn't see any replies to this question.

Share this post


Link to post
Share on other sites

Hello Zappo & EveryOne:

 

First thanks for the contribution, I LUV IT!!!, just what I needed for my shop :). Everything was working perfectly, but, I just installed sam's contribution Simple Multi Image Addon with Pretty Photo, and now am having problems with the options not showing up on the shopping cart. When you first add the options you can see them when adding to cart:

 

barbieorder1.jpg

 

If you check in Cart Contents then they all appear as if they were files or images:

barbieorder4.jpg

 

And then when checking out they all appear blank:

order-confirm-barbie.jpg

 

The thing is the only file that both of these contributions edit in common is the product_info.php, and I really didn't see any of the codes conflicting, maybe I'm wrong, really don't know. I used winmerge and kdiff3 to make sure. Also I am really not getting any error messages on any of the test orders I have done, or my admin side, so I really don't know where to look, everything seemed to be working fine.

 

The Ajax attribute manager that is attached with this contribution edits categories in admin, and so does sam's contribution, but I believe the simple image multi addon, is not using javascript on this particular file, so it should not be conflicting. I am also using Minimum Quantity contribution. These are the three add ons that appear on my products page. The product that I have using all three for a test is Barbie All Dolled UP. My shop url is Click here

 

Please let me know if you have any ideas on what might be causing this issue, I really love both contributions and really need them. Thanks in advance!!!

 

Can anyone pleaseeeeeeeeeeee helppp me with this issue??? :'( I have since uninstalled the Multiple Images Add-on, restored database to earliear dates, but I have the same problem with the Options V2, I can't figure out why, everything was working great!!! I tested further, and it just happens with the newer products that I've added, the first products that I had, seem to work fine. Any suggestions??? Thanks in advance,

Glenda


I Hate PHP, LoLssss

Visit My Site, Any constructive comments and suggestions Welcome :)

WARNING: IT'S STILL UNDER CONSTRUCTION, LOLS

Share this post


Link to post
Share on other sites

Hello Zappo & EveryOne:

 

First thanks for the contribution, I LUV IT!!!, just what I needed for my shop :). Everything was working perfectly, but, I just installed sam's contribution Simple Multi Image Addon with Pretty Photo, and now am having problems with the options not showing up on the shopping cart. When you first add the options you can see them when adding to cart:

 

barbieorder1.jpg

 

If you check in Cart Contents then they all appear as if they were files or images:

barbieorder4.jpg

 

And then when checking out they all appear blank:

order-confirm-barbie.jpg

 

The thing is the only file that both of these contributions edit in common is the product_info.php, and I really didn't see any of the codes conflicting, maybe I'm wrong, really don't know. I used winmerge and kdiff3 to make sure. Also I am really not getting any error messages on any of the test orders I have done, or my admin side, so I really don't know where to look, everything seemed to be working fine.

 

The Ajax attribute manager that is attached with this contribution edits categories in admin, and so does sam's contribution, but I believe the simple image multi addon, is not using javascript on this particular file, so it should not be conflicting. I am also using Minimum Quantity contribution. These are the three add ons that appear on my products page. The product that I have using all three for a test is Barbie All Dolled UP. My shop url is Click here

 

Please let me know if you have any ideas on what might be causing this issue, I really love both contributions and really need them. Thanks in advance!!!

Is Anybody HOme??? :-"

 

Although this thread seems to be dead, just wanted to update the info that I had posted. I currently have Option Types V2 and Sam's contribution Simple Multi Image Addon with Pretty pHoto, worrrkinggggg perrrfectly. It was actually a conflict with the MPQ, minimum quantity per product contribution, causing the problem. For some reason MPQ, does not, can not, or don't really know the causes, but loses the attributes if you assign a minimum quantity for the product with Option Types V2 attributes. If you search the topic, you will find MPQ has this problem with other product attribute contributions also. Sooo, sorry if I mislead anyone with my little problem there...

 

BTW, I think this time Zappo is really somewhere in paradise drinking a cool pina colada, while I'm practically tearing my hair out with my Oscommerce Journey, lolsss Thanks for the contribution Zappo :) One of the best I have gotten the chance to use!!! :thumbsup:


I Hate PHP, LoLssss

Visit My Site, Any constructive comments and suggestions Welcome :)

WARNING: IT'S STILL UNDER CONSTRUCTION, LOLS

Share this post


Link to post
Share on other sites

Hello and thanks for that contribution.

 

it works fine, but I have a strange problem with application_top.php - add_product:

I get a 500 error with this part of code (but the upload works) or - if I comment this out - the script works, but no uploads.

 


                                      //if (!($products_options_file->save())) {
                                      //break 2;
                                      //}
                                      }
                                      //else {
                                      //break 2;
                                      //}

 

Here is the whole add_prduct code:

 


case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                               $real_ids = $HTTP_POST_VARS['id'];
                                if ($HTTP_POST_VARS['number_of_uploads'] > 0) 
                                {
                                 require(DIR_WS_CLASSES . 'upload.php');
                                 for ($i = 1; $i <= $HTTP_POST_VARS['number_of_uploads']; $i++) 
                                 {
                                   $TEMP_FILE = $_FILES['id']['tmp_name'][TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i]];
                                   if (tep_not_null($TEMP_FILE) && $TEMP_FILE != 'none') 
                                   {
                                     $products_options_file = new upload('id');

                                     if (tep_session_is_registered('customer_id')) 
                                     {  
                                       $products_options_file->set_destination(UPL_DIR);
                                     } else 
                                     { 
                                       $products_options_file->set_destination(TMP_DIR);
                                     }

                                     if ($products_options_file->parse(TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i])) 
                                     {
                                       if (tep_session_is_registered('customer_id')) 
                                       {
                                         tep_db_query("insert into " . TABLE_FILES_UPLOADED . " (sesskey, customers_id, files_uploaded_name, date) values('" . tep_session_id() . "', '" . $customer_id . "', '" . tep_db_input($products_options_file->filename) . "', '" . date("d-m-y") . "')");
                                       } else {
                                         tep_db_query("insert into " . TABLE_FILES_UPLOADED . " (sesskey, files_uploaded_name, date) values('" . tep_session_id() . "', '" . tep_db_input($products_options_file->filename) . "', '" . date("d-m-y") . "')");
                                       }
                                       //BOF - Zappo - Option Types v2 - Set File Prefix
                                       if (OPTIONS_TYPE_FILEPREFIX == 'Database') {  //  Database ID as File prefix
                                         $insert_id = tep_db_insert_id() . '_';
                                       } else {  //  Date, time or both as File prefix (Change date formatting here)
                                         if (OPTIONS_TYPE_FILEPREFIX == 'Date' || OPTIONS_TYPE_FILEPREFIX == 'DateTime') {
                                           $insert_id = 'D'.date("d-m-y_");
                                         }
                                         $insert_id .= (OPTIONS_TYPE_FILEPREFIX == 'DateTime' || OPTIONS_TYPE_FILEPREFIX == 'Time') ? 'T'.date("H-i_") : '';
                                       }
                                       //EOF - Zappo - Option Types v2 - Set File Prefix
                                       //Update filename in Database with correct prefix (For comparing database names with real files)
                                       tep_db_query("update " . TABLE_FILES_UPLOADED . " set files_uploaded_name = '" . tep_db_input($insert_id . $products_options_file->filename) . "' where sesskey = '" . tep_session_id() . "' and files_uploaded_name = '" . tep_db_input($products_options_file->filename) . "' and date = '" . date("d-m-y") . "'");
                                       $real_ids[TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i]] = $insert_id . $products_options_file->filename;
                                       $products_options_file->set_filename($insert_id . $products_options_file->filename);

                                      //if (!($products_options_file->save())) {
                                      //break 2;
                                      //}
                                      }
                                      //else {
                                      //break 2;
                                      //}

                                   } 
                                   else { // No file uploaded -- use previously uploaded file (From Dropdown)
                                     $real_ids[TEXT_PREFIX . $HTTP_POST_VARS[uPLOAD_PREFIX . $i]] = $HTTP_POST_VARS[TEXT_PREFIX . UPLOAD_PREFIX . $i];
                                   }
                                 }
                               }
                               $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $real_ids)) + $HTTP_POST_VARS['cart_quantity'], $real_ids);
                             }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break;

 

I have no idea ... Maybe someone can help me?

 

Ibissen,

 

PS. Sorry for my English.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×