Jump to content

SharingDOODLES

Members
  • Content count

    23
  • Joined

  • Last visited

  1. SharingDOODLES

    contact us - Short Form with Captcha

    update: Does anyone know a good captcha that will work with oscommerce? any help would be appreciated
  2. Hello, I was wondering if someone could please help me with the Contact Us - Short Form with Captcha contribution, http://addons.oscommerce.com/info/4960 I have installed it and at first everything seemed fine, however the "security code" isnt showing up in the box with the image, (image is there but no code) I was wondering does anyone know what might be causing this? I have uncommented extension=php_gd2.dll in my php.ini file as it uses the GD libary but it dosent seem to make any differance. any help would be appreciated Paul
  3. SharingDOODLES

    PayPal express issue

    Hello can someone please help I have setup paypal express but when in the shopping cart if you click the paypal express checkout button it just redirects the user to the login page, I was assuming it should go straight to the paypal site, could someone please help??
  4. SharingDOODLES

    Offical Google Checkout module for osCommerce Support Thread

    you are a star, thank you, works as it should now, just got to do some re-styling again now lol I do have another issue i am trying to solve i have "free shipping by cats v1.5" installed and it works ok using any of the other payment systems appart from the googlecheckout, its still adding the normal shipping rather than making it free, I have searched the code and i am assuming is something to do with the following array, but justcant seem to get it working $mc_shipping_methods = array( 'usps' => array( 'domestic_types' => array( 'Express' => 'Express Mail', 'First Class' => 'First-Class Mail', 'Priority' => 'Priority Mail', 'Parcel' => 'Parcel Post' ), 'international_types' => array( 'GXG Document' => 'Global Express Guaranteed Document Service', 'GXG Non-Document' => 'Global Express Guaranteed Non-Document Service', 'Express' => 'Global Express Mail (EMS)', 'Priority Lg' => 'Global Priority Mail - Flat-rate Envelope (large)', 'Priority Sm' => 'Global Priority Mail - Flat-rate Envelope (small)', 'Priority Var' => 'Global Priority Mail - Variable Weight Envelope (single)', 'Airmail Letter' => 'Airmail Letter Post', 'Airmail Parcel' => 'Airmail Parcel Post', 'Surface Letter' => 'Economy (Surface) Letter Post', 'Surface Post' => 'Economy (Surface) Parcel Post' ), ), 'fedex1' => array( 'domestic_types' => array( '01' => 'Priority (by 10:30AM, later for rural)', '03' => '2 Day Air', '05' => 'Standard Overnight (by 3PM, later for rural)', '06' => 'First Overnight', '20' => 'Express Saver (3 Day)', '90' => 'Home Delivery', '92' => 'Ground Service' ), 'international_types' => array( '01' => 'International Priority (1-3 Days)', '03' => 'International Economy (4-5 Days)', '06' => 'International First', '90' => 'International Home Delivery', '92' => 'International Ground Service' ), ), 'upsxml' => array( 'domestic_types' => array( 'UPS Ground' => 'UPS Ground', 'UPS 3 Day Select' => 'UPS 3 Day Select', 'UPS 2nd Day Air A.M.' => 'UPS 2nd Day Air A.M.', 'UPS 2nd Day Air' => 'UPS 2nd Day Air', 'UPS Next Day Air Saver' => 'UPS Next Day Air Saver', 'UPS Next Day Air Early A.M.' => 'UPS Next Day Air Early A.M.', 'UPS Next Day Air' => 'UPS Next Day Air' ), 'international_types' => array( 'UPS Worldwide Expedited' => 'UPS Worldwide Expedited', 'UPS Saver' => 'UPS Saver' ), ), 'zones' => array( 'domestic_types' => array( 'zones' => 'Zones Rates' ), 'international_types' => array( 'zones' => 'Zones Rates intl' ), ), 'flat' => array( 'domestic_types' => array( 'flat' => 'Flat Rate Per Order' ), 'international_types' => array( 'flat' => 'Flat Rate Per Order intl' ), ), 'item' => array( 'domestic_types' => array( 'item' => 'Flat Rate Per Item' ), 'international_types' => array( ), ), 'itemint' => array( 'domestic_types' => array( ), 'international_types' => array( 'itemint' => 'Flat Rate Per Item intl' ), ), 'table' => array( 'domestic_types' => array( 'table' => 'Table' ), 'international_types' => array( 'table' => 'Table intl' ), ), ); $mc_shipping_methods_names = array( 'usps' => 'USPS', 'fedex1' => 'FedEx', 'upsxml' => 'Ups', 'zones' => 'Zones', 'flat' => 'Flat Rate', 'item' => 'Item', 'itemint' => 'Item Inter', 'table' => 'Table', ); anyone got any ideas??
  5. SharingDOODLES

    Offical Google Checkout module for osCommerce Support Thread

    Hello , I was wondering if someone could help me please, I have installed the google checkout and all went well, the only problem i have is with the button on the login.php page, when i choose googlecheckout from the login.php page the normal oscommerce warning comes up saying incorrect email/password match, rather than going to the google checkout website, it works fine from in the shopping cart, just not the login page, can someone please help Thx
  6. SharingDOODLES

    Attribute Sets Contribution

    Hello, I really like the contribution, however i have been trying to make a couple of simple changes but seem to be having trouble finding what i am looking for, I have loads of accessories but the prices can vary depending on the product, I have added attribute sets and then changed the price for each one depending on the product witch is fine, however if i update a product it will change all my prices for that product back to what ever its set as in the attributes set, So how would i go about stopping it from updating the price when i update a product, I know its just a sql statment somewhere that probably uses $_POST form data, but i just cant find it, Could someone please point me in the right direction, It would be much appreciated
  7. SharingDOODLES

    Option Type Feature v1.6 (for osc 2.2 MS2)

    Hello, I have been trying for a week now to get "attribute sets plus" to work with this contribution, The thing is i have got it all working appart from a small issue with the checkboxes, If i add a product option (even by default) eg, product options access -- set it as a checkbox, option values access -- rack1 access -- rack2 access -- rack3 This will only show the first one added to the product, for it to work i have to add them all to "product options", Is there a any way to make it work as above, Any help or support would be much appreciated
  8. SharingDOODLES

    options as images (checkbox)

    Hello Again, I know i am just missing something really simple, reward to anyone who solves it lol I have made lots of changes to make the new "case" statment like the original, Here is the original case statment case PRODUCTS_OPTIONS_TYPE_CHECKBOX: //CLR 030714 Add logic for checkboxes $products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); // START vFIX $boxchecked = false; if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $boxchecked = true; }else { $boxchecked = false; } // END vFIX ?> <div> <div class="attributes_1"> <div class="attributes_holder_1"> <h2> <?php echo $products_options_name['products_options_name'] . ':'; ?></h2> </div> <div class="attributes_foot_1"> <?PHP // START vFIX //echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']); echo '<p>' . tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id'], $boxchecked); // END vFIX echo $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { echo '<br />(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } echo '</p></div></div><div> '; break; Here is my new case statment case PRODUCTS_OPTIONS_TYPE_CHECKBOX: $products_options_query = tep_db_query("select distinct pov.products_options_values_id, products_options_id, options_values_id, products_options_values_thumbnail, products_options_comment, products_options_id, pov.products_options_values_name, pov.products_options_values_thumbnail, pa.options_values_price, pa.price_prefix from vikingonly_products_options, " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_attribs_array = tep_db_fetch_array($products_options_query)) { $boxchecked = false; if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $boxchecked = true; }else { $boxchecked = false; } ?> <div> <div class="attributes_1"> <div class="attributes_holder_1"> <h2> <?php echo $products_options_name['products_options_name'] . ':'; ?></h2> </div> <div class="attributes_foot_1"> <?PHP echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']); echo '<p>' . tep_draw_checkbox_field('id[' . $products_attribs_array['options_values_id'] . ']', $products_options_name['products_options_id'], $boxchecked); echo '' . tep_image(DIR_WS_IMAGES . 'options/' . $products_attribs_array['products_options_values_thumbnail']) . ''; echo $products_attribs_array['products_options_values_name']; if ($products_attribs_array['options_values_price'] != '0') { echo '<br />(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } echo '</p></div></div><div> '; } break; I have added 2 checkboxes echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']); echo '<p>' . tep_draw_checkbox_field('id[' . $products_attribs_array['options_values_id'] . ']', $products_options_name['products_options_id'], with the first one i get an output of the following with the value changing for each one and the id staying the same, <input type="checkbox" value="38" name="id[6]"/> With the second i get the following with the name id changing for each one witch is how the original option type contribution works (http://addons.oscommerce.com/info/160) <input type="checkbox" value="6" name="id[38]"/> if i tick the first of the 2 tickboxes it will pass the name and price of just one option, If i tick the second of the 2 tickboxes it passes them to the cart but with no name or price ajustment, I really am stuck on this, please can someone help,
  9. SharingDOODLES

    options as images (checkbox)

    this way round it adds all selected options but no name or extra cost echo '<p>' . tep_draw_checkbox_field('id[' . $opti_array['id'] . ']', '6', $boxchecked) . ' </div></div>'; this way round it adds only 1 but includs the name and extra cost echo '<p>' . tep_draw_checkbox_field('id[6]', $opti_array['id'], $boxchecked) . ' </div></div>'; so close but yet so far...
  10. SharingDOODLES

    options as images (checkbox)

    I am even willing to offer a small reward to anyone who can make it work, Right, little update, (incase anyone can help) as mentioned its something to do with the values being passed, The main part i have been concentrating on is the "checkbox" itself minor changes made compared to above post: echo '<p>' . tep_draw_checkbox_field('id[6]', $opti_array['id'], $boxchecked) . ' </div></div>'; if i set the "id" to a fixed "6" it will pass the first checkbox selected including extra cost and the options name, but only the first, (so its not looping properly i guess) so i now have the 2 values being passed but its only adding the one option, :angry: if i add the "products_options_id" to the top query in the "case" statment and then add it to the array below assigned to "id2" and then change the "select" box to the following it will only show "id" as 1: (again i guess not looping properly) echo '<p>' . tep_draw_checkbox_field('id[' . $opti_array['id2'] . ']', $opti_array['id'], $boxchecked) . ' </div></div>'; Please could someone lend a hand, please
  11. SharingDOODLES

    options as images (checkbox)

    It is something to do with the array it uses, I have checked the values that are passed by the checkboxes and i can get one of the values but not the other if you get what i mean, example: On my site that uses just the " option type http://addons.oscommerce.com/info/160 " the chack box it outputted like the following and for each checkbox the name changes but the value stays the same : <input type="checkbox" value="85" name="id[10]"/> with the extra break statment i get the following output, the name changes for each of the checkboxes, <input type="checkbox" name="id[40]"/> Right i know i need that value in there but i am really stuck as i have been trying various things to get it workin, Here is my case statment so far: case PRODUCTS_OPTIONS_TYPE_CHECKBOX: $products_options_query = tep_db_query("select distinct pov.products_options_values_id, pov.products_options_values_name, pov.products_options_values_thumbnail, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while($products_options_name = tep_db_fetch_array($products_options_query)){ $products_attribs_array[] = array('id' => $products_options_name['products_options_values_id'], 'text' => $products_options_name['products_options_values_name'], 'type' => $products_options_name['products_options_type'], 'thumbnail' => $products_options_name['products_options_values_thumbnail']); if ($products_attribs_array['options_values_price'] != '0') { $products_attribs_array[sizeof($products_attribs_array)-1]['text'] .= ' (' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_options_name['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'], $products_attribs_array['options_values_id'])) .') '; } } foreach ($products_attribs_array as $opti_array){ echo '<div class="attributes_1"> <div class="attributes_holder_1"> <h2>' . $opti_array['text'] . ' </h2> </div> <div class="attributes_foot_1">'; echo '' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail']) . ''; echo '<br />' . $opti_array['text'] . ''; echo '<p>' . tep_draw_checkbox_field('id[' . $opti_array['id'] . ']', $opti_array['products_options_id'], $boxchecked) . ' </div></div>'; } break;
  12. SharingDOODLES

    options as images (checkbox)

    Getting closer i think, This is an example of 1 of the break statments used, (option type http://addons.oscommerce.com/info/160) case PRODUCTS_OPTIONS_TYPE_CHECKBOX: //CLR 030714 Add logic for checkboxes $products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); // START vFIX $boxchecked = false; if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $boxchecked = true; }else { $boxchecked = false; } // END vFIX ?> <div> <div class="attributes_1"> <div class="attributes_holder_1"> <h2> <?php echo $products_options_name['products_options_name'] . ':'; ?></h2> </div> <div class="attributes_foot_1"> <?PHP // START vFIX //echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']); echo '<p>' . tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id'], $boxchecked); // END vFIX echo $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { echo '<br />(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } echo '</p></div></div><div> '; break; I have pulled appart the other contribution and tryed intergrating it into one of the break statments, Here is what i have so far: case PRODUCTS_OPTIONS_TYPE_CHECKBOX: $products_attribs_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pov.products_options_values_thumbnail, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while($products_options = tep_db_fetch_array($products_attribs_query)){ $products_attribs_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name'], 'type' => $products_options['products_options_type'], 'thumbnail' => $products_options['products_options_values_thumbnail']); if ($products_options['options_values_price'] != '0') { $products_attribs_array[sizeof($products_attribs_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } $boxchecked = false; if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $boxchecked = true; }else { $boxchecked = false; } foreach ($products_attribs_array as $opti_array){ echo '<div class="attributes_1"> <div class="attributes_holder_1"> <h2>' . $products_options_name['products_options_name'] . ' </h2> </div> <div class="attributes_foot_1">'; echo '' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail']) . ''; echo '<br />' . $opti_array['text'] . ''; echo '<p>' . tep_draw_checkbox_field('id[' . $opti_array['text'] . ']" value="' . $opti_array['id'], $boxchecked) . ' </div></div>'; } break; As it is i now: if i select a few attributes and go to checkout its showing the right amount of added attributes but with no name or price added Could someone please run over the code to see what i am missing please
  13. SharingDOODLES

    options as images (checkbox)

    sorry the first contribution should be option type http://addons.oscommerce.com/info/160 as i have already managed to intergrate the other one, Here is the switch statment that it uses $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by attribute_sort desc"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { //clr 030714 add case statement to check option type switch ($products_options_name['products_options_type']) { case PRODUCTS_OPTIONS_TYPE_TEXT: //CLR 030714 Add logic for text option $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); $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']; if ($products_attribs_array['options_values_price'] != '0') { $tmp_html .= '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')'; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_TEXTAREA: //CLR 030714 Add logic for text option $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); $tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" wrap="virtual" name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" rows=5 id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '"></textarea> <div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div> <script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?> <!-- DDB - 041031 - Form Field Progress Bar //--> <tr> <?php if ($products_attribs_array['options_values_price'] != '0') { ?> <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ' ' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')'; ?></td> <?php } else { ?> <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ')'; ?></td> <?php } ?> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_RADIO: //CLR 030714 Add logic for radio buttons $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)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'"); //$checked=true; // START vEDIT if(!isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])){ $no_value = true; } // END vEDIT while ($products_options_array = tep_db_fetch_array($products_options_query)) { // START vEDIT if ($products_options_array['products_options_values_id'] == $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']] || $no_value) { //echo 'true'; $checked = true; $no_value = false; } else { //echo 'false'; $checked = false; } // END vEDIT $tmp_html .= ''; $tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked); //$checked = false; $tmp_html .= $products_options_array['products_options_values_name']; $tmp_html .=$products_options_name['products_options_comment']; 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>'; ?> <div class="attributes_radio"> <div class="attributes_holder_radio"> <h2> <?php echo $products_options_name['products_options_name'] . ':'; ?></h2> </div> <div class="attributes_foot_radio"><br /><br /> <?php echo $tmp_html; ?><?PHP echo $products_options_name['products_options_comment']; ?></div><br /><br /> </div><?php break; case PRODUCTS_OPTIONS_TYPE_CHECKBOX_2: $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)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'"); //$checked=true; // START vEDIT if(!isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])){ $no_value = true; } // END vEDIT while ($products_options_array = tep_db_fetch_array($products_options_query)) { // START vEDIT if ($products_options_array['products_options_values_id'] == $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']] || $no_value) { //echo 'true'; $checked = true; $no_value = false; } else { //echo 'false'; $checked = false; } // END vEDIT $tmp_html .= ''; //$checked = false; $tmp_html .= $products_options_array['products_options_values_name']; $tmp_html .=$products_options_name['products_options_comment']; 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>'; //CLR 030714 Add logic for checkboxes $products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'order by options_id"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); // START vFIX $boxchecked = false; if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $boxchecked = true; }else { $boxchecked = false; } // END vFIX /////////////////////////////////////////////////////////// //////////////////////////////////////// ////////////////////////////// ////////////////// ///////// ////// ?> <div class="attributes_checkbox_2"> <div class="attributes_holder_checkbox_2"> <h2> <?php echo $products_options_name['products_options_name'] . ':'; ?></h2> </div> <div class="attributes_foot_checkbox_2"> <?PHP // START vFIX //echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']); echo '<p>' . tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id'], $boxchecked); // END vFIX echo $tmp_html; echo $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { echo '<br />(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } echo '</p></div></div></div><div style="clear:both"> </div>'; break; case PRODUCTS_OPTIONS_TYPE_CHECKBOX: //CLR 030714 Add logic for checkboxes $products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); // START vFIX $boxchecked = false; if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $boxchecked = true; }else { $boxchecked = false; } // END vFIX ?> <div> <div class="attributes_1"> <div class="attributes_holder_1"> <h2> <?php echo $products_options_name['products_options_name'] . ':'; ?></h2> </div> <div class="attributes_foot_1"> <?PHP // START vFIX //echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']); echo '<p>' . tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id'], $boxchecked); // END vFIX echo $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { echo '<br />(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } echo '</p></div></div><div> '; break; case PRODUCTS_OPTIONS_TYPE_LAYOUTS: //CLR 030714 Add logic for checkboxes $products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); // START vFIX $boxchecked = false; if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $boxchecked = true; }else { $boxchecked = false; } // END vFIX ?> <div> <div class="attributes_layouts_1"> <div class="attributes_holder_layouts_1"> <h2> <?php echo $products_options_name['products_options_name'] . ':'; ?></h2> </div> <div class="attributes_foot_layouts_1"> <?PHP // START vFIX //echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']); echo '<p>' . tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id'], $boxchecked); // END vFIX echo $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { echo '<br />(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } echo '</p></div></div><div> '; break; default: //clr 030714 default is select list //clr 030714 reset selected_attribute variable $selected_attribute = false; // EOF Option Type Feature $products_options_array = array(); // BOF Linkmatics attributes sets plus $products_options_query = tep_db_query(" SELECT pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix , pase.sort_order FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS . " pas2pa, " . TABLE_PRODUCTS_ATTRIBUTES_SETS . " pas, " . TABLE_PRODUCTS_ATTRIBUTES_SETS_ELEMENTS . " pase, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov WHERE pa.products_id = '" . (int)$_GET['products_id'] . "' AND pa.options_id = '" . $products_options_name['products_options_id'] . "' AND pas2pa.products_id = pa.products_id AND pas.products_attributes_sets_id = pas2pa.products_attributes_sets_id AND pas.products_options_id = pa.options_id AND pase.products_attributes_sets_id = pas.products_attributes_sets_id AND pase.options_values_id = pa.options_values_id AND pov.products_options_values_id = pa.options_values_id AND pov.language_id = '" . $languages_id . "' ORDER BY pase.sort_order, pa.options_values_id"); // >>>>> BOF Linkmatics attributes sets plus patch v1.01 if (tep_db_num_rows($products_options_query)== 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 , pa.options_values_id FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov WHERE pa.products_id = '" . (int)$_GET['products_id'] . "' AND pa.options_id = '" . $products_options_name['products_options_id'] . "' AND pov.products_options_values_id = pa.options_values_id AND pov.language_id = '" . $languages_id . "' ORDER BY pa.options_values_id"); } // <<<<< EOF Linkmatics attributes sets plus patch v1.01 // EOF Linkmatics attributes sets plus while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <div style="clear:both"> </div> <div class="attributes_dropdown"> <div class="attributes_holder_dropdown"> <h2> <?php echo $products_options_name['products_options_name'] . ':'; ?></h2> </div> <div class="attributes_foot_dropdown"><?php // BOF Option Type Feature //echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . $products_options_name['products_options_comment']; echo $value_name[products_options_values_image]; // EOF Option Type Feature ?></div></div><div style="clear:both"> </div> <?php // BOF Option Type Feature } // ends the switch clause // EOF Option Type Feature } it just uses a switch statment but i cant manage to get it working in with "options as images" would really appreciate some help, even if its just a case of making the checkboxes work in the "options as images" as at the moment it uses radio buttons
  14. SharingDOODLES

    options as images (checkbox)

    Hello , I will do my best to explain my situation, I have installed the following contribution as i needed checkboxes for my attributes, attributes sets plus http://www.oscommerce.com/community/contributions,3610 Now to make life easyer i have also installed this contribution options as images http://www.oscommerce.com/community/contributions,1467 However no i have a small issue, By defauly the options as images uses a radio button but i need checkboxes, so i changed the bit of code to give me checkboxes but the problem is when i add some to my basket it only adds 1 and not all that iv selected, if you get what i mean, so i have tried combining the 2 contributions as the "attributes sets pllus" just uses a "switch" statpment but i am really beginning to loose the plot, here is the original "options as images" $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <table border="0" cellspacing="0" cellpadding="2"> <tr> <?php echo '<td class="main" colspan="2">' . TEXT_PRODUCT_OPTIONS . '<br>Please select your desired option using the buttons provided'; ?> <?php if (OPTIONS_IMAGES_CLICK_ENLARGE == 'true') echo '<br>Click the images to enlarge';?> </td> </tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_images_enabled from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pov.products_options_values_thumbnail, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while($products_options = tep_db_fetch_array($products_options_query)){ $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name'], 'thumbnail' => $products_options['products_options_values_thumbnail']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <tr> <td class="main" valign="top"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <?php if ($products_options_name['products_options_images_enabled'] == 'false'){ echo '<td class="main">' . tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . '</td></tr>'; } else { $count=0; echo '<td class="main"><table><tr>'; foreach ($products_options_array as $opti_array){ echo '<td><table cellspacing="1" cellpadding="0" border="0">'; if (OPTIONS_IMAGES_CLICK_ENLARGE == 'true') echo '<td align="center"><a href="java script:popupWindow(\'' . tep_href_link(FILENAME_OPTIONS_IMAGES_POPUP, 'oID=' . $opti_array['id']) .'\')">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT) . '</a></td></tr>'; else echo '<tr><td align="center">' . tep_image(DIR_WS_IMAGES . 'options/' . $opti_array['thumbnail'], $opti_array['text'], OPTIONS_IMAGES_WIDTH, OPTIONS_IMAGES_HEIGHT) . '</td></tr>'; echo '<tr><td class="main" align="center">' . $opti_array['text'] . '</td></tr>'; echo '<tr><td align="center"><input type="checkbox" name ="id[' . $products_options_name['products_options_id'] . ']" value="' . $opti_array['id'] . '" checked></td></tr></table></td>'; $count++; if ($count%OPTIONS_IMAGES_NUMBER_PER_ROW == 0) { echo '</tr><tr>'; $count = 0; } } echo '</table>'; } ?> </td></tr> <?php } ?> </table> <?php } ?> Does anyone know How i would go about making them checkboxes that work when added to the cart? If you need more info then please let me know
  15. SharingDOODLES

    Product Attributes - Option Type Feature v1.3

    Hello, First of all, well done on the contribution, it works a treat, But can i just ask a question please, The comment is restricted to 32 but i was wondering how i go about increasing it, i have changed it in the database but it dont seem to make no differance, If you could please shed some light it would be much appreciated
×