Jump to content

belladonna

Members
  • Content count

    61
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Richard
  • Gender
    Male
  • Location
    Rotterdam, The Netherlands
  1. I have received many requests by mail for the dropdown menu as found on http://www.tennisspeciaal.nl/ Below an explanation on how to incorporate the menu. The code for the menu was taken from BrainJar.com. Due to the terms of use, I cannot publish the code on other sites, thus please visit http://www.brainjar.com/dhtml/menubar/ ... and read the tutorial on how to use and customize the menu. Any accompanying documentation is a violation as well, but I don't think this small explanation falls into that category. ;) For ease of use, it is advisable you use an external javascript file. I have called mine "menu.js" and saved the file in the directory "catalog/". Simply paste <script language="javascript" src="menu.js"></script> ... in all your main files residing in the directory "catalog/" right before the style sheet reference. NB: if you already use an js-file in all your documents, then cut and paste the code into that file to save time. Define the navigation file in "application_top.php" residing in "catalog/includes/" define('FILENAME_NAVIGATION', 'nav.php'); In the same directory you will find "header.php". Include the following code right before your main table: <?php include (DIR_WS_LANGUAGES . $language . '/' . FILENAME_NAVIGATION); ?> Finally you will have make the navigation file (nav.php) which contains the menus and submenus. How to build these is explained on BrainJar.com (the part with all the div-tags). Simply save all menu definitions in "nav.php" and make sure it resides in your languages directory, e.g. for english "catalog/includes/languages/english/". Note that you can have different dropdown menus for different languages. These you define in "nav.php". If you have any questions, you can send me an e-mail or pm. Take care, Richard
  2. Hi all :) Here is a payment module which I would call 'Online Money Order' or as the Dutch would say 'Online Eenmalige Machtiging'. This module is mainly for Dutch shops, but can be customised easily to fit your needs. In the Netherlands companies can apply for specific banking software. After approval from your bank you will be able to withdraw money from an account without the need of a user signature. Average transaction costs are 0.10 Euro, being a popular payment method with many shops in Holland. Consult your bank for more info. What you require to cash you money orders, are basically: - the name of the account holder; - the account number; - the city; - the bank. In the admin you can set this module for a particular zone, and you need to provide an e-mail where the information above will be sent to. I have decided not to store this information in the database. Below you will find the code for the different files. Many thanks to the guys who provided the community with the other payment modules. They deserve the credit :wink: Take care, Richard Save the code below as "omo.php" in "catalog/includes/modules/payment/": <?php /* $Id: omo.php, v1.0 2003/01/18 Online Money Order or Eenmalige Machtiging as we would call it in Holland. This module is for Dutch shops, which are approved by their bank and use the software provided by their bank to cash money orders without the need of a signature. Require the account holder, account number, city and bank. Information is sent by e-mail to the address you provide in admin area. Have fun, Richard (http://belladonna.has.it) osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ class omo { var $code, $title, $description, $enabled; // class constructor function omo() { $this->code = 'omo'; $this->title = MODULE_PAYMENT_OMO_TEXT_TITLE; $this->description = MODULE_PAYMENT_OMO_TEXT_DESCRIPTION; $this->enabled = ((MODULE_PAYMENT_OMO_STATUS == 'True') ? true : false); $this->email_footer = MODULE_PAYMENT_OMO_TEXT_EMAIL_FOOTER; } // Class methods function javascript_validation() { $jsvalidation = 'if (payment_value == "' . $this->code . '") {' . "n" . ' var rekeninghouder = document.checkout_payment.rekeninghouder.value;' . "n" . ' var rekeningnummer = document.checkout_payment.rekeningnummer.value;' . "n" . ' var plaats = document.checkout_payment.plaats.value;' . "n" . ' var instelling = document.checkout_payment.instelling.value;' . "n" . ' if (rekeninghouder.length == 0) {' . "n" . ' error_message = error_message + "' . MODULE_PAYMENT_OMO_TEXT_JS_REKENINGHOUDER . ' ";' . "n" . ' error = 1;' . "n" . ' }' . "n" . ' if (rekeningnummer.length < 3) {' . "n" . ' error_message = error_message + "' . MODULE_PAYMENT_OMO_TEXT_JS_REKENINGNUMMER . ' ";' . "n" . ' error = 1;' . "n" . ' }' . "n" . ' if (plaats.length == 0) {' . "n" . ' error_message = error_message + "' . MODULE_PAYMENT_OMO_TEXT_JS_PLAATS . ' ";' . "n" . ' error = 1;' . "n" . ' }' . "n" . ' if (instelling.length == 0) {' . "n" . ' error_message = error_message + "' . MODULE_PAYMENT_OMO_TEXT_JS_INSTELLING . '";' . "n" . ' error = 1;' . "n" . ' }' . "n" . '}' . "n"; return $jsvalidation; } function selection() { global $order, $HTTP_POST_VARS; $selection = array('id' => $this->code, 'module' => $this->title, 'fields' => array(array('title' => MODULE_PAYMENT_OMO_TEXT_REKENINGHOUDER, 'field' => tep_draw_input_field('rekeninghouder', $order->billing['firstname'] . ' ' . $order->billing['lastname'])), array('title' => MODULE_PAYMENT_OMO_TEXT_REKENINGNUMMER, 'field' => tep_draw_input_field('rekeningnummer')), array('title' => MODULE_PAYMENT_OMO_TEXT_PLAATS, 'field' => tep_draw_input_field('plaats')), array('title' => MODULE_PAYMENT_OMO_TEXT_INSTELLING, 'field' => tep_draw_input_field('instelling')))); return $selection; } function pre_confirmation_check() { return false; } function confirmation() { return false; } function process_button() { global $HTTP_POST_VARS; $process_button_string = tep_draw_hidden_field('rekeninghouder', $HTTP_POST_VARS['rekeninghouder']) . tep_draw_hidden_field('rekeningnummer', $HTTP_POST_VARS['rekeningnummer']) . tep_draw_hidden_field('plaats', $HTTP_POST_VARS['plaats']) . tep_draw_hidden_field('instelling', $HTTP_POST_VARS['instelling']); return $process_button_string; } function before_process() { return false; } function after_process() { global $HTTP_POST_VARS, $insert_id; if ( (defined('MODULE_PAYMENT_OMO_EMAIL')) && (tep_validate_email(MODULE_PAYMENT_OMO_EMAIL)) ) { $message = 'Order #' . $insert_id . "nn" . MODULE_PAYMENT_OMO_TEXT_EXTRA_INFO . "nn" . MODULE_PAYMENT_OMO_TEXT_REKENINGHOUDER . tep_db_prepare_input($HTTP_POST_VARS['rekeninghouder']) . "n" . MODULE_PAYMENT_OMO_TEXT_REKENINGNUMMER . tep_db_prepare_input($HTTP_POST_VARS['rekeningnummer']) . "n" . MODULE_PAYMENT_OMO_TEXT_PLAATS . tep_db_prepare_input($HTTP_POST_VARS['plaats']) . "n" . MODULE_PAYMENT_OMO_TEXT_INSTELLING . tep_db_prepare_input($HTTP_POST_VARS['instelling']); tep_mail('', MODULE_PAYMENT_OMO_EMAIL, 'Ad Order #' . $insert_id, $message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } } function get_error() { global $HTTP_GET_VARS; $error = array('title' => MODULE_PAYMENT_OMO_TEXT_ERROR, 'error' => stripslashes(urldecode($HTTP_GET_VARS['error']))); return $error; } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_OMO_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Online Money Order', 'MODULE_PAYMENT_OMO_STATUS', 'True', 'Do you want to accept online money orders?', '6', '0', 'tep_cfg_select_option(array('True', 'False'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone OMO', 'MODULE_PAYMENT_OMO_ZONE', '0', 'Enable this payment method for a particular zone.', '6', '2', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Send extra info to E-Mail address', 'MODULE_PAYMENT_OMO_EMAIL', '', 'E-mail address is required in order to receive Bank information', '6', '0', now())"); } function remove() { $keys = ''; $keys_array = $this->keys(); $keys_size = sizeof($keys_array); for ($i=0; $i<$keys_size; $i++) { $keys .= "'" . $keys_array[$i] . "',"; } $keys = substr($keys, 0, -1); tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")"); } function keys() { return array('MODULE_PAYMENT_OMO_STATUS', 'MODULE_PAYMENT_OMO_ZONE', 'MODULE_PAYMENT_OMO_EMAIL'); } } ?> For the dutch directory, save the code below as "omo.php" in "catalog/includes/languages/dutch/modules/payment/": <?php /* $Id: omo.php, v1.0 2003/01/18 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ define('MODULE_PAYMENT_OMO_TEXT_TITLE', 'Online eenmalige machtiging'); define('MODULE_PAYMENT_OMO_TEXT_DESCRIPTION', 'Het verschuldigde bedrag innen via bancaire software'); define('MODULE_PAYMENT_OMO_TEXT_REKENINGHOUDER', 'Rekeninghouder: '); define('MODULE_PAYMENT_OMO_TEXT_REKENINGNUMMER', 'Bank- of Girorekening: '); define('MODULE_PAYMENT_OMO_TEXT_PLAATS', 'Plaats: '); define('MODULE_PAYMENT_OMO_TEXT_INSTELLING', 'Bank: '); define('MODULE_PAYMENT_OMO_TEXT_JS_REKENINGHOUDER', 'Geen rekeninghouder ingevuld.'); define('MODULE_PAYMENT_OMO_TEXT_JS_REKENINGNUMMER', 'Ongeldig rekeningnummer ingevuld.'); define('MODULE_PAYMENT_OMO_TEXT_JS_PLAATS', 'Geen plaats ingevuld.'); define('MODULE_PAYMENT_OMO_TEXT_JS_INSTELLING', 'Geen bank ingevuld.'); define('MODULE_PAYMENT_OMO_TEXT_EXTRA_INFO', 'Additionele informatie:'); define('MODULE_PAYMENT_OMO_TEXT_EMAIL_FOOTER', 'Het totaalbedrag wordt automatisch van uw rekening afgeschreven.'); ?> For the english directory, you can save the code below as "omo.php" in "catalog/includes/languages/english/modules/payment/": <?php /* $Id: omo.php, v1.0 2003/01/18 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ define('MODULE_PAYMENT_OMO_TEXT_TITLE', 'Online Money Order'); define('MODULE_PAYMENT_OMO_TEXT_DESCRIPTION', 'Withdraw the order total via your banking software'); define('MODULE_PAYMENT_OMO_TEXT_REKENINGHOUDER', 'Account Holder: '); define('MODULE_PAYMENT_OMO_TEXT_REKENINGNUMMER', 'Account Number: '); define('MODULE_PAYMENT_OMO_TEXT_PLAATS', 'City: '); define('MODULE_PAYMENT_OMO_TEXT_INSTELLING', 'Bank: '); define('MODULE_PAYMENT_OMO_TEXT_JS_REKENINGHOUDER', 'No account holder.'); define('MODULE_PAYMENT_OMO_TEXT_JS_REKENINGNUMMER', 'No account number.'); define('MODULE_PAYMENT_OMO_TEXT_JS_PLAATS', 'No city.'); define('MODULE_PAYMENT_OMO_TEXT_JS_INSTELLING', 'No bank.'); define('MODULE_PAYMENT_OMO_TEXT_EXTRA_INFO', 'Additional Information:'); define('MODULE_PAYMENT_OMO_TEXT_EMAIL_FOOTER', 'The order total will be withdrawn automatically from your account.'); ?>
  3. This is one GREAT contribution :D ... dying to find out when it will be released. Is this version already available, because this would suffice for a lot of us ... :D Anyway, I have tested it throughout the admin section, and I don't think it could be more self-explanatory ... didn't come across any bugs, other than the one you found yourself. Personally, I think it would be a great feature to copy the attributes from one product to all products in a specific category, but I understand your hesitation, especially if the administrator isn't an experienced user ... one could mess up the shop completely. We could for instance use JavaScript or PHP to have him/her confirm his choice to copy a certain attribute to all the products in a category. Anyways, great work Linda ... as always :wink: Richard
  4. As Linda mentioned there was a field missing, thanks again :wink: For those interested, below are the adjustments that should be made. Check the original contributions for further details: - Quantity Controller v5.1 - Alternative Attribute Handling(5) Since the Quantity Controller adds an extra field to the products_attributes table, this should be incorporated too ... duh :oops: // Update Product Attributes // Add Sort Order field $rows = 0; $options_query = tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . $languages_id . "' order by products_options_name"); while ($options = tep_db_fetch_array($options_query)) { $values_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " p2p where pov.products_options_values_id = p2p.products_options_values_id and p2p.products_options_id = '" . $options['products_options_id'] . "' and pov.language_id = '" . $languages_id . "'"); while ($values = tep_db_fetch_array($values_query)) { $rows ++; $attributes_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix, products_options_sort_order from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $products_id . "' and options_id = '" . $options['products_options_id'] . "' and options_values_id = '" . $values['products_options_values_id'] . "'"); if (tep_db_num_rows($attributes_query) > 0) { $attributes = tep_db_fetch_array($attributes_query); if ($HTTP_POST_VARS['option'][$rows]) { if ( ($HTTP_POST_VARS['prefix'][$rows] <> $attributes['price_prefix']) || ($HTTP_POST_VARS['price'][$rows] <> $attributes['options_values_price']) || ($HTTP_POST_VARS['sort_order'][$rows] <> $attributes['products_options_sort_order']) ) { tep_db_query("update " . TABLE_PRODUCTS_ATTRIBUTES . " set options_values_price = '" . $HTTP_POST_VARS['price'][$rows] . "', price_prefix = '" . $HTTP_POST_VARS['prefix'][$rows] . "', products_options_sort_order = '" . $HTTP_POST_VARS['sort_order'][$rows] . "' where products_attributes_id = '" . $attributes['products_attributes_id'] . "'"); } } else { tep_db_query("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_attributes_id = '" . $attributes['products_attributes_id'] . "'"); } } elseif ($HTTP_POST_VARS['option'][$rows]) { tep_db_query("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " values ('', '" . $products_id . "', '" . $options['products_options_id'] . "', '" . $values['products_options_values_id'] . "', '" . $HTTP_POST_VARS['price'][$rows] . "', '" . $HTTP_POST_VARS['prefix'][$rows] . "', '" . $HTTP_POST_VARS['sort_order'][$rows] . "')"); } } } Finally, add corresponding textfield for input <?php $rows = 0; $options_query = tep_db_query("select products_options_id, products_options_name from " . TABLE_PRODUCTS_OPTIONS . " where language_id = '" . $languages_id . "' order by products_options_name"); while ($options = tep_db_fetch_array($options_query)) { $values_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov, " . TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS . " p2p where pov.products_options_values_id = p2p.products_options_values_id and p2p.products_options_id = '" . $options['products_options_id'] . "' and pov.language_id = '" . $languages_id . "'"); $header = false; while ($values = tep_db_fetch_array($values_query)) { $rows ++; if (!$header) { $header = true; ?> <td><table border="0" cellpadding="2" cellspacing="0"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" colspan="4"><?php echo $options['products_options_name']; ?></td> </tr> // added extra row which shows what the textfields stand for <tr bgcolor="#000000"> <td class="dataTableHeadingContent">(un)check</td> <td class="dataTableHeadingContent">prefix</td> <td class="dataTableHeadingContent">price</td> <td class="dataTableHeadingContent">rank</td> </tr> <?php } $attributes = array(); if (sizeof($HTTP_POST_VARS) > 0) { if ($HTTP_POST_VARS['option'][$rows]) { $attributes = array('products_attributes_id' => $HTTP_POST_VARS['option'][$rows], 'options_values_price' => $HTTP_POST_VARS['price'][$rows], 'price_prefix' => $HTTP_POST_VARS['prefix'][$rows], 'products_options_sort_order' => $HTTP_POST_VARS['sort_order'][$rows]); } } else { $attributes_query = tep_db_query("select products_attributes_id, options_values_price, price_prefix, products_options_sort_order from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . $pInfo->products_id . "' and options_id = '" . $options['products_options_id'] . "' and options_values_id = '" . $values['products_options_values_id'] . "'"); if (tep_db_num_rows($attributes_query) > 0) { $attributes = tep_db_fetch_array($attributes_query); } } ?> <tr class="dataTableRow"> <td class="dataTableContent"><?php echo tep_draw_checkbox_field('option[' . $rows . ']', $attributes['products_attributes_id'], $attributes['products_attributes_id']) . ' ' . $values['products_options_values_name']; ?> </td> <td class="dataTableContent"><?php echo tep_draw_input_field('prefix[' . $rows . ']', $attributes['price_prefix'], 'size="2"'); ?></td> <td class="dataTableContent"><?php echo tep_draw_input_field('price[' . $rows . ']', $attributes['options_values_price'], 'size="7"'); ?></td> <td class="dataTableContent"><?php echo tep_draw_input_field('sort_order[' . $rows . ']', $attributes['products_price_sort_order'], 'size="2"'); ?></td> </tr> <?php } if ($header) { ?> </table></td> <?php } } ?> Good luck! :D
  5. Thanks ... guess it's the extra field from the quantity controller? (since the product_attributes_table is altered) Will repost ... whether I have any luck :D or not :cry:
  6. Both contributions seperately work just fine, but when merged together I keep getting the following error: :crazy: --------------------------------------------------------------------- 1136 - Column count doesn't match value count at row 1 insert into products_attributes values ('', '57', '4', '25', '', '') [TEP STOP] --------------------------------------------------------------------- Anyone had any luck with combining: - Quantitiy Controller v5.1; - Alternative attributehandling(5). ... it's getting late and I can't see straight :rockedover:
  7. belladonna

    Quantity Discount & Attributes

    Luckily I don't have the problem you guys are facing:), but a solution (for the time being) would be to tell the customer to add the total amount they want, and specify different features in the comment box during checkout. At least they won't complain about the 'wrong' price then :lol:
  8. belladonna

    Quantity Discount & Attributes

    Thanks for your response Linda.:) ... and the great contribution, btw :wink:
  9. belladonna

    Quantity Discount & Attributes

    I am just curious to whether this issue has been resolved or not?
×