Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Getting Option Types 2.3.1 to work with v2.3.3


HowardR

Recommended Posts

Posted

I just set up my v2.3.3 store, and I very much appreciate the help that I found on this forum. I am posting this in hopes of giving something back.

 

My store requires that customers enter lots of text inputs, so I had to install the May 19 2012 version of the Option Types 2.3.1 add-on. This add-on is great, but it's not yet fully adapted for OSCommerce 2.3.3. Hopefully, an update will be posted soon.

 

In the meantime, I would like to share how I got the display to work in product_info.php. The instructions which came with the addon appeared to be designed for the table layout of OSCommerce v2.2 not the divs layout of v.2.3. I spent hours, but I finally got it to look right in my store. There may still be some bugs -- I am not using everything that Option Types can do. But it appears to work fine in my store.

 

In order to get the appearance right, I had to change the key file which came with the addon: catalog/includes/modules/option_types.php by adding in a <p><table> command proceeding each <tr> command and a </table> command following each </tr> command:

 

<p><table><tr>

<td class="main"><?php echo $ProdOpt_Name . ' :'; ?></td>

<td class="main"><?php echo $tmp_html; ?></td>

</tr></table> <?php

 

But my main difficulties were with updating the product_info.php file. Attached you will find my working version.

 

I hope this saves someone else a few hours.

 

Howard

product_info.php

Posted

I wish I had clicked on "history" for Option Types 2.3.1 before I did all my work! Apparently, security_man did the same work that I did, and probably did it better. Then he posted a download under "history" right under the Option Types 2.3.1 addon page! I never even thought to click on that link.

 

The lesson I just learned is that you should carefully read *all* of the tabs on the add-ons page before you install that add-on!

 

You can find security_man's download if you go to the following URL:

 

http://addons.oscommerce.com/info/8193

Posted

Actually, I'm not sure what security_man posted. He says: " I had to compare several files to the original option types contrib by zappo (which i have uploaded here because i cannot find it anywhere online)."

 

So, actually, he may have simply posted the "original option types" contrib by zappo, not his fixes.

Posted

Hi Howard ,

 

Yeah it is not really very clear had a look yesterday again.

 

Part of the install text refers to older versions of osc the most important thing is the

 

/includes/classes/shopping_cart.php

 

I had to use the older version from zappo

 

So basically DunWeb

 

http://addons.oscommerce.com/info/8193

 

is great work it is a complicated add on it still needs a bit of tweaking but the information is there on the forums to get it to work

 

Regards

 

Joli

To improve is to change; to be perfect is to change often.

 

  • 2 months later...
Posted

Hi Howard

Hi Joli

 

I am not having much luck with this - done lots of reading but for a novice, all not so clear. Perhaps a few words from you, or other experienced users may help me out!

 

I am wanting to create a site, brand new, that is

1. easy to create multi-lingual site and 2. customers must be able to input data/text etc. Hence interest in osc 2.3.3.

 

Starting with the language - have tested the installation and have no problems to create the second language (German).

 

Tried to then overlay the Options Type v2.3.1 - no luck. Figured, do one test at a time - leave the second language aside.

 

Back to a clean osc 2.3.3

 

I have performed the following steps (variations the original DunWEb as well as the 19 May 20012 versions):

1. delete existing db

2. install osc 2.3.3 (able to access both the Admin Tool and see the website catalog online)

3. run Optins Types2 sql file into db (able to access both the Admin Tool and see the Option Types menu and see the website catalog online)

4. drop all the files and create the folders from the Add-on

and then...now what happens........no access to either Admin Tool and no longer able to access the website catalog online.

 

Any ideas what I have done wrong or what I am not understanding?

Thanks,

K

PS: never posted before - hope this is OK!

  • 11 months later...
Posted

Not sure what's up, but the install text on the Options Type install isn't formatted correctly. It has a bunch of slashes all through the instructions which makes it impossible to make anything of.

 

The file I'm struggling with updating is includes/application_top.php.

 

I'm currently running OSC 2.3.3.

 

Does anyone have a successfully modified file, or instructions on modifying it?

 

Thanks,

Posted

Yes I have a new file for 2.3.3.4 set that works and a nearly finished install text.

 

I need a few beta testers as there have been a few modification made to the original code and a lot of changes made as regards styling

 

PM me for a file link I do not want to upload to the addons area until completely finished and well tested

 

simply reason being the old 2.3 .... one was such a mess and had a lot of bugs

 

If your shop is new simply drop the files on top if you have modified the shop

you will have to check again all files or do a compare with something like win merge

 

regards

Joli

To improve is to change; to be perfect is to change often.

 

Posted

Not sure what's up, but the install text on the Options Type install isn't formatted correctly. It has a bunch of slashes all through the instructions which makes it impossible to make anything of.

 

The file I'm struggling with updating is includes/application_top.php.

 

I'm currently running OSC 2.3.3.

 

Does anyone have a successfully modified file, or instructions on modifying it?

 

Thanks,

 

You can open the old install with word pad

 

***FIND***
Approx line 28
// include server parameters
 require('includes/configure.php');

*** BELOW ADD ***
//BOF - Zappo - Option Types v2 - Joli Moved configure to separate file
include('includes/configure_options.php');
//EOF - Zappo - Option Types v2 - Joli Moved configure to separate file

***FIND***
Approx line 301
 $navigation->add_current_page();
// action recorder
 include('includes/classes/action_recorder.php');

*** BELOW ADD ***
//BOF - Zappo - Option Types v2 - Moved infobox and messageStack here from below
// infobox
 require(DIR_WS_CLASSES . 'boxes.php');
// initialize the message stack for output messages
 require(DIR_WS_CLASSES . 'message_stack.php');
 $messageStack = new messageStack;
//EOF - Zappo - Option Types v2 - Moved infobox and messageStack here from below

***FIND***
Approx line 346
	  case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

						    $attributes = isset($HTTP_POST_VARS['id']) ? $HTTP_POST_VARS['id'] : '';
						    $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $attributes))+1, $attributes);
						 }
    *** REPLACE WITH ***
//BOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir
						   case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
	  $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.
   //JOHN NOT SURE
    $attributes = isset($HTTP_POST_VARS['id']) ? $HTTP_POST_VARS['id'] : '';
						    $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $real_ids))+1, $real_ids);
						    }
***FIND***
Approx line 489
// infobox
 require(DIR_WS_CLASSES . 'boxes.php');  
*** REPLACE WITH ***
//BOF - Zappo - Option Types v2 - ONE LINE - infobox moved up from here... 
***FIND***
Approx line 548
// initialize the message stack for output messages
 require(DIR_WS_CLASSES . 'message_stack.php');
 $messageStack = new messageStack;

 *** REPLACE WITH ***

 //BOF - Zappo - Option Types v2 - ONE LINE - message stack moved up from here...


***********

To improve is to change; to be perfect is to change often.

 

  • 9 months later...
Posted

Hi Joli.

 

I know this is an old thread but do you still have the working 2.3.3 file available for this mod.

I am trying to install it on a 2.3.4 store, and have been using the Dunweb version from 2012. Quite pleased that I have got the product_info file working so a customer can add text on the product page but cannot seem to get the text sent through to the shopping cart when a customer puts an item with text in to their cart.

Hope you can help.

 

Andy

Archived

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

×
×
  • Create New...