Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Attributes


Guest

Recommended Posts

I am getting so fustrated! :angry: I have a couple of questions on the attributes for products.

 

1. How do I set a limit for a text box?

2. One of my products there is an option to choose any letter in the alphabet. When I entered them into the attributes I did it in alphabetical order, but they are not showing up in alphabetical order. I'm not sure why or how to fix that.

3. How do I make all of the fields required so if a customer forgets to pick one and just checks out it won't let them because they forgot to pick an option for their order?

 

Thanks!

Guccilvr :wub:

Link to comment
Share on other sites

1. Limit? I don't understand what you want to do.

 

2. There is an Attributes Sorter & Copier contribution that allows you to choose the sort order. In the mean time, you may want consider the following line (around 134 of product_info.php) from

        $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 = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");

to

        $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 = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "' order by pov.products_options_values_id");

3. You would have to rewrite the add_product code in includes/application_top.php to check that all required attributes have been selected.

 

Hth,

Matt

Link to comment
Share on other sites

Thanks! But is there a way to just do it in the admin part without code?

 

Also when I said limit, I meant that for the text box option it's allowing whatever amount of information a person wants to right, and for my product I can only allow 6 letters to a line. Does that make sense?

 

Do you know anything about making the fields required?

Link to comment
Share on other sites

All 3 things that you want require changing code. There is no current way to just do any of them in admin. As I said, there is an existing contribution for #2 (and I offered a kludge that would probably make it work for you as stands). #1 could be done globally rather easily by editing the text box code in product_info.php and the database field in customers_basket_attributes (change length from 32 to 6). It would be more difficult to do so on an attribute per attribute basis. As I said, #3 requires a rewrite of the three lines that handle action=add_product in includes/application_top.php. I'm not sure of the exact syntax, but the thread in the contributions area for the File Upload contribution has an example that works with that contribution. It would need to be modified to work in a more general case.

 

Hth,

Matt

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...