Jump to content

Chandra

Members
  • Content count

    18
  • Joined

  • Last visited

  • Days Won

    1

Chandra last won the day on April 2 2010

Chandra had the most liked content!

2 Followers

Profile Information

  1. Hi Jeroen, To have the option prices display correctly when tax is included in the price display, you'll need to update your product_info.php. Search for $product_info_values['products_tax_class_id'] and replace it with tep_get_tax_rate($product_info['products_tax_class_id']) You should find and replace three occurences - one for text options, one for radio buttons, and one for checkboxes. Cheers, Chandra http://www.OpenStoreSolutions.com
  2. On the question about how to add comments... Currently you have to do this in the database directly (i.e. there is no user interface tool for doing it). Find the row with your Option in the products_options table and add your comment in the products_options_comment field.
  3. Maureen, You can display images next to radio buttons with the Option Type Feature. If this is all you need, then you don't need to make any code changes at all. For radio options where you want an image displayed just set the Option Value to <img src=images/image_name.gif>. There are a couple important things to note though: 1. The option value is limited to 32 characters, so if you have long image names then you?ll have problems. 2. Having quotes around the src value (for example src=?images/image_name.gif?) causes problems, so you can?t use quotes. This means there can?t be any spaces in the src value (i.e no spaces in your image names). 3. The <img src=images/image_name.gif> will be displayed in the email, so if you don?t use html emails this will look strange. I'll add an example product to the demo catalog, so check http://www.OpenStoreSolutions.com/option_t...ontribution.php later today for an example. Cheers, Chandra http://www.OpenStoreSolutions.com
  4. Just an fyi that I started a new thread at http://forums.oscommerce.com/viewtopic.php?t=57259 to discuss v1.6 of the Option Type Feature contribution. Cheers, Chandra http://www.OpenStoreSolutions.com
  5. I just posted Version 1.6 of the Product Attributes - Option Type Feature. You can find it at. http://www.oscommerce.com/community/contributions,160 The purpose of this contribution is to allow the use of various option types when setting up product attributes. Originally the contribution included support for Text options. It now also includes support for Radio Buttons and Checkboxes. This page includes a link to a demo store using the contribution http://www.OpenStoreSolutions.com/option_t...ontribution.php Version 1.6 of the contribution is built for osc 2.2 Milestone 2. Cheers, -Chandra http://www.OpenStoreSolutions.com
  6. Here's the jist of what the checkbox and radio button cases should look like. I'm going to be out of pocket for the next week or so. I'll finish the still to do list and update the official version of the contribution after I get back. Still to do: + Select a radio button by default + Correctly select/check radio button or checkbox when click product link from shopping cart. + Adjust layout of radio buttons -Chandra case PRODUCTS_OPTIONS_TYPE_CHECKBOX: //CLR 2003-03-18 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); echo '<tr><td class="main">' . $products_options_name['products_options_name'] . ': </td><td class="main">'; echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']); echo $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], $product_info_values['products_tax_class_id']) .') '; } echo '</td></tr>'; break; case PRODUCTS_OPTIONS_TYPE_RADIO: //CLR 2003-03-18 Add logic for radio buttons echo '<tr><td class="main">' . $products_options_name['products_options_name'] . ': </td><td class="main">'; $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 . "'"); while ($products_options_array = tep_db_fetch_array($products_options_query)) { echo tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id']); echo $products_options_array['products_options_values_name']; echo $products_options_name['products_options_comment']; if ($products_options_array['options_values_price'] != '0') { echo '(' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], $product_info_values['products_tax_class_id']) .') '; } } echo '</td></tr>'; break;
  7. I completely agree that this contribution needs radio buttons and checkboxes! I've been meaning to add them since the beginning. And the thing is, it should be so simple that I don't have much of an excuse for not doing it. Here's what I think needs to be done: 1. In catalogincludesconfigure.php Add new defintions: define('PRODUCTS_OPTIONS_TYPE_RADIO', 2); define('PRODUCTS_OPTIONS_TYPE_CHECKBOX', 3); 2. In catalogproduct_info.php There's an if statment that checks the option type. Change this to a case statement and add the handling for radio buttons and checkboxes. As long as the same naming convention as select lists is used, then all the backend processing should work. 3. In adminproducts_attributes.php Update the functions draw_option_type_pulldown() and translate_type_to_name() to include the new option types. I'll try to get this added to the contribution sometime next month, but feel free to take a crack at it before then. -Chandra
  8. Version 1.4 of the Product Attributes - Option Type Feature is now available. http://www.oscommerce.com/community/contributions,160 Version 1.4 upgrades the contribution to the osc 2.2 ms1 code base, provides for the first time a user interface for updating the option type of an option, and fixes a nasty bug that occurs when an end user enters special characters (" ' < > ) into a text option field. For background on the contribution, here is the description from the original posting: The purpose of this contribution is to allow the use of various option types when setting up product attributes. With the current CVS version of osCommerce, all options are displayed with select lists for user input. This contribution specifically adds the ability to display options with text input boxes. This allows a store owner to collect customization/personalization information for a product from the end user. The contribution is written in such a way that the addition of other option types such as Radio Buttons should be reasonably simple to add. Thanks to Dominik Guder for his help with this release of the contribution! -Chandra
  9. I've had quite a few requests lately to update the option type feature to a recent snapshot, so here it is. V1.3 upgrades the option type feature to the January 7th, 2003 snapshot of osCommerce. It also fixes a couple of bugs. Summary of contribution: Provides text options for products. Here is the description from the original contribution: The purpose of this contribution is to allow the use of various option types when setting up product attributes. With the current CVS version of osCommerce, all options are displayed with select lists for user input. This contribution specifically adds the ability to display options with text input boxes. This allows a store owner to collect customization/personalization information for a product from the end user. The contribution is written in such a way that the addition of other option types such as Radio Buttons should be reasonably simple to add. Here's a link to the contribution: http://www.oscommerce.com/community/contri...ions,160/page,7 Enjoy, Chandra
  10. V1.2 upgrades the option type feature to the October 20th, 2002 snapshot of osCommerce. This should make it easier for people with recent snapshots to install. Here is the description of the original contribution: The purpose of this contribution is to allow the use of various option types when setting up product attributes. With the current CVS version of osCommerce, all options are displayed with select lists for user input. This contribution specifically adds the ability to display options with text input boxes. This allows a store owner to collect customization/personalization information for a product from the end user. The contribution is written in such a way that the addition of other option types such as Radio Buttons should be reasonably simple to add. Here's a link to the contribution: http://www.oscommerce.com/downloads.php/co...ions,596/type,3 Cheers, Chandra
×