Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

doon1947

Members
  • Content count

    72
  • Joined

  • Last visited

Everything posted by doon1947

  1. doon1947

    [Contribution] Option Types v2

    Hi, This is an attempt to give back to the community with regard to the Option Types coptribution I have a successful OSC site running 2.2m.s2 with Option Types 2.1.3 running and extensively modified. Lots of folks on the OSC Forum have advised me to upgrade to a newer version of OSC for better security and to avoid site failure when PHP is upgraded. I was unsure about this as Option Types is a “must have” contribution for my site. I was advised by the community not to try to upgrade 2,2ms2 but to staet with a fresh copy of OSC. This I have done using OSC 2.3.1 as Option Types it has been modified by Dunweb to run on OSC 2.3.1 I installed OSC 2.3.1 in a clean directory on a spare domain name, this went with a hitch. I then installed Option Types 2.3.1 by uploading all the “drop-on-top files” with the exception of Includes/configure and Admin/includes/configure Which have to be modified for the DB variables. Installing Option Types 2.3.1 was successful as far as I could tell at this stage I then set about importing the data from my existing 2.2ms2 live site I did this by making a “MySQL dump of the database which provides a long SQL script which can be used to modify the OSC 2.3.1 database. I used HeidiSQL for this, but I am sure you can use PHPMyAdmin or Putty/MySQL I imported the new data table by table Categories, categories_description, products, products_description, products_tO_categories, etc, it is fairly obvious what tables are necessaro to get your products on to the new site Everything went well and the products from my old site displayed on the new site as expected. First problem: all option types defaulted to “select” (drop down menus). This turned out to be missing data in includes/configure.php. Option types needs to have the option types defined, select, radio, text, textarea, etc. Here is the code which needs to appear in includes/configure.php: define('OPTIONS_TYPE_SELECT', 0); define('OPTIONS_TYPE_TEXT', 1); define('OPTIONS_TYPE_TEXTAREA', 2); define('OPTIONS_TYPE_RADIO', 3); define('OPTIONS_TYPE_CHECKBOX', 4); define('OPTIONS_TYPE_FILE', 5); define('OPTIONS_TYPE_IMAGE', 6); define('TEXT_PREFIX', 'txt_'); define('UPLOAD_PREFIX', 'upload_'); define('TEXT_UPLOAD_NAME', 'CUSTOMER-INPUT'); define('OPTIONS_VALUE_TEXT_ID', 0); this can be place anywhere before the ?> at the end of the file Second problem: any product which featured a “textarea” or “text” option, when you click “add to cart” failed to put anything in the shopping cart. Don’t know the background to this problem but the cure is to overwrite includes/classes/shopping_cart.php with the same file from Option types 2.1.3 the original Zappo contribution. I still have to test the “checkout” and payment (Paypal) and other features on the new site, and change the appearance. At a later date with attempt to upgrade to OSC 2.3.4 or whatever is the latest. Hope this info is of help to others. Thanks to Dunweb for Option Types 2.3.1.
  2. Hi, I have a store running 2.2-MS2. Is ot_discount_coupon_codes_3_34 compatible.
  3. doon1947

    [Contribution] Option Types v2

    I'm using 2.1.3 I have all my options and attributes with a "sort_order" When I put a product with several attributes into the cart, the attributes appear in the correct sort order. However if I go to "checkout" but then return to the cart, the attributes have lost their sort_order There is a similar problem in Admin in packing_slip invoice Anyone know how to keep the attribute order consistently correct.
  4. doon1947

    [Contribution] Option Types v2

    Are you using the Paypal IPN module, if so it will produce the CUSTOMER-INPUT error --------------- I'm using Option Types 2.1.3 and solved the problem as follows: Integrating with other Contributions (Paypal IPN) from Paypal IPN v2.3.3 install_guide_READ_ME.html Note: Rule of thumb - whenever you make ANY change to checkout_process.php you MUST manually merge the change into paypal_ipn.php and ipn.php The PayPal IPN works different from other payment modules and bypasses the checkout_process file. Which means that any contribution which modifies the checkout_process.php file will require some manual coding TLC in paypal_ipn.php and ipn.php. From version 1.3 of this module, the PayPal IPN Payment Module is compatible with the Register Globals Patch v1.4 - you do not need to make any modifications for this. Version 2.0 introduces a new code base so any fixes posted for versions 1.x probably won't work without modification. --------------------- I had to modify /includes/modules/payment/paypal_ipn.php At line 249 (a single line change only) to match change in checkout_process.php line 230 which was changed by Option Types 2.1.3 contribution. as follows: $sql_data_array = array('orders_id' => $insert_id, 'orders_products_id' => $order_products_id, 'products_options' => $attributes_values['products_options_name'], // BOF - Zappo - Option Types v2 - ONE LINE - Update insert query. changed to use value from $order->products. 'products_options_values' => $order->products[$i]['attributes'][$j]['value'], // EOF change added by ADM 'options_values_price' => $attributes_values['options_values_price'], 'price_prefix' => $attributes_values['price_prefix']);
  5. doon1947

    [Contribution] Option Types v2

    I have installed Option Types 2.3.1 but when I go to Admin -> Products Attributes, in the Product Options area the table headings are not loaded and the columns show "error"
  6. doon1947

    [Contribution] Option Types v2

    I have an unmodified version of OSC 2.3.1 installed and working. I want to add Option Types 2.3.1 but do not understand the limited instructions. There is an install.txt file which shows how to modify the exisiting OSC files, that I understand, but what are the files in the directory "Drop-on-Top-files" for. What do I do with them
  7. doon1947

    [Contribution] Option Types v2

    Adding to the above two posts: I now have the "Checkbox options displayed correctly, see: http://always-with-me.com/product_info.php?cPath=21&products_id=1006 However if I check more than one option, only the last checked option appears in the shopping cart. The cost of the added single option does appear in the cart total. Help.
  8. doon1947

    [Contribution] Option Types v2

    Code for question above: <?php /* $Id: option_types.php 2009-06-01 $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2009 AvanOsch for http://shop.crystalcopy.nl Released under the GNU General Public License */ // - Zappo - Option Types v2 - Use some easy shorter names for products_options_name values $Default = false; // Set this value to true if current option is Default (drowpdown) (see below) $ProdOpt_ID = $products_options_name['products_options_id']; $ProdOpt_Name = $products_options_name['products_options_name']; $ProdOpt_Comment = $products_options_name['products_options_comment']; $ProdOpt_Length = $products_options_name['products_options_length']; $products_attribs_query = tep_db_query("select distinct options_values_id, options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int)tep_db_input($product_info['products_id']) . "' and options_id = '" . $ProdOpt_ID . "' order by products_options_sort_order"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); // Get Price for Option Values (Except for Multi-Options (Like Dropdown and Radio)) if ($products_attribs_array['options_values_price'] != '0') { $tmp_html_price = ' (' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } else { $tmp_html_price = ''; } switch ($products_options_name['products_options_type']) { case OPTIONS_TYPE_TEXT: $tmp_html = '<input type="text" name="id[' . TEXT_PREFIX . $ProdOpt_ID . ']" id="id[' . TEXT_PREFIX . $ProdOpt_ID . ']" size="' . $ProdOpt_Length .'" maxlength="' . $ProdOpt_Length . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$ProdOpt_ID] .'"'; if (OPTIONS_TYPE_PROGRESS == 'Text' || OPTIONS_TYPE_PROGRESS == 'Both') { $tmp_html .= 'onKeyDown="textCounter(this,\'progressbar_'. $ProdOpt_ID . '\',' . $ProdOpt_Length . ')" onKeyUp="textCounter(this,\'progressbar_'. $ProdOpt_ID . '\',' . $ProdOpt_Length . ')" onFocus="textCounter(this,\'progressbar_'. $ProdOpt_ID . '\',' . $ProdOpt_Length . ')"> ' . $ProdOpt_Comment . $tmp_html_price . '<div id="counterbar_'. $ProdOpt_ID . '" class="bar"><div id="progressbar_'. $ProdOpt_ID . '" class="progress"></div></div> <script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $ProdOpt_ID . ']"),"progressbar_' . $ProdOpt_ID . '",' . $ProdOpt_Length . ',"counterbar_'. $ProdOpt_ID . '")</script>'; } else { $tmp_html .= '>' . $ProdOpt_Comment . $tmp_html_price; } ?> <tr> <td class="main"><?php echo $ProdOpt_Name . ' :'; ?></td> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case OPTIONS_TYPE_TEXTAREA: $tmp_html = '<textarea wrap="soft" rows="5" name="id[' . TEXT_PREFIX . $ProdOpt_ID . ']" id="id[' . TEXT_PREFIX . $ProdOpt_ID . ']"'; if (OPTIONS_TYPE_PROGRESS == 'TextArea' || OPTIONS_TYPE_PROGRESS == 'Both') { $tmp_html .= 'onKeyDown="textCounter(this,\'progressbar_'. $ProdOpt_ID . '\',' . $ProdOpt_Length . ')" onKeyUp="textCounter(this,\'progressbar_'. $ProdOpt_ID . '\',' . $ProdOpt_Length . ')" onFocus="textCounter(this,\'progressbar_'. $ProdOpt_ID . '\',' . $ProdOpt_Length . ')">' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$ProdOpt_ID] . '</textarea> <div id="counterbar_'. $ProdOpt_ID . '" class="bar"><div id="progressbar_'. $ProdOpt_ID . '" class="progress"></div></div> <script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $ProdOpt_ID . ']"),"progressbar_' . $ProdOpt_ID . '",' . $ProdOpt_Length . ',"counterbar_'. $ProdOpt_ID . '")</script>'; } else { $tmp_html .= '>' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$ProdOpt_ID] . '</textarea>'; } ?> <tr> <td class="main" colspan="2"><b><?php echo $ProdOpt_Name . ' :</b><br>' . $ProdOpt_Comment . ' ' . $tmp_html_price; ?></b></td> </tr> <tr> <td class="main" colspan="2"><?php echo $tmp_html; ?></td> </tr> <?php break; case OPTIONS_TYPE_RADIO: $tmp_html = '<table>'; $products_options_query = 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 = '" . (int)$product_info['products_id'] . "' and pa.options_id = '" . $ProdOpt_ID . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "' order by pa.products_options_sort_order"); while ($products_options_array = tep_db_fetch_array($products_options_query)) { if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$ProdOpt_ID]) && ($products_options_array['products_options_values_id'] == $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$ProdOpt_ID])) { $checked = true; } else { $checked = false; } $tmp_html .= '<tr><td class="main">'; $tmp_html .= tep_draw_radio_field('id[' . $ProdOpt_ID . ']', $products_options_array['products_options_values_id'], $checked); $tmp_html .= $products_options_array['products_options_values_name']; if ($products_options_array['options_values_price'] != '0') { $tmp_html .= ' (' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } $tmp_html .= '</tr></td>'; } $tmp_html .= '</table>'; ?> <tr> <td class="main"><?php echo $ProdOpt_Name . ' :<br><small>' . $ProdOpt_Comment . '</small>'; ?></td> <td class="main"><?php echo $tmp_html; ?> <!--- ADM hack begin ------------------------------------------------------------> <td class="main"> <script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link('selection_popup_image.php', 'selection_image_ID=' . $products_options_name['products_options_selection_image']) . '\\\')">' . '<b>' . $products_options_name['products_options_selection_text'] . '</b>' . '</a>'; ?>'); //--></script> </td> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '15'); ?></td> </tr> </tr> <tr> <td><?php echo tep_draw_separator('pixel_silver.gif', '400%', '1'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '15'); ?></td> </tr> <!--- ADM hack end ---------------------------------------------------------------> </tr> <?php break; case OPTIONS_TYPE_CHECKBOX: if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$ProdOpt_ID])) { $checked = true; } else { $checked = false; } $tmp_html = tep_draw_checkbox_field('id[' . $ProdOpt_ID . ']', $products_attribs_array['options_values_id'], $checked) . ' '; $tmp_html .= $ProdOpt_Comment ; $tmp_html .= $tmp_html_price; ?> <tr> <td class="main"><?php echo $ProdOpt_Name . ' :'; ?></td> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case OPTIONS_TYPE_FILE: $number_of_uploads++; //BOF - Zappo - Option Types v2 - Added dropdown with previously uploaded files if ($old_uploads == true) unset($uploaded_array); $uploaded_array[] = array('id' => '', 'text' => TEXT_NONE); $uploaded_files_query = tep_db_query("select files_uploaded_name from " . TABLE_FILES_UPLOADED . " where sesskey = '" . tep_session_id() . "' or customers_id = '" . (int)$customer_id . "'"); while ($uploaded_files = tep_db_fetch_array($uploaded_files_query)) { $uploaded_array[] = array('id' => $uploaded_files['files_uploaded_name'], 'text' => $uploaded_files['files_uploaded_name'] . ($tmp_html_price ? ' - ' . $tmp_html_price : '')); $old_uploads = true; } $tmp_html = '<input type="file" name="id[' . TEXT_PREFIX . $ProdOpt_ID . ']">' . // File field with new upload tep_draw_hidden_field(UPLOAD_PREFIX . $number_of_uploads, $ProdOpt_ID); // Hidden field with number of this upload (for this product) $tmp_html .= $tmp_html_price; if ($old_uploads == true) $tmp_html .= '<br>' . tep_draw_pull_down_menu(TEXT_PREFIX . UPLOAD_PREFIX . $number_of_uploads, $uploaded_array, $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$ProdOpt_ID]); //EOF - Zappo - Option Types v2 - Added dropdown with previously uploaded files ?> <tr> <td class="main"><?php echo $ProdOpt_Name . ' :' . (($old_uploads == true) ? '<br>' . TEXT_PREV_UPLOADS . ': ' : ''); ?></td> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; //BOF - Zappo - Added Image Selector Option case OPTIONS_TYPE_IMAGE: $Image_Opticount_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int)$product_info['products_id'] . "' and options_id ='" . (int)$ProdOpt_ID . "'"); $Image_Opticount = tep_db_fetch_array($Image_Opticount_query); $Image_displayed = 0; $products_options_query = 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 = '" . (int)$product_info['products_id'] . "' and pa.options_id = '" . (int)$ProdOpt_ID . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pa.products_options_sort_order"); while ($products_options = tep_db_fetch_array($products_options_query)) { $pOptValName = $products_options['products_options_values_name']; $Image_displayed++; if ($products_options['options_values_price'] != '0') { $option_price = ' (' . $products_options['price_prefix'] . ' ' . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } else { $option_price = ''; } $Image_Dropdown_ID = 'id[' . $ProdOpt_ID . ']'; $Image_Name = (OPTIONS_TYPE_IMAGENAME == 'Name') ? $products_options['products_options_values_name'] : $products_options['products_options_values_id']; $Real_Image_Name = OPTIONS_TYPE_IMAGEPREFIX . $Image_Name . ((OPTIONS_TYPE_IMAGELANG == 'Yes') ? '_'.$languages_id : '') . '.jpg'; if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$ProdOpt_ID]) && ($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$ProdOpt_ID] == $products_options['products_options_values_id'])) { $Image_Dropdown[$product_info['products_id']] .= '<option value="' . $products_options['products_options_values_id'] . '" SELECTED>' . $pOptValName . $option_price . '</option>'; $First_ImageText[$product_info['products_id']] = '<img src="' . OPTIONS_TYPE_IMAGEDIR . $Real_Image_Name . '" alt="'.$pOptValName.'" title="'.$pOptValName.'">'; $ImageText[$product_info['products_id']] .= '"<img src=\"' . OPTIONS_TYPE_IMAGEDIR . $Real_Image_Name . '\" alt=\"'.$pOptValName.'\" title=\"'.$pOptValName.'\">"'; } else { $Image_Dropdown[$product_info['products_id']] .= '<option value="' . $products_options['products_options_values_id'] . '">' . $pOptValName . $option_price . '</option>'; $ImageText[$product_info['products_id']] .= '"<img src=\"' . OPTIONS_TYPE_IMAGEDIR . $Real_Image_Name . '\" alt=\"'.$pOptValName.'\" title=\"'.$pOptValName.'\">"'; if ($First_ImageText[$product_info['products_id']] == '' && $Image_displayed == 1) $First_ImageText[$product_info['products_id']] = '<img src="' . OPTIONS_TYPE_IMAGEDIR . $Real_Image_Name . '" alt="'.$pOptValName.'" title="'.$pOptValName.'">'; } // BOF - Zappo - PreLoad the Images if ($Image_displayed == 1) echo '<div id="ImagePreload">'; echo '<img src="' . OPTIONS_TYPE_IMAGEDIR . $Real_Image_Name . '" alt="'.$pOptValName.'" title="'.$pOptValName.'">'; if ($Image_displayed != $Image_Opticount['total']) { $ImageText[$product_info['products_id']] .= ','; } else { // - Zappo - PreLoad the Images - Close Div... echo '</div>'; } // EOF - Zappo - PreLoad the Images } $ImageSelector_Name = $ProdOpt_Name . ': <script language="JavaScript" type="text/JavaScript">var ImageText'.$product_info['products_id'] . ' = new Array(' . $ImageText[$product_info['products_id']] . ')</script>'; $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; ?> <tr> <td class="main"><?php echo $ImageSelector_Name; ?></td> <td class="main"><?php echo $ImageSelector_Dropdown; ?></td> </tr> <tr> <td width="100%" class="main" colspan="2"> <center><?php echo '<div class="main" id="ImageSelect' . $product_info['products_id'] . '">' . $First_ImageText[$product_info['products_id']] . '</div>';?></center> </td> </tr> <?php break; //EOF - Zappo - Added Image Selector Option default: $Default = true; // Set this value to check if current option is Default (drowpdown) // - Zappo - Option Types v2 - Default action is (standard) dropdown list. If something is not correctly set, we should always fall back to the standard. } ?>
  9. doon1947

    [Contribution] Option Types v2

    I have Option Types 2.1.3 up and running. It works fine with Select, Text and Radio, but fails with Checkbox, See here: http://always-with-me.com/product_info.php?cPath=21&products_id=1006 The option that fails "Charms" comes up OK if I change it to Select or Radio I using 2.2ms2 PHP 5.3 MySql 3.23.54 Can anyone help.
  10. doon1947

    Paypal module does not send emails

    Hi, Version 2.2ms2 I have had OSCommerce working for over a year on several sites. I have used the Credit Card and authorize.net payment modules successfully on these sites. Have just set up a new site to use the Paypal payment module. When I test the site it fills the shopping cart, proceeds to payment, shows Paypal as a payment option, takes me to the Paypal site, I make a payment with a credit card, Paypal confirms the payment has been made, and I am shown a button "Return to Merchant Site". When I press this button I am taken back to my site and asked to login. Problem: No order is entered into the database No confirmation of the order is sent to the customer No notification of the order is sent to the store owner Questions: 1) When should the order be entered in the database, as customer proceeds to Paypal or after Paypal payment is made 2) When should the emails be sent, as customer proceeds to Paypal or after Paypal payment is made Anybody know what might be the problem. Al Moodie
  11. doon1947

    Paypal module does not send emails

    Solved this problem. In "/includes/configure.php" "define('HTTPS_COOKIE_DOMAIN', 'www.xxx.com'); was not set correctly. As a result the Cookie was not read on return from Paypal, the order details were not found, so: No order is entered into the database No confirmation of the order is sent to the customer No notification of the order is sent to the store owner Al Moodie.
×