Page 1 of 2 12 LastLast
Results 1 to 10 of 23

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Posts
    14
    Plugin Contributions
    0

    red flag Customizing Checkout Success Page Note based on Payment Method?

    Hi, wonder if anyone have any clue how to customize the checkout_sucess page so that different messages can be display upon completing final step - Confirm the Order - based on the payment method processed.

    E.g.

    1. If the Payment Method = Cheque / Money Order
    Message: Your order has been received. Please note that your order will be delivered upon confirmation of payment. Please ensure you quote your order number when making payment.

    2. If the Payment Method = Express Check out with Paypal
    Message: Your order has been received and payment confirmed. Your order will be processed for shipment the next working day.

    3. If the Payment Method = Cash on Delivery
    Message: Your order has been received. We will be in touch with you by the next working day to arrange your delivery appointment.

    Thanks in advance.

    dcmall

  2. #2
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Customizing Checkout Success Page Note based on Payment Method?

    You'd need to set a session variable in the checkout_process header_php.php before the unset() of session-payment information.

    Then read that session variable in the checkout_success header_php.php, and then unset that session variable after reading its value.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jul 2007
    Posts
    14
    Plugin Contributions
    0

    red flag Re: Customizing Checkout Success Page Note based on Payment Method?

    DrByte,

    How to I set a session variable in checkout_process header_php.php and how do I read the session variable in the checkout_success header_php.php?

    I know where to open the two files, but when it comes to coding, I really do not know how to set and read the session variable for the above said purpose.

    I know nuts of php. Appreciate if you could give some guidance.

    Looking forward to your prompt guidance...

  4. #4
    Join Date
    Aug 2007
    Location
    Eugene, OR
    Posts
    162
    Plugin Contributions
    0

    Default Re: Customizing Checkout Success Page Note based on Payment Method?

    I also need to do the same. I have searched the forum and found 10 different threads about this topic, but none of them has a real answer. Dr Byte's answer above is the closest I have found, but it sounds very technical, i.e. over my head!

    Any help on this would be greatly appreciated. Please explain in terms suitable for IQ80 reader such as myself.

    Thanks

  5. #5
    Join Date
    Aug 2007
    Location
    Eugene, OR
    Posts
    162
    Plugin Contributions
    0

    red flag Re: Customizing Checkout Success Page Note based on Payment Method?

    Well, I guess I should have just stopped, but I decided to try Dr Byte's instructions. I tried to add a register variable command in the checkout_process header file and an unregister in the checkout_success header file. It did not seem to work since the success page would not appear then. So then I restored my original files, BUT the cart now seems to be broken! The success page will simply not appear (although it worked perfectly before my attempted changes).

    I really am in a state of panic and simultaneous depression now. I just don't know what to do to fix this. The order still is placed and the email is received by both the store owner and the customer and the order is logged into the databse, BUT the success page will not appear.

    Could it be something has been messed up in the database due to my experiments???

    I have a backup of the database and could restore it if I knew how. But I am afraid to even try this for fear of making things even worse.

    Help!

    www.westec-beauty dot com/shop/

  6. #6
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Customizing Checkout Success Page Note based on Payment Method?

    How exactly did you make your changes?
    Did you add any new files?
    How exactly did you "undo" the changes?
    Did you delete any new files you added?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Customizing Checkout Success Page Note based on Payment Method?

    Quote Originally Posted by dcmall View Post
    Hi, wonder if anyone have any clue how to customize the checkout_sucess page so that different messages can be display upon completing final step - Confirm the Order - based on the payment method processed.

    E.g.

    1. If the Payment Method = Cheque / Money Order
    Message: Your order has been received. Please note that your order will be delivered upon confirmation of payment. Please ensure you quote your order number when making payment.

    2. If the Payment Method = Express Check out with Paypal
    Message: Your order has been received and payment confirmed. Your order will be processed for shipment the next working day.

    3. If the Payment Method = Cash on Delivery
    Message: Your order has been received. We will be in touch with you by the next working day to arrange your delivery appointment.

    Thanks in advance.

    dcmall
    Quote Originally Posted by DrByte View Post
    You'd need to set a session variable in the checkout_process header_php.php before the unset() of session-payment information.

    Then read that session variable in the checkout_success header_php.php, and then unset that session variable after reading its value.
    Quote Originally Posted by dcmall View Post
    DrByte,

    How to I set a session variable in checkout_process header_php.php and how do I read the session variable in the checkout_success header_php.php?

    I know where to open the two files, but when it comes to coding, I really do not know how to set and read the session variable for the above said purpose.

    I know nuts of php. Appreciate if you could give some guidance.

    Looking forward to your prompt guidance...


    Perhaps you'll consider making a donation to the Zen Cart project for this custom code:

    1. edit /includes/modules/pages/checkout_process/header_php.php
    Add the slashes, as shown:
    Code:
    //  unset($_SESSION['payment']);
    2. edit /includes/modules/pages/checkout_success/header_php.php
    after this:
    Code:
    // if the customer is not logged on, redirect them to the shopping cart page
    if (!$_SESSION['customer_id']) {
      zen_redirect(zen_href_link(FILENAME_TIME_OUT));
    }
    SCRATCH THAT ... look for this instead:
    Code:
    require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
    and add this below it:
    Code:
      $payment_instructions_message = 'Thank you for your order';
      if (defined('TEXT_PAYMENT_MESSAGE_' . strtoupper($_SESSION['payment']) ))  $payment_instructions_message = constant('TEXT_PAYMENT_MESSAGE_' . strtoupper($_SESSION['payment']) );
      unset($_SESSION['payment']);
    3. Edit /includes/languages/english/YOURTEMPLATE/checkout_success.php
    Add new defines for each of your required payment modules, following the pattern:
    Code:
    define('TEXT_PAYMENT_MESSAGE_MONEYORDER', 'Your order has been received. Please note that your order will be delivered upon confirmation of payment. Please ensure you quote your order number when making payment.');
    define('TEXT_PAYMENT_MESSAGE_PAYPALWPP', 'Your order has been received and payment confirmed. Your order will be processed for shipment the next working day.');
    define('TEXT_PAYMENT_MESSAGE_COD', 'Your order has been received. We will be in touch with you by the next working day to arrange your delivery appointment.');
    4. edit /includes/templates/YOURTEMPLATE/templates/tpl_checkout_success_default.php
    find this:
    Code:
    <div id="checkoutSuccessOrderNumber"><?php echo TEXT_YOUR_ORDER_NUMBER . $zv_orders_id; ?></div>
    add this on a line below it:
    Code:
    <div id="checkoutSuccessMessage"><?php echo $payment_instructions_message; ?></div>
    Last edited by DrByte; 2 Sep 2007 at 03:47 AM. Reason: correction to step 2
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Aug 2007
    Location
    Eugene, OR
    Posts
    162
    Plugin Contributions
    0

    Default Re: Customizing Checkout Success Page Note based on Payment Method?

    The custom coding is not working for me...it just shows the default text "Thank you for your order". It seems as if the "if" statement in checout_success/header_php.php is never satisfied.

    I have checked all the files and code and have confirmed that they match Dr Bytes suggestion. But still, it just shows the default response.

    Not sure where to even start looking to solve this problem or to test it step by step. Any ideas?

  9. #9
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Customizing Checkout Success Page Note based on Payment Method?

    Quote Originally Posted by thomasw98 View Post
    The custom coding is not working for me...it just shows the default text "Thank you for your order". It seems as if the "if" statement in checout_success/header_php.php is never satisfied.

    I have checked all the files and code and have confirmed that they match Dr Bytes suggestion. But still, it just shows the default response.

    Not sure where to even start looking to solve this problem or to test it step by step. Any ideas?
    Hmmm ... Slight change to step #2 ... instead of putting it near the top, put it down around line 38 ... specifically *after* this line:
    Code:
    require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Aug 2007
    Location
    Eugene, OR
    Posts
    162
    Plugin Contributions
    0

    Default Re: Customizing Checkout Success Page Note based on Payment Method?

    Quote Originally Posted by DrByte View Post
    Hmmm ... Slight change to step #2 ... instead of putting it near the top, put it down around line 38 ... specifically *after* this line:
    Code:
    require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
    Well, that sorta works but not quite...here's what happens now:

    Test order a product. Select payment method (for this example, COD), continue, then confirm the order, wait while it tries to reach success..but no, it errors out. Can not display page. But the order has been booked into the system properly and the email to the store owner and the customer are both successfully sent.

    Go back to index page. Cart is empty. Pick a product and checkout. On the select payment type page, the radio button for COD is already selected! click continue, then confirm order. Wait. Yes, it is successful...but only sometimes (that's the part that annoys me...inconsistent error behavior ). Either way, whether success page is displayed or not, the order has been recorded and emails sent out properly.

    Cycling through it again and again, sometimes the radio button is already selected (it is always the same as your last order) and sometimes not.

    Pretty weird behavior

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. shipping method based on payment method?
    By psr racing in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 27 Apr 2011, 01:25 PM
  2. Customizing Checkout Success Page Note based on Product Purchased
    By redknights11 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 29 Mar 2009, 07:26 AM
  3. Replies: 9
    Last Post: 13 Dec 2007, 04:45 PM
  4. Customizing checkout success page
    By s_p_ike in forum Addon Payment Modules
    Replies: 2
    Last Post: 16 Oct 2006, 02:59 PM

Posting Permissions

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