Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Discount Coupon Codes not accepting NULL entry...


exodar

Recommended Posts

Everything with the "Discount Coupon Codes" contribution works perfectly except when you try to checkout a normal order without a coupon code. Here is the contribution I am working with:

 

http://www.oscommerce.com/community/contributions,4269

 

The checkout_payment.php asks for a Coupon Code if you have one. However, if you leave this field blank and attempt to continue to the checkout_confirmation.php screen, it just returns you back to the checkout_payment.php screen with no error message. According to the code in checkout_confirmation.php it is using the tep_not_null() function to see if the coupon field is emtpy before continuing as normal:

 

if( tep_not_null($HTTP_POST_VARS['coupon']) ) { //if they have entered something in the coupon field

 

However it does not appear to work properly. As I stated above, instead of just continuing on with the checkout_confirmation.php as normal without a discount, it just reverts me back to checkout_payment.php. Here is the function from general.php if it helps:

 

function tep_not_null($value) {

if (is_array($value)) {

if (sizeof($value) > 0) {

return true;

} else {

return false;

}

} else {

if (($value != '') && (strtolower($value) != 'null') && (strlen(trim($value)) > 0)) {

return true;

} else {

return false;

}

}

}

 

Any help would be greatly appreciated!!

 

Thanks...

ROB

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...