Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2008
    Location
    Rimini, Italy
    Posts
    54
    Plugin Contributions
    0

    Default Spaces problem in bad coupon notification

    Whenever I try to use a coupon not valid because of some restrictions previously set I receive this notification:

    Code:
    This%20coupon%20code%20is%20not%20valid%20for%20any%20product%20currently%20in%20your%20cart.
    That comes from languages/CUSTOM_TEMPLATE/english.php:

    define('TEXT_INVALID_COUPON_PRODUCT', 'This coupon code is not valid for any product currently in your cart.');

    Other notifications, as the coupon success one, coming from same define file are correctly visualized with spaces, and not with "%20".

    Is it a known bug? I cannot find any news about it.

  2. #2
    Join Date
    Dec 2008
    Location
    Rimini, Italy
    Posts
    54
    Plugin Contributions
    0

    Default Re: Spaces problem in bad coupon notification

    I've just found in /includes/modules/order_total/ot_coupon.php:

    PHP Code:
    if (!$foundvalidzen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT'credit_class_error_code=' $this->code '&credit_class_error=' urlencode(TEXT_INVALID_COUPON_PRODUCT ' ' $dc_check), 'SSL',truefalse)); 
    So I think it's the urlencode() function that changes spaces to %20
    Every other notification use messageStack way....not this one....

    So I found the "WHERE", can you please show me the "WHY"? :)

  3. #3
    Join Date
    Dec 2008
    Location
    Rimini, Italy
    Posts
    54
    Plugin Contributions
    0

    Default Re: Spaces problem in bad coupon notification

    I actually patched /includes/modules/order_total/ot_coupon.php as below changing:

    PHP Code:
    if (!$foundvalidzen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT'credit_class_error_code=' $this->code '&credit_class_error=' urlencode(TEXT_INVALID_COUPON_PRODUCT ' ' $dc_check), 'SSL',truefalse)); 
    to

    PHP Code:
    if (!$foundvalid) {
             
    $messageStack->add_session('checkout_payment'TEXT_INVALID_COUPON_PRODUCT'error');
             
    $this->clear_posts();
             
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT'''SSL',truefalse));
           } 
    Anyway, I hope someone (ajeh? dr.byte? anyone else?) tell me if that's wrong, dangerous or simply stupid. (I followed other error messages convention :)

    Thanks

 

 

Similar Threads

  1. Coupon notification email
    By jbillens in forum Managing Customers and Orders
    Replies: 0
    Last Post: 28 Sep 2009, 08:22 PM
  2. white spaces problem in header
    By Didee in forum Basic Configuration
    Replies: 1
    Last Post: 28 Jan 2009, 01:35 PM
  3. problem with order notification emails
    By DTB in forum General Questions
    Replies: 7
    Last Post: 12 Jul 2007, 05:43 AM
  4. cannot send session - php spaces problem (I think)
    By retro-haven in forum Installing on a Windows Server
    Replies: 2
    Last Post: 26 Oct 2006, 11:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •