raindays Posted December 29, 2005 Share Posted December 29, 2005 I have customers passing right by the options of the products and going directly to the payment area I recieve payment without knowing what they ordered. How do I stop this from happening? I would appreciate any help, thanks. Link to comment Share on other sites More sharing options...
Wizard Posted December 29, 2005 Share Posted December 29, 2005 If you want to force your customers to select an option from your product options menu, you could use a contribution I uploaded today(Enforce Attribute Select) - you can find it at http://www.oscommerce.com/community/contributions,3891 Hope this helps. Who would have thought that so much can be created from 0`s and 1`s... Link to comment Share on other sites More sharing options...
raindays Posted December 29, 2005 Author Share Posted December 29, 2005 Thank you very much. I will do my best to install it. I'll be back :) Link to comment Share on other sites More sharing options...
raindays Posted December 29, 2005 Author Share Posted December 29, 2005 Well due to my vast experience with this cart (<-- insert sarcasm here) The product_info.php page is now coming up blank/empty. Is this a permissions problem or something else? Link to comment Share on other sites More sharing options...
Wizard Posted December 29, 2005 Share Posted December 29, 2005 No, you don't need to change any permissions. Can you paste your product_info.php page here so I will see how you edited the code? Who would have thought that so much can be created from 0`s and 1`s... Link to comment Share on other sites More sharing options...
Sid04 Posted January 1, 2006 Share Posted January 1, 2006 not trying to hijack your thread...but maybe you can help http://www.oscommerce.com/forums/index.php?sho...31entry768231 trying to figure out how to set the default attribute option related to the contribution you are discussing. Link to comment Share on other sites More sharing options...
Wizard Posted January 1, 2006 Share Posted January 1, 2006 not trying to hijack your thread...but maybe you can help http://www.oscommerce.com/forums/index.php?sho...31entry768231 trying to figure out how to set the default attribute option related to the contribution you are discussing. See my reply in that thread Who would have thought that so much can be created from 0`s and 1`s... Link to comment Share on other sites More sharing options...
macsurf Posted June 11, 2006 Share Posted June 11, 2006 I'm all ready checking a script to make sure something else was checked before adding to the cart I've got the check_conditions and now the validate script. <script language="javascript" type="text/javascript"><!-- function check_conditions() { if( document.forms["cart_quantity"].products_accept && document.forms["cart_quantity"].products_accept.checked == false ) { alert("You must agree to the terms and conditions to add this product to your cart"); return false; } return true; } //--></script> <script language="javascript"><!-- // az - Start Enforce Attribute Select function validate() { if (cart_quantity.elements['id[1]'].value == 5) { alert('Please select an option for the menu.'); cart_quantity.elements['id[1]'].focus(); return false; } } // az - End Enforce Attribute Select //--></script> is there a way to make both scripts work together? <?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 check_conditions();"'); ?> <?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(this);"'); ?> . Link to comment Share on other sites More sharing options...
Wizard Posted June 12, 2006 Share Posted June 12, 2006 Since you can call only one function in the onSubmit you will need to join both functions into one. You could try doing the following for example: <script language="javascript" type="text/javascript"><!-- function check_conditions() { if( document.forms["cart_quantity"].products_accept && document.forms["cart_quantity"].products_accept.checked == false ) { alert("You must agree to the terms and conditions to add this product to your cart"); return false; } else if (cart_quantity.elements['id[1]'].value == 5) { alert('Please select an option for the menu.'); cart_quantity.elements['id[1]'].focus(); return false; } return true; } //--></script> and have the body of the file have the following code <?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 check_conditions(this);"'); ?> I haven't tested the above code so I'm not sure if it needs any additional tweaking to make it work, but at least you'll have a direction as to how to modify the script. Who would have thought that so much can be created from 0`s and 1`s... Link to comment Share on other sites More sharing options...
macsurf Posted June 12, 2006 Share Posted June 12, 2006 That worked great. Thank you very much! Now one more quick question. In some case I have more then one option for them to choose. Would I just add a new check like this? <script language="javascript" type="text/javascript"><!-- function check_conditions() { if( document.forms["cart_quantity"].products_accept && document.forms["cart_quantity"].products_accept.checked == false ) { alert("You must agree to the terms and conditions to add this product to your cart"); return false; } else if (cart_quantity.elements['id[1]'].value == 5) { alert('Please select an option for the menu.'); cart_quantity.elements['id[1]'].focus(); return false; } else if (cart_quantity.elements['id[2]'].value == 6) { alert('Please select an option for the menu.'); cart_quantity.elements['id[2]'].focus(); return false; } return true; } //--></script> Link to comment Share on other sites More sharing options...
macsurf Posted June 12, 2006 Share Posted June 12, 2006 Well I went ahead and tried it and it worked! Thanks again for your help! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.