Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Ben700

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Ben700

  1. in locate-us.php on line 40 replace: - $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_EASYMAP)); with $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_LOCATE_US)); This will fix the breadcrumb linking to the admin easymap.php from the catalog locate-us.php page. Ben
  2. I've needed a validation script for this addon. I used Jeffs code but fixed the SQL so it works for all products not just the first one... Ben When you create the form you'll need to add a onSubmit function like this: - <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product'), 'post', 'onSubmit="return validate_me(this);"'); ?> Then the javascript is <script language="javascript"><!-- function validate_me(myform) { <?php // jeff added this stuff for radio button validation $products_verification_query = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " popt , " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and popt.products_options_type='3'"); // loop through each option type that has radio buttons while ($products_verification_array = tep_db_fetch_array($products_verification_query)) { ?> myOption = -1; // loop through each element of the radio set for (i=cart_quantity.elements['<?php echo 'id[' . $products_verification_array['products_options_id'] . ']'; ?>'].length-1; i > -1; i--) { if (cart_quantity.elements['<?php echo 'id[' . $products_verification_array['products_options_id'] . ']'; ?>'].checked) { myOption = i; i = -1; } } if (myOption == -1) { cart_quantity.elements['<?php echo 'id[' . $products_verification_array['products_options_id'] . ']'; ?>'][0].focus(); var alertvar = "You must make a selection from the '<?php echo $products_verification_array['products_options_name'];?>' group."; alert(alertvar); return false; } <?php } // Ben added this stuff for text field validation $products_verification_query = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " popt , " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and popt.products_options_type in ('1', '2')"); // loop through each option type that has radio buttons while ($products_verification_array = tep_db_fetch_array($products_verification_query)) { ?> if (cart_quantity.elements['<?php echo 'id[txt_' . $products_verification_array['products_options_id'] . ']'; ?>'].value == "") { var alertvar = "You must answer the question'<?php echo $products_verification_array['products_options_name'];?>'."; alert(alertvar); return false; } <?php } // Ben added this stuff for checkbox validation $products_verification_query = tep_db_query("select * from " . TABLE_PRODUCTS_OPTIONS . " popt , " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' and popt.products_options_type = '4'"); // loop through each option type that has radio buttons while ($products_verification_array = tep_db_fetch_array($products_verification_query)) { ?> if (cart_quantity.elements['<?php echo 'id[' . $products_verification_array['products_options_id'] . ']'; ?>'].checked != 1) { var alertvar = "You must answer the question'<?php echo $products_verification_array['products_options_name'];?>'."; alert(alertvar); return false; } <?php } ?> } //--></script>
  3. Then I try to set the option "Type" to product_info I get some style issues westsideclothing.co.uk/alpha/product_info.php?products_id=127 If I set the option to popup the page is displayed like normal. i.e. navigation aligned with background. Thanks Ben
×
×
  • Create New...