Jump to content

multimixer

♥Ambassador
  • Content count

    4,733
  • Joined

  • Last visited

  • Days Won

    72

Everything posted by multimixer

  1. multimixer

    STS question

    I'm sorry, but your question is not clear. Is it about how to install STS, or about how to use it? You say it your self, that there is alot of information in the forum, so you just need to read it, right? You can download the sts package and read the installation and user manual. Most of your questions will be answered There is a thread, dedicated to sts questions --> STSv4 forum. If there are still points not clear, make your question as concrete as possible and post it there
  2. multimixer

    sts and the $content variable

    Thats not hard to do. You need to edit the actual php file, and all changes will be pulled into the content variable. Talking about home page, the file is index.php, the part after the last } else { More info and support about sts you can find here --> The STSv4 support forum Editing php files is not exactly a sts topic, so maybe you explain a little more about what you want to do?
  3. multimixer

    [contribution] Simple Template System (sts)

    This is not a problem but a warning that your configure.php files have not the right permissions. The issue has nothing to do with sts. Maybe you see a message that you wasn't seeing before, even you should. The only solution, as posted by Bill too, is to go to your cpanel and set the correct permissions (644 or 444) on BOTH files, there are many threads in the forum about this
  4. multimixer

    Follow Us Contribution

    The problem is not in the new "follow us" box. It starts earlier at the "whats new" box. If you look at your source code, you will see that the earlier "manufacturers box" ends like this <tr> <td class="ie6_png"><img src="images/corner_bottom_left.png" border="0" alt="" width="10" height="10"></td> <td class="infoBox_bottom"><img src="images/spacer.gif" border="0" alt="" width="1" height="1"></td> <td class="ie6_png"><img src="images/corner_bottom_right.png" border="0" alt="" width="10" height="10"></td> </tr> </table> </td> </tr> </table> </td> </tr> For the whats new it looks like this <tr> <td> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="corner3_bottom_left"><img src="images/corner3_bottom_left.gif" border="0" alt="" width="162" height="10"></td> <td class="ie6_png"><img src="images/corner3_bottom_right.png" border="0" alt="" width="10" height="10"></td> </tr> </table></td> </tr> </table> </td> </tr> </table> </td> </tr> The "follow us" end again "correctly" <tr> <td class="ie6_png"><img src="images/corner_bottom_left.png" border="0" alt="" width="10" height="10"></td> <td class="infoBox_bottom"><img src="images/spacer.gif" border="0" alt="" width="1" height="1"></td> <td class="ie6_png"><img src="images/corner_bottom_right.png" border="0" alt="" width="10" height="10"></td> </tr> </table> </td> </tr> </table> </td></tr> This is also visible directly on the page, you can see that the "whats new" (same as "specials") has not the same bottom as categories, manufacturers and follow us. You need to go to this files (whats new and specials) in the includes/boxes folder and try to make them same as ie categories or follow us. An other point is that this "box adding" all the time and for every single additional link is really not the non plus ultra. You could take the 3 links of the follow us box and put them directly to your footer, no need for a box. Finally, take a look at your site with FF, no background in categories and manufacturers, in safari it looks ok
  5. multimixer

    Follow Us Contribution

    I'm sorry, previous post was a mistake. Do you have a link to that addon?
  6. multimixer

    Follow Us Contribution

    Probably you need to add a couple of <br> to the line of the box above, just look how it is done for other boxes file includes/column_right.php
  7. multimixer

    Template

    What do you mean with "premium version of oscommerce" ? There are no "premium versions" There is RC2a that you should take and v3 that you should avoid unless you want to use it for testing and development purposes. Both are free and can be found here --> download osCommerce
  8. multimixer

    [Contribution] Option Types v2

    This query is adding some more lines, values, to the table "configuration" of your database. The value for each field is separated by a comma "," So it says for example ('', 'Use Progress Bars?', 'OPTIONS_TYPE_PROGRESS', 'Both', 'Set to use the Progress bar for Text Options ...................... The field names of table configuration are: configuration_id, configuration_title, configuration_key, configuration_value , configuration_description ................... Each value is getting written into each field in the same order You see that the first value (for the field "configuration_id") is empty. This is so, because that field is supposed to be "auto increment", so it doesn't need a value to be specified, it adds it by it self, adding +1 to the latest record. For some reason your DB isn't doing that. So it adds the value "0". It's trying to do the same for the second entry, but because this field can have only unique entries, the error appears, telling you that there is a duplicate entry of 0 You can go to your database, table configuration to see the entries for all previous settings. If you order the table by "configuration_id (do this by clicking on the name in the "browse" view), you will find out what the highest latest id is. Lets say it is 726. The next should be 727, then 728, 729 etc etc You can add this numbers manually to the query, so the above posted would look like ('727', 'Use Progress Bars?', 'OPTIONS_TYPE_PROGRESS', 'Both', 'Set to use the Progress bar for Text Options ...................... You see that I entered into the empty first fiel ('') the value '727'. This you can do for all other fields for the query # Add Option Types configuration menu in Admin INSERT INTO configuration VALUES ('727', 'Use Progress Bars?', 'OPTIONS_TYPE_PROGRESS', 'Both', 'Set to use the Progress bar for Text Options<br>None = No Progress Bars<br>Text = Textfields only<br>TextArea = TextAreas only<br>Both = Both Text Fields and Areas', last_insert_id(), '4', now(), now(), NULL, 'tep_cfg_select_option(array(\'None\', \'Text\', \'TextArea\', \'Both\'),'), ('728', 'Upload File Prefix', 'OPTIONS_TYPE_FILEPREFIX', 'Database', 'The prefix that is used to generate unique filenames for uploads.<br>Database = insert id from database<br>Date = the upload Date<br>Time = the upload Time<br>DateTime = Upload Date and Time', last_insert_id(), '5', now(), now(), NULL, 'tep_cfg_select_option(array(\'Database\', \'Date\', \'Time\', \'DateTime\'),'), ('729', 'Delete Uploads older than', 'OPTIONS_TYPE_PURGETIME', '-2 weeks', 'Uploads in the Temporary folder are automatically deleted when older than this setting.<br>Usage: -2 weeks/-5 days/-1 year/etc.', last_insert_id(), '6', now(), now(), NULL, NULL), ('730', 'Upload Directory', 'UPL_DIR', 'images/uploads/', 'The directory to store uploads from registered customers.', last_insert_id(), '7', now(), now(), NULL, NULL), ('731', 'Temporary Directory', 'TMP_DIR', 'images/temp/', 'The directory to store temporary uploads (from guests) which is automatically cleaned.', last_insert_id(), '8', now(), now(), NULL, NULL), ('732', 'Option Type Image - Images Directory', 'OPTIONS_TYPE_IMAGEDIR', 'images/options/', 'What directory to look for Option Type Images.<br>This is where the Images should be stored.', last_insert_id(), '9', now(), now(), NULL, NULL), ('733', 'Option Type Image - Images Prefix', 'OPTIONS_TYPE_IMAGEPREFIX', 'Option_', 'What prefix to use when looking for Option Type Images.<br>This is what the Image\'s name should begin with.', last_insert_id(), '10', now(), now(), NULL, NULL), ('734', 'Option Type Image - Images Name', 'OPTIONS_TYPE_IMAGENAME', 'Name', 'What Option Value item to use as Name for the Option Type Images.<br>When set to "Name", the images should be named: "PREFIX"-"Option value name"-"LanguageID".jpg (Option_RedShirt_1.jpg)<br>When set to "ID", the images should be named: "PREFIX"-"Option value ID"-"LanguageID".jpg (Option_5_1.jpg)', last_insert_id(), '11', now(), now(), NULL, 'tep_cfg_select_option(array(\'Name\', \'ID\'),'), ('735', 'Option Type Image - Use Language ID', 'OPTIONS_TYPE_IMAGELANG', 'Yes', 'Use language ID in Option Type Images Names?<br>This is only needed if different images are used per Language (images with text for example).', last_insert_id(), '12', now(), now(), NULL, 'tep_cfg_select_option(array(\'Yes\', \'No\'),'); Of course you need to replace the numbers (727 etc) with your numbers. Then you run the query again. Before doing this, best is you restore the database you had before running the option types query
  9. multimixer

    [contribution] Simple Template System (sts)

    You link again to the template file. Thats wrong. You need to link to the php file If you have a file news.php, that is defined in includes/filenames as ie FILENAME_NEWS, then the link to it in your template would look like <a href="<?php echo tep_href_link(FILENAME_NEWS, '', 'NONSSL'); ?>" >news</a> You can pace this link anywhere into any template and it will link to news.php From there on, if you have a template for news.php, called news.php.html, then sts will pick it for the display, if not, then the content of news.php will come in the default template environment, thats indifferent for the link
  10. multimixer

    [Contribution] Option Types v2

    Here we go with a new spicy thing for option types. As we all know, the option price is getting added to the products unit price and then multiplied by the chosen quantity. This makes sense for most of the cases but not for following The case: There is a store than sells printed advertising pens. There are various options to choose from, colors, fonts etc etc. All of the options go per unit (pen) except one: the printed color proof. For this the customer needs to pay ie $10. Obviously not for each unit but just once per product. So we have to cases of option price calculation 1) Per unit (product price:5 + option price:1 = 6 x quantity: 500 = total: 3000) 2) Per item (product price:5 x quantity: 500 = 2500 + option price:1 = total:2501) To achieve this I made a solution where the option calculation way can be set (or changed) in the same way as you to for the option type in admin. There is also a text filed to insert a (optional) calculation way description such as per item, per meter, per beer, so that customers know whats going on if you are interested read how to set the option calculation way per unit or per item Involved files are: admin/products_attributes.php admin/orders.php admin/invoice.php admin/includes/local/configure.php admin/includes/classes/order.php admin/includes/languages/english/product_attributes.php admin/attributeManager/classes/attributeManagerInstant.class.php (in case you use this) account_history_info.php checkout_confirmation.php checkout_process.php shopping_cart.php includes/classes/shopping_cart.php includes/classes/order.php includes/classes/currencies.php includes/modules/option_types.php product_info.php -------------------------------------------------- Add some more fields to the database # osCommerce, Open Source E-Commerce Solutions # http://www.oscommerce.com # # Database Changes for Option Types v2 # # created by multimixer for http://multimixer.gr # # Released under the GNU General Public License # Add choice for options price to be calculated per item (once) or per unit # Add calculation way and name to the products_options table ALTER TABLE products_options ADD products_options_price_calc INT( 1 ) DEFAULT '0' NOT NULL , ADD products_options_per_name VARCHAR( 32 ) DEFAULT 'per unit' NULL; # Add calculation way to the products_attributes table ALTER TABLE products_attributes ADD options_price_calc INT( 1 ) DEFAULT '0' NOT NULL; # Add calculation name to the orders_products_attributes table ALTER TABLE orders_products_attributes ADD options_per_name VARCHAR( 32 ) DEFAULT 'per unit' NULL; ----------------------------------------------------------- 1. file admin/products_attributes.php FIND (case 'add_product_options) $option_order = $_POST['option_order']; ADD BELOW // BOF set price per unit / per item multimixer 15 4 10 $option_price_calculation = $_POST['option_price_calc']; $option_price_per_name_array = $_POST['option_per_name']; // EOF set price per unit / per item multimixer 15 4 10 FIND $option_comment = tep_db_prepare_input($option_cmmnt_array[$languages[$i]['id']]); ADD BELOW // BOF set price per unit / per item multimixer 15 4 10 $option_price_per_name = tep_db_prepare_input($option_price_per_name_array[$languages[$i]['id']]); // EOF set price per unit / per item multimixer 15 4 10 FIND tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, products_options_name, language_id, products_options_type, products_options_length, products_options_comment, products_options_order) values ('" . (int)$products_options_id . "', '" . tep_db_input($option_name) . "', '" . (int)$languages[$i]['id'] . "', '" . $option_type . "', '" . $option_length . "', '" . tep_db_input($option_comment) . "', '" . $option_order . "')"); REPLACE WITH // mm set price per unit / per item 15 4 10 added products_options_price_calc, products_options_per_name AND '" . tep_db_input($option_price_calculation) . "', '" . tep_db_input($option_price_per_name) . "' tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, products_options_name, language_id, products_options_type, products_options_length, products_options_comment, products_options_order, products_options_price_calc, products_options_per_name) values ('" . (int)$products_options_id . "', '" . tep_db_input($option_name) . "', '" . (int)$languages[$i]['id'] . "', '" . $option_type . "', '" . $option_length . "', '" . tep_db_input($option_comment) . "', '" . $option_order . "', '" . tep_db_input($option_price_calculation) . "', '" . tep_db_input($option_price_per_name) . "')"); FIND (case 'add_product_attributes') $products_options_query = tep_db_query("select products_options_type from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $_POST['options_id'] . "'"); REPLACE WITH // mm set price per unit / per item 15 4 10 added products_options_price_calc $products_options_query = tep_db_query("select products_options_type, products_options_price_calc from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $_POST['options_id'] . "'"); FIND $value_order = tep_db_prepare_input($_POST['value_order']); ADD BELOW // BOF set price per unit / per item multimixer 15 4 10 $option_price_calculation = $products_options_array['products_options_price_calc']; // BOF set price per unit / per item multimixer 15 4 10 FIND tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (null, '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . (float)tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "', '" . (int)$value_order . "')"); REPLACE WITH // mm set price per unit / per item 15 4 10 added '" . (int)$option_price_calculation . "' tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values (null, '" . (int)$products_id . "', '" . (int)$options_id . "', '" . (int)$values_id . "', '" . (float)tep_db_input($value_price) . "', '" . tep_db_input($price_prefix) . "', '" . (int)$value_order . "', '" . (int)$option_price_calculation . "' )"); FIND (case 'update_option_name') $option_id = tep_db_prepare_input($_POST['option_id']); ADD BELOW // BOF set price per unit / per item multimixer 15 4 10 $option_price_calculation = $_POST['option_price_calc']; $option_price_per_name_array = $_POST['option_per_name']; // EOF set price per unit / per item multimixer 15 4 10 FIND $option_comment = tep_db_prepare_input($option_cmmnt_array[$languages[$i]['id']]); ADD BELOW // BOF set price per unit / per item multimixer 15 4 10 $option_price_per_name = tep_db_prepare_input($option_price_per_name_array[$languages[$i]['id']]); // EOF set price per unit / per item multimixer 15 4 10 FIND tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_name = '" . tep_db_input($option_name) . "', products_options_comment = '" . tep_db_input($option_comment) . "', products_options_type = '" . $option_type . "', products_options_length = '" . $option_length . "', products_options_order = '" . $option_order . "' where products_options_id = '" . (int)$option_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'"); REPLACE WITH // mm set price per unit / per item 15 4 10 added , products_options_price_calc = '" . tep_db_input($option_price_calculation) . "', products_options_per_name = '" . tep_db_input($option_price_per_name) . "' tep_db_query("update " . TABLE_PRODUCTS_OPTIONS . " set products_options_name = '" . tep_db_input($option_name) . "', products_options_comment = '" . tep_db_input($option_comment) . "', products_options_type = '" . $option_type . "', products_options_length = '" . $option_length . "', products_options_order = '" . $option_order . "', products_options_price_calc = '" . tep_db_input($option_price_calculation) . "', products_options_per_name = '" . tep_db_input($option_price_per_name) . "' where products_options_id = '" . (int)$option_id . "' and language_id = '" . (int)$languages[$i]['id'] . "'"); // BOF set price per unit / per item multimixer 15 4 10 tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set options_price_calc = '" . tep_db_input($option_price_calculation) . "' where options_id = '" . (int)$option_id . "'"); // EOF set price per unit / per item multimixer 15 4 10 FIND (case 'update_product_attribute') $products_options_query = tep_db_query("select products_options_type from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $_POST['options_id'] . "'"); REPLACE WITH // mm set price per unit / per item 15 4 10 added products_options_price_calc $products_options_query = tep_db_query("select products_options_type, products_options_price_calc from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $_POST['options_id'] . "'"); FIND $attribute_id = tep_db_prepare_input($_POST['attribute_id']); ADD BELOW // BOF set price per unit / per item multimixer 15 4 10 $option_price_calculation = $products_options_array['products_options_price_calc']; // EOF set price per unit / per item multimixer 15 4 10 FIND tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set products_id = '" . (int)$products_id . "', options_id = '" . (int)$options_id . "', options_values_id = '" . (int)$values_id . "', options_values_price = '" . (float)tep_db_input($value_price) . "', price_prefix = '" . tep_db_input($price_prefix) . "', products_options_sort_order = '" . tep_db_input($value_order) . "' where products_attributes_id = '" . (int)$attribute_id . "'"); REPLACE WITH // mm set price per unit / per item 15 4 10 added options_price_calc = '" . (int)$option_price_calculation . "' tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set products_id = '" . (int)$products_id . "', options_id = '" . (int)$options_id . "', options_values_id = '" . (int)$values_id . "', options_values_price = '" . (float)tep_db_input($value_price) . "', price_prefix = '" . tep_db_input($price_prefix) . "', products_options_sort_order = '" . tep_db_input($value_order) . "', options_price_calc = '" . (int)$option_price_calculation . "' where products_attributes_id = '" . (int)$attribute_id . "'"); FIND return isset($products_options_types_list[$opt_type]) ? $products_options_types_list[$opt_type] : 'Error ' . $opt_type; } //EOF - Zappo - Option Types v2 - Define Option Types List ADD BELOW //BOF multimixer set price per unit / per item 15 4 10 - Define Calculation way list $products_options_calc_way[OPTIONS_PER_UNIT] = OPTIONS_PER_UNIT_NAME; $products_options_calc_way[OPTIONS_PER_ITEM] = OPTIONS_PER_ITEM_NAME; // Draw a pulldown for calculation way function draw_calcway_pulldown($name, $default = '') { global $products_options_calc_way; $values = array(); foreach ($products_options_calc_way as $id => $text) { $values[] = array('id' => $id, 'text' => $text); } return tep_draw_pull_down_menu($name, $values, $default); } // Translate calculation way values to english string function translate_type_to_name1($calc_way) { global $products_options_calc_way; return isset($products_options_calc_way[$calc_way]) ? $products_options_calc_way[$calc_way] : 'Error ' . $calc_way; } //EOF multimixer set price per unit / per item 15 4 10 - Define Calculation way list FIND (in the html part) <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_COMMENT; ?> </td> ADD BELOW <!-- BOF multimixer set price per unit / per item add 2 columns for calculation way and per name --> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_CALC; ?> </td> <td class="dataTableHeadingContent"> <?php echo TABLE_HEADING_OPT_PER; ?> </td> <!-- EOF multimixer set price per unit / per item add 2 columns for calculation way and per name --> You can also set the colspan from 7 to 9 to have the blackline expanding over the total header width FIND $CommentInput = ''; ADD BELOW $PerInput = ''; // multimixer 15 4 10 set price per unit / per item FIND $option_name = tep_db_query("select products_options_name, products_options_comment from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $options_values['products_options_id'] . "' and language_id = '" . $languages[$i]['id'] . "'"); REPLACE WITH // multimixer set price per unit / per item 15 4 10 added products_options_per_name $option_name = tep_db_query("select products_options_name, products_options_comment, products_options_per_name from " . TABLE_PRODUCTS_OPTIONS . " where products_options_id = '" . $options_values['products_options_id'] . "' and language_id = '" . $languages[$i]['id'] . "'"); FIND $CommentInput .= tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . TABLE_HEADING_OPT_COMMENT . '<br><input type="text" name="option_comment[' . $languages[$i]['id'] . ']" size="24" value="' . $option_name['products_options_comment'] . '"><br>'; ADD BELOW // BOF multimixer 15 4 10 set price per unit / per item $PerInput .= tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . TABLE_HEADING_OPT_PER . '<br><input type="text" name="option_per_name[' . $languages[$i]['id'] . ']" size="24" value="' . $option_name['products_options_per_name'] . '"><br>'; // EOF multimixer 15 4 10 set price per unit / per item FIND <td class="smallText"><?php echo $NameInput; ?></td> <td class="smallText"><?php echo $CommentInput; ?></td> <td class="smallText" colspan="3"><?php echo TABLE_HEADING_OPT_LENGTH . ': <input type="text" name="option_length" size="4" value="' . $options_values['products_options_length'] . '"><br>' . TABLE_HEADING_OPT_ORDER . ': <input type="text" name="option_order" size="3" value="' . $options_values['products_options_order'] . '"><br>' . TABLE_HEADING_OPT_TYPE . ': ' . draw_optiontype_pulldown('option_type', $options_values['products_options_type']); ?></td> REPLACE WITH <td class="smallText"><?php echo $NameInput; ?></td> <td class="smallText"><?php echo TABLE_HEADING_OPT_TYPE . ': ' . draw_optiontype_pulldown('option_type', $options_values['products_options_type']); ?></td> <td class="smallText"><?php echo TABLE_HEADING_OPT_ORDER . ': <input type="text" name="option_order" size="3" value="' . $options_values['products_options_order'] . '">' ; ?></td> <td class="smallText"><?php echo TABLE_HEADING_OPT_LENGTH . ': <input type="text" name="option_length" size="4" value="' . $options_values['products_options_length'] . '">' ; ?></td> <td class="smallText"><?php echo $CommentInput; ?></td> <!-- BOF multimixer add 2 columns for calculation way and per name --> <td class="smallText"><?php echo TABLE_HEADING_OPT_CALC . ': ' . draw_calcway_pulldown('option_price_calc', $options_values['products_options_price_calc']) ; ?></td> <td class="smallText"><?php echo $PerInput; ?></td> <!-- EOF multimixer add 2 columns for calculation way and per name --> This will give also a new structure to the table when pressing "update" for an option FIND <td class="smallText"><?php echo $options_values["products_options_comment"]; ?></td> ADD BELOW <!-- BOF multimixer set price per unit / per item add 2 columns for calculation way and per name --> <td class="smallText" align="center"><?php echo translate_type_to_name1($options_values["products_options_price_calc"]); ?></td> <td class="smallText"><?php echo $options_values["products_options_per_name"]; ?></td> <!-- EOF multimixer set price per unit / per item add 2 columns for calculation way and per name --> FIND (again) $CommentInput = ''; ADD BELOW $PerInput = ''; // multimixer 15 4 10 set price per unit / per item FIND $CommentInput .= tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . TABLE_HEADING_OPT_COMMENT . ':<br><input type="text" name="option_comment[' . $languages[$i]['id'] . ']" size="24"><br>'; ADD BELOW // BOF multimixer 15 4 10 add calculation way and per name $PerInput .= tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . ' ' . TABLE_HEADING_OPT_PER . ':<br><input type="text" name="option_per_name[' . $languages[$i]['id'] . ']" size="24"><br>'; // EOF multimixer 15 4 10 add calculation way and per name FIND <td align="center" class="smallText"> <?php echo $next_id; ?> </td> <td class="smallText"><?php echo $NameInput; ?></td> <td class="smallText"><?php echo $CommentInput; ?></td> <td class="smallText" colspan="3"><?php echo TABLE_HEADING_OPT_LENGTH . ': <input type="text" name="option_length" size="4"><br>' . TABLE_HEADING_OPT_ORDER . ': <input type="text" name="option_order" size="3"><br>' . TABLE_HEADING_OPT_TYPE . ': ' . draw_optiontype_pulldown('option_type'); ?></td> <td align="center" class="smallText"> <?php echo tep_image_submit('button_insert.gif', IMAGE_INSERT); ?> </td> REPLACE WITH <td align="center" class="smallText"> <?php echo $next_id; ?> </td> <td class="smallText"><?php echo $NameInput; ?></td> <td class="smallText"><?php echo TABLE_HEADING_OPT_TYPE . ': ' . draw_optiontype_pulldown('option_type'); ?></td> <td class="smallText"><?php echo TABLE_HEADING_OPT_ORDER . ': <input type="text" name="option_order" size="3">' ; ?></td> <td class="smallText"><?php echo TABLE_HEADING_OPT_LENGTH . ': <input type="text" name="option_length" size="4">' ; ?></td> <td class="smallText"><?php echo $CommentInput; ?></td> <!-- BOF multimixer set price per unit / per item add 2 columns for calculation way and per name --> <td class="smallText"><?php echo TABLE_HEADING_OPT_CALC . ': ' . draw_calcway_pulldown('option_price_calc'); ?></td> <td class="smallText"><?php echo $PerInput; ?></td> <!-- EOF multimixer set price per unit / per item add 2 columns for calculation way and per name --> <td align="center" class="smallText"> <?php echo tep_image_submit('button_insert.gif', IMAGE_INSERT); ?> </td> Again you will see a new table structure in the "insert" area for options, I think it looks nicer ------------------------------------------ 2. file admin/orders.php FIND if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')'; REPLACE WITH // set price per unit / per item multimixer 15 4 10 added . ' ' . $order->products[$i]['attributes'][$j]['pername'] commented * $order->products[$i]['qty'] if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] /** $order->products[$i]['qty']*/, true, $order->info['currency'], $order->info['currency_value']) . ' ' . $order->products[$i]['attributes'][$j]['pername'] . ')'; ------------------------------------ 3. file admin/invoice.php FIND if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')'; REPLACE WITH // set price per unit / per item multimixer 15 4 10 added . ' ' . $order->products[$i]['attributes'][$j]['pername'] commented * $order->products[$i]['qty'] if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] /** $order->products[$i]['qty']*/, true, $order->info['currency'], $order->info['currency_value']) . ' ' . $order->products[$i]['attributes'][$j]['pername'] . ')'; ------------------------------------ 4. file admin/includes/local/configure.php ADD before the last ?> //BOF multimixer set price per unit / per item 15 4 10 - Define Calculation way list define('OPTIONS_PER_UNIT', 0); define('OPTIONS_PER_UNIT_NAME', 'Per Unit'); // (Names are just for displaying on admin side) define('OPTIONS_PER_ITEM', 1); define('OPTIONS_PER_ITEM_NAME', 'Per Item'); // (Names are just for displaying on admin side) //BOF multimixer set price per unit / per item 15 4 10 - Define Calculation way list ------------------------------------------- 5 file admin/includes/classes/order.php FIND $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'") ; REPLACE WITH // set price per unit / per item multimixer 15 4 10 added , options_per_name $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix, options_per_name from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'"); FIND 'prefix' => $attributes['price_prefix'], ADD BELOW 'pername' => $attributes['options_per_name'], // set price per unit / per item multimixer 15 4 10 (line above added) ------------------------------------------------ 6 file admin/includes/languages/english/product_attributes.php ADD before the last ?> // BOF multimixer add defines for calculation way and per name define('TABLE_HEADING_OPT_CALC', 'Calculation way'); define('TABLE_HEADING_OPT_PER', 'Calculation Description'); // EOF multimixer add defines for calculation way and per name ----------------------------------------------- 7 file admin/attributeManager/classes/attributeManagerInstant.class.php (if you use this) FIND (function addAttributeToProduct($get)) if(empty($prefix)){ $prefix=' '; } ADD BELOW // BOF set price per unit / per item multimixer 15 4 10 $mmqueryString = "select products_options_price_calc from ".TABLE_PRODUCTS_OPTIONS." where products_options_id='" . $optionId . "'"; $mmquery = amDB::query($mmqueryString); while($res = amDB::fetchArray($mmquery)) $calcWay = $res['products_options_price_calc']; // EOF set price per unit / per item multimixer 15 4 10 FIND 'price_prefix' => $prefix REPLACE WITH // BOF set price per unit / per item multimixer 15 4 10 'price_prefix' => $prefix, 'options_price_calc' => $calcWay // EOF set price per unit / per item multimixer 15 4 10 Now go to your products attributes page in admin. You should see a new drop down with the calculation way options and a text input field for the description. If this is so, then go on ----------------------------------------- 8 file account_history_info.php FIND echo ' - (' . $order->products[$i]['attributes'][$j]['price_prefix'] . $currencies->display_price($order->products[$i]['attributes'][$j]['price'], tep_get_tax_rate($order->products[$i]['tax'])) . ')'; REPLACE WITH echo ' - (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->display_price($order->products[$i]['attributes'][$j]['price'], tep_get_tax_rate($order->products[$i]['tax'])) . ' ' . $order->products[$i]['attributes'][$j]['pername'] . ')'; // set price per unit / per item multimixer 15 4 10 added to line above . ' ' . $order->products[$i]['attributes'][$j]['pername'] ---------------------------------------- 9 file checkout_confirmation.php FIND echo ' - (' . $order->products[$i]['attributes'][$j]['price_prefix'] . $currencies->display_price($order->products[$i]['attributes'][$j]['price'], tep_get_tax_rate($order->products[$i]['tax'])) . ')'; REPLACE WITH echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->display_price($order->products[$i]['attributes'][$j]['price'], tep_get_tax_rate($order->products[$i]['tax'])) . ' ' . $order->products[$i]['attributes'][$j]['pername'] .')'; // set price per unit / per item multimixer 15 4 10 added to line above . ' ' . $order->products[$i]['attributes'][$j]['pername'] ----------------------------------------- 10 file checkout_process.php FIND $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename REPLACE WITH // set price per unit / per item multimixer 15 4 10 added , popt.products_options_per_name $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename, popt.products_options_per_name ! attention not to mess up the query, I didn't post it all, just the part that change FIND $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); REPLACE WITH // set price per unit / per item multimixer 15 4 10 added , popt.products_options_per_name $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, popt.products_options_per_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"); FIND 'price_prefix' => $attributes_values['price_prefix']); REPLACE WITH 'price_prefix' => $attributes_values['price_prefix'], 'options_per_name' => $attributes_values['products_options_per_name']); // set price per unit / per item multimixer 15 4 10 (line above added ) ------------------------------------------- 11 file shopping_cart.php FIND $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix REPLACE WITH // set price per unit / per item multimixer 15 4 10 added , popt.products_options_per_name $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, popt.products_options_per_name Again: attention not to mess up the query, just the relevant part got posted here FIND $products[$i][$option]['products_options_name'] = $attributes_values['products_options_name']; ADD BELOW $products[$i][$option]['products_options_per_name'] = $attributes_values['products_options_per_name']; // set price per unit / per item multimixer 15 4 10 (line above added) FIND $Option_Price = ($products[$i][$option]['options_values_price'] != '0') ? ' - (' . $products[$i][$option]['price_prefix'] . $currencies->display_price($products[$i][$option]['options_values_price'], tep_get_tax_rate($products[$i]['tax_class_id'])) . ')' : ''; REPLACE WITH $Option_Price = ($products[$i][$option]['options_values_price'] != '0') ? ' - (' . $products[$i][$option]['price_prefix'] . $currencies->display_price($products[$i][$option]['options_values_price'], tep_get_tax_rate($products[$i]['tax_class_id'])) . ' ' . $products[$i][$option]['products_options_per_name'] . ')' : ''; // set price per unit / per item multimixer 15 4 10: line above added ' ' . $products[$i][$option]['products_options_per_name'] ------------------------------------------- 12 file includes/classes/shopping_cart.php FIND $attribute_price_query = tep_db_query("SELECT products_attributes_id, options_values_price, price_prefix FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_id = '" . (int)$products_id . "'" . $where .""); REPLACE WITH // BOF set price per unit / per item multimixer 15 4 10 added options_price_calc $attribute_price_query = tep_db_query("SELECT products_attributes_id, options_values_price, price_prefix, options_price_calc FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_id = '" . (int)$products_id . "'" . $where .""); // EOF set price per unit / per item multimixer 15 4 10 FIND if ($attribute_price[$n]['price_prefix'] == '+') { $this->total += $currencies->calculate_price($attribute_price[$n]['options_values_price'], $products_tax, $qty); } else { $this->total -= $currencies->calculate_price($attribute_price[$n]['options_values_price'], $products_tax, $qty); } REPLACE WITH // BOF set price per unit / per item multimixer 15 4 10 if ($attribute_price[$n]['options_price_calc'] == '0') { // EOF set price per unit / per item multimixer 15 4 10 if ($attribute_price[$n]['price_prefix'] == '+') { $this->total += $currencies->calculate_price($attribute_price[$n]['options_values_price'], $products_tax, $qty); } else { $this->total -= $currencies->calculate_price($attribute_price[$n]['options_values_price'], $products_tax, $qty); } // BOF set price per unit / per item multimixer 15 4 10 } else { if ($attribute_price[$n]['price_prefix'] == '+') { $this->total += $currencies->calculate_price($attribute_price[$n]['options_values_price'], $products_tax); } else { $this->total -= $currencies->calculate_price($attribute_price[$n]['options_values_price'], $products_tax); } } // EOF set price per unit / per item multimixer 15 4 10 FIND (again) $attribute_price_query = tep_db_query("SELECT products_attributes_id, options_values_price, price_prefix FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_id = '" . (int)$products_id . "'" . $where .""); REPLACE WITH // BOF set price per unit / per item multimixer 15 4 10 added options_price_calc $attribute_price_query = tep_db_query("SELECT products_attributes_id, options_values_price, price_prefix, options_price_calc FROM " . TABLE_PRODUCTS_ATTRIBUTES . " WHERE products_id = '" . (int)$products_id . "'" . $where .""); // EOF set price per unit / per item multimixer 15 4 10 FIND(again) if ($attribute_price[$n]['price_prefix'] == '+') { $attributes_price += $attribute_price[$n]['options_values_price']; } else { $attributes_price -= $attribute_price[$n]['options_values_price']; } REPLACE WITH // BOF set price per unit / per item multimixer 15 4 10 if ($attribute_price[$n]['options_price_calc'] == '0') { // EOF set price per unit / per item multimixer 15 4 10 if ($attribute_price[$n]['price_prefix'] == '+') { $attributes_price += $attribute_price[$n]['options_values_price']; } else { $attributes_price -= $attribute_price[$n]['options_values_price']; } // BOF set price per unit / per item multimixer 15 4 10 } else { if ($attribute_price[$n]['price_prefix'] == '+') { $attributes_price += $attribute_price[$n]['options_values_price'] / $this->contents[$products_id]['qty']; } else { $attributes_price -= $attribute_price[$n]['options_values_price'] / $this->contents[$products_id]['qty']; } } // EOF set price per unit / per item multimixer 15 4 10 ------------------------------------------- 13 file includes/classes/order.php FIND $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'"); REPLACE WITH // set price per unit / per item multimixer 15 4 10 added , options_per_name $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix, options_per_name from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'"); FIND 'prefix' => $attributes['price_prefix'], ADD BELOW 'pername' => $attributes['options_per_name'], // set price per unit / per item multimixer 15 4 10 (line above added) FIND (again) $attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'"); REPLACE WITH // set price per unit / per item multimixer 15 4 10 added , popt.products_options_per_name $attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, popt.products_options_per_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int)$products[$i]['id'] . "' and pa.options_id = '" . (int)$option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int)$value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int)$languages_id . "' and poval.language_id = '" . (int)$languages_id . "'"); FIND (again) 'prefix' => $attributes['price_prefix'], ADD BELOW 'pername' => $attributes['products_options_per_name'], // set price per unit / per item multimixer 15 4 10 (line above added) --------------------------------------------------- 14 file includes/classes/currencies.php FIND return tep_round(tep_add_tax($products_price, $products_tax), $this->currencies[$currency]['decimal_places']) * $quantity; REPLACE WITH // BOF set price per unit / per item multimixer 15 4 10 //return tep_round(tep_add_tax($products_price, $products_tax), $this->currencies[$currency]['decimal_places']) * $quantity; return tep_round(tep_add_tax($products_price, $products_tax), 10) * $quantity; // EOF set price per unit / per item multimixer 15 4 10 This here is not necessary to do if you don't have very large order quantities (ie 1000 pcs) and very low options prices per item (not unit) (ie 0,05) --------------------------------------- 15 file includes/modules/option_types.php FIND $ProdOpt_Length = $products_options_name['products_options_length']; ADD BELOW // BOF set price per unit / per item multimixer 15 4 10 $ProdOpt_perName = $products_options_name['products_options_per_name']; // EOF set price per unit / per item multimixer 15 4 10 FIND $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'])) .') '; REPLACE WITH $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'])) . ' ' . $ProdOpt_perName . ') '; // set price per unit / per item multimixer added $ProdOpt_perName FIND $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'])) .') '; REPLACE WITH $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'])) . ' ' . $ProdOpt_perName .')'; // set price per unit / per item multimixer added $ProdOpt_perName FIND $option_price = ' (' . $products_options['price_prefix'] . ' ' . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; REPLACE WITH $option_price = ' (' . $products_options['price_prefix'] . ' ' . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ' ' . $ProdOpt_perName .') '; // set price per unit / per item multimixer added $ProdOpt_perName ------------------------------------ 16 file product_info.php FIND $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)$product_info['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_order, popt.products_options_name"); REPLACE WITH // BOF set price per unit / per item multimixer 15 4 10 added , popt.products_options_per_name $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, popt.products_options_per_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$product_info['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_order, popt.products_options_name"); FIND $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options[$n]['price_prefix'] . $currencies->display_price($products_options[$n]['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; REPLACE WITH $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options[$n]['price_prefix'] . $currencies->display_price($products_options[$n]['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ' ' . $products_options_name['products_options_per_name'] .') '; // set price per unit / per item multimixer 15 4 10 $products_options_name['products_options_per_name'] ------------------------------------------------- ------------------------------------------------- Thats it people, try it out
  11. multimixer

    [Contribution] Option Types v2

    Don't hurry with a new release. There are some more things that I did that could be included into a new release like: 1) Full sts integration (could be like a separate optional install folder) 2) Option calculation way per item or per unit 3) More optinos for image options (like preview, admin on/off and settings etc) + div based display and some more small things that I don't remember. Even I have all running here at me, it all need still some ironing before posting.
  12. multimixer

    [Contribution] Option Types v2

    Good news: I think I have the solution Bad news: Not known (yet) This was a headache: I could echo the correct attributes id everywhere and write it to any field of products attributes table, I could write anything to that table and to the correct line, just the price and prefix not. That brought me to the thought that the issue has nothing to do with database functions, but with the fact that the form does not recognize the input field correctly. How else is it possible that I have always the correct attributes id echoed beside the input field but wrong data goes to the DB? And yes, of course: In attribute_manager.php (lines 235 - 245) we have <span style="margin-right: 30px;"> <?php echo drawDropDownPrefix('id="prefix_'.$optionValueId.'" style="margin:3px 0px 3px 0px;" onChange="return amUpdate(\''.$optionId.'\',\''.$optionValueId.'\',\'prefix\');"',$optionValueInfo['prefix']); echo tep_draw_input_field("price_$optionValueId",$optionValueInfo['price'],' style="margin:3px 0px 3px 0px;" id="price_'.$optionValueId.'" size="7" onfocus="amF(this)" onblur="amB(this)" onChange="return amUpdate(\''.$optionId.'\',\''.$optionValueId.'\',\'price\');"'); // - Zappo - Option Types v2 - Placed Back & Adjusted Sort order from original AttributeManager (Needed this after all ;D) echo tep_draw_input_field("sortOrder_$optionValueId",$optionValueInfo['sortOrder'],' style="margin:3px 0px 3px 0px;" id="sortOrder_'.$optionValueId.'" size="3" onChange="return amUpdate(\''.$optionId.'\',\''.$optionValueId.'\');"'); ?> </span> We see that 2 selectors are used, $optionId and $optionValueId, the id for the field is set by $optionValueId. In text options the $optionValueId is not unique (always 0) thats why the mess. And what is the only unique thing? the attributes ID ! So, why not to use it? First I set (about line 190) <?php if(0 < $numValues){ foreach($optionInfo['values'] as $optionValueId => $optionValueInfo) { // BOF fix priceupdate for text options multimixer 18 4 10 $ProductsAttributesid = $optionValueInfo['products_attributes_id']; // EOF fix priceupdate for text options multimixer 18 4 10 ?> Then In lines 235 - 245 I use the attribute id instead (and additional) to the options values id <span style="margin-right: 30px;"> <?php // BOF fix priceupdate for text options multimixer 18 4 10 use attributes id instead of option values id echo drawDropDownPrefix('id="prefix_'.$ProductsAttributesid.'" style="margin:3px 0px 3px 0px;" onChange="return amUpdate(\''.$optionId.'\',\''.$optionValueId.'\',\''.$ProductsAttributesid.'\',\'prefix\');"',$optionValueInfo['prefix']); echo tep_draw_input_field("price_$ProductsAttributesid",$optionValueInfo['price'],' style="margin:3px 0px 3px 0px;" id="price_'.$ProductsAttributesid.'" size="7" onfocus="amF(this)" onblur="amB(this)" onChange="return amUpdate(\''.$optionId.'\',\''.$optionValueId.'\',\''.$ProductsAttributesid.'\',\'price\');"'); // - Zappo - Option Types v2 - Placed Back & Adjusted Sort order from original AttributeManager (Needed this after all ;D) echo tep_draw_input_field("sortOrder_$ProductsAttributesid",$optionValueInfo['sortOrder'],' style="margin:3px 0px 3px 0px;" id="sortOrder_'.$ProductsAttributesid.'" size="3" onChange="return amUpdate(\''.$optionId.'\',\''.$optionValueId.'\',\''.$ProductsAttributesid.'\');"'); // EOF fix priceupdate for text options multimixer 18 4 10 ?> </span> Now, the last thing is to update the attributeManager.js file to use the right selector, so, lines 103 - 144 look now like this // multimixer 18 4 10 fix priceupdate for text options, use attributes id instead of option values id function amUpdate(optionId, optionValueId, ProductsAttributesid, optionSender) { // mm 18 4 10 added ProductsAttributesid if (typeof optionSender=="undefined") { optionSender='na'; } prefix=getDropDownValue('prefix_'+ProductsAttributesid); // mm 18 4 10 replaced optionValueId by ProductsAttributesid price=getDropDownValue('price_'+ProductsAttributesid); // mm 18 4 10 replaced optionValueId by ProductsAttributesid if((optionSender=='prefix')&&((prefix=='')||(prefix==' '))){ price='0'; } if(price.indexOf('-')==0){ prefix='-'; setDropDownValue('prefix_'+ProductsAttributesid,'-','s'); // mm 18 4 10 replaced optionValueId by ProductsAttributesid price=price.substr(1); } price=parseFloat(price); if(isNaN(price)){ price=0; }else{ price*=10000; price=Math.round(price); price=price/10000; } price=price+''; if(price.indexOf(".")<0){ price+='.'; } while(price.length-price.indexOf(".")<5){ price+='0'; } setDropDownValue('price_'+ProductsAttributesid,price,'i'); // mm 18 4 10 replaced optionValueId by ProductsAttributesid if((price!='0.0000')&&((prefix=='')||(prefix==' '))){ setDropDownValue('prefix_'+ProductsAttributesid,'%2B','s');//+ // mm 18 4 10 replaced optionValueId by ProductsAttributesid } amSendRequest('amAction=update&option_id='+optionId+'&option_value_id='+optionValueId+'&price='+getDropDownValue('price_'+ProductsAttributesid)+'&prefix='+getDropDownValue('prefix_'+ProductsAttributesid)+'&sortOrder='+getDropDownValue('sortOrder_'+ProductsAttributesid),'',false); getElement('price_'+ProductsAttributesid).blur(); var el = getElement('sortOrder_'+ProductsAttributesid); // mm 18 4 10 replaced optionValueId by ProductsAttributesid 5 times if(el != null) el.blur(); return false; } The result? Everything works very smooth now I tested a little around and could not find any issues. It would be great anyway if somebody could apply this changes and test a bit more. I did everything on a modified rc2a with many changes also to option types, like sppc integration and some other homemade changes, some of them I posted already, some will follow Now I go for a beer !
  13. multimixer

    [Contribution] Additional Images Module

    The files are that clearly marked with BOF EOF that it is very easy to merge with a file comparison program. PS By the way, that looks much more "normal" to me, question of taste probably
  14. multimixer

    [Contribution] Option Types v2

    Headache's next chapter: I think I was on the totally wrong way. Even using the attributes id cause the same mix up. In detail: In file attributeManagerInstant.class.php I did following where it is the case " * Updates the price and prefix in the products attribute table" starting at line about 240 1) I added one query to get the attributes id $mmAqueryString = "select products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id= '" . $this->intPID . "' and options_id='" . $optionId . "' and options_values_id='" . $optionValueId . "' "; $mmAquery = amDB::query($mmAqueryString); while($res = amDB::fetchArray($mmAquery)) $attrId = $res['products_attributes_id']; 2) I changed this amDB::perform(TABLE_PRODUCTS_ATTRIBUTES,$data, 'update',"products_id='$this->intPID' and options_id='$optionId' and options_values_id='$optionValueId'"); to this amDB::perform(TABLE_PRODUCTS_ATTRIBUTES,$data, 'update',"products_attributes_id='$attrId'"); So all selection go according to attribute id 3) To test that it picks the correct line I also write the attribute id into an other additional line of table products_attributes, so the array looks like this (just for testing) $data = array( 'options_values_price' => $price, 'price_prefix' => $prefix, 'options_price_calc' => $attrId ); What is the result? 1) Every price (or prefix update) goes to the correct line (I see always the matching attributes id written into my test field) 2) For all multi option options everything works perfectly 3) For text options it works only for the first option (of ie 3). When making changes to the second (according to option_id) then doesn't matter what I enter, the settings from previous option are copied into the next: price, prefix and sort order. It is not mixing the product_id's, but for sure the option id's Honestly I have no idea what to do now
  15. multimixer

    [Contribution] Additional Images Module

    I don't think that there is anything that is not working at all. What do you mean? Regarding buggy, it would be very constructive if you could report what bugs exactly you found Installation step by step Step 1 Run the sql file Step 2 Upload all files from folder files to upload Step 2 you open your file comparisson program Step 3 you load your file to the left Step 4 you load the addon file to the right (from folder files to compare) Step 5 You merge from right to left whatever is marked with BOF EOF Step 6 Save and upload you file Repeat steps for all files in folder "files to compare" If you think the "find this" replace that" way easier, or "normal", maybe you could write such a installation file after you are done, just an idea
  16. multimixer

    my store wont checkout

    Please do not double post. It will not give you a faster solution. Your original topic is there and everybody can read it. Making a second one is just confusing Original topic here PS I really don't know why you keep on posting in the paypal area. Has your issue anything to do with paypal?
  17. multimixer

    [Contribution] Option Types v2

    Hi Zappo Right now I'm at the stage where I found out following: When updating a product attribute (ie the price) 1) in products_attributes.php we have tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set products_id = '" . (int)$products_id . "', options_id = '" . (int)$options_id . "', options_values_id = '" . (int)$values_id . "', options_values_price = '" . (float)tep_db_input($value_price) . "', price_prefix = '" . tep_db_input($price_prefix) . "', products_options_sort_order = '" . tep_db_input($value_order) . "' where products_attributes_id = '" . (int)$attribute_id . "'"); the important part is where products_attributes_id = '" . (int)$attribute_id . "'") 2) in file attributeManagerInstant.class.php we have for the same case amDB::perform(TABLE_PRODUCTS_ATTRIBUTES,$data, 'update',"products_id='$this->intPID' and options_id='$optionId' and options_values_id='$optionValueId'"); No word about the attribute id. At the other hand it doesn't look to be necessary in the text options case because the combination option_id and products_id makes the line unique. So I don't understand why it mix up when it is using the option_id to separate
  18. multimixer

    [Contribution] Option Types v2

    Update to my yesterdays post: Setting a option value to text (and file) options, in order to force a unique option value id to be set in table product attributes, is not a good idea. The value need to be '0' (thats the OPTIONS_VALUE_TEXT_ID as set in admin/includes/local/configure.php) so that shopping_cart.php etc can separate this options properly and display the text (or link to the file) that the customer typed in. The issue still remain: While when updating the price for text options (if having more than 1) via the regular attributes page everything goes correctly, when doing the same via the attribute manager all options become the same price written into the database (table product_attributes) I suspect that this happens, because the attribute manager does not respect the options id when updating the price while the regular attributes do
  19. multimixer

    my store is no longer offering checkout or any options

    I don't know how this issue is related to paypal and payment modules in general However, your "checkout" button is linking correctly to checkout_shipping.php. Do you have any shipping modules enabled? Is there anything on top of checkout_shipping.php that sends the user back to the shopping cart? some condition or something?
  20. multimixer

    "Dynamenu" for osCommerce

    This looks ok. Next to think about is if you added the necessary part to your stylesheet?
  21. multimixer

    [Contribution] Option Types v2

    Hello people I found a small issue connected to the attribute manager: When adding a text option (or textarea, or file) via the attribute manager the option value is set as CUSTOMER-INPUT and has a value id of 0. A second or a 3rd option of the same sort gets exactly the same options_values_id (0) in table products_attributes. Thats not a problem if you don't want to set prices to this attributes. If you do (again via the attribute manager) then the problem is that the same product and the same option value will have a different price and thats something the system don't like: You will be either not able to set the second price, or the second price will be the same as the first one. For now, the solution I give is to insert any value (text, number, whatever) when adding such an option, just for the reason to force a new option_value_id to be set, and it works fine It would be nicer to have the CUSTOMER-INPUT value to be "unique" getting something like "CUSTOMER-INPUT-234", maybe using the options id? Since this options "sigle value options", this would make them unique. Lets think about
  22. multimixer

    Add Telephone no. ?

    You can read here about how to add a phone and other nice things
  23. multimixer

    "Dynamenu" for osCommerce

    There is no difference in DM installation for sts548 or sts46, same thing and easy to do: 1) You install SM as per instructions 2) You create a box in file includes/modules/sts_inc/column_left.php require(DIR_WS_BOXES . 'dm_categories.php'); $sts->restart_capture('dmbox', 'box'); // Get Dynamenu Category box 3) You add to the bottom of includes/application_bottom.php // Output the footer for Dynamenu for osCommerce echo $GLOBALS['dmfooter']; I suspect that you didn't do the last step correctly or at all
  24. multimixer

    Shadowbox For Product_Info.php

    Would be nice if you could say how you solved all this issues
  25. multimixer

    ShareThis Add-On?

    I think you can take the file includes/modules/header_tags_social_bookmarks.php from header tags seo and use it for your purposes
×