Dominos Posted January 8, 2005 Posted January 8, 2005 Hi, I need to check the basket just before customer can checkout (when he clicks in checkout button), with a javascript and show a message if the total sum quantity money is less than a number. I have the javascript but dont know how can do it and where in the code. Thx
boxtel Posted January 8, 2005 Posted January 8, 2005 Hi, I need to check the basket just before customer can checkout (when he clicks in checkout button), with a javascript and show a message if the total sum quantity money is less than a number. I have the javascript but dont know how can do it and where in the code. Thx <{POST_SNAPBACK}> what about the people who have javascript disabled ? Treasurer MFC
Simmy Posted January 8, 2005 Posted January 8, 2005 what about the people who have javascript disabled ? <{POST_SNAPBACK}> There's already javascript in osc so I wouldn't worry about that. There's not many websites that don't use javascript.
boxtel Posted January 8, 2005 Posted January 8, 2005 There's already javascript in osc so I wouldn't worry about that. There's not many websites that don't use javascript. <{POST_SNAPBACK}> true but most professional websites have alternatives for when customers do not use javascript. besides, there is no need for it since the subtotal is already known by php in the cart. Treasurer MFC
Simmy Posted January 8, 2005 Posted January 8, 2005 Are you wanting to stop the customer from buying or add a surcharge?? There are shipping modules that will allow you to charge different rates for different order values?
Dominos Posted January 8, 2005 Author Posted January 8, 2005 Hi again, first, i have to say that my website is not public, is an ecommerce intranet website with authorized users only ( about 30 or so). The ecommerce have been modified as an intermediary between customers (departaments) and external providers through email. All prices have taxes included, and pay is made between departaments and providers. what about the people who have javascript disabled ? The people who have js disable maybe cant buy, so they must enable it. Ive think in something like that but really dont know how: <td width="100%" valign="top"><?php echo tep_draw_form('check_cart', tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL'), 'post', [b]'onSubmit="return my_javascript(param1,param2);"[/b]'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0"> Or something like javascript check in create_account.php thx
Dominos Posted January 8, 2005 Author Posted January 8, 2005 Are you wanting to stop the customer from buying? Yes, definitely that is my need. :D
Simmy Posted January 8, 2005 Posted January 8, 2005 I don't have time to look and see how to do it but you'd be best to make the check before the checkout procedure. I.e. as a function run from the 'go to checkout' button or a check on the first checkout page which will redirect the user back if there's not enough in their basket. You'll just piss them off if they get to the confirmation page then get rejected.
Simmy Posted January 8, 2005 Posted January 8, 2005 OK sorry for the previous unhelpful reply! This is what I'd do. It's really simple! In checkout_shipping.php (or whatever your first checkout page is) you'll find little bits of php that check there's actually something in the cart: if ($cart->count_contents() < 1) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } Just under this put something like: if ($cart->show_total() < 25.00) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } where 25.00 is the minimum order value. This will redirect them back to their cart but you'll need to add a message somehow. (javascript popup maybe?)
Dominos Posted January 8, 2005 Author Posted January 8, 2005 Yes, very simple. :blink: . Thank U mate, problem solved. Very easy and better than only js. :thumbsup: OK sorry for the previous unhelpful reply! This is what I'd do. It's really simple! In checkout_shipping.php (or whatever your first checkout page is) you'll find little bits of php that check there's actually something in the cart: ?if ($cart->count_contents() < 1) { ? ?tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); ?} Just under this put something like: ? ?if ($cart->show_total() < 25.00) { ? ?tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); ?} where 25.00 is the minimum order value. This will redirect them back to their cart but you'll need to add a message somehow. (javascript popup maybe?) <{POST_SNAPBACK}>
Recommended Posts
Archived
This topic is now archived and is closed to further replies.