Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Change the Coupon code to description

    Hi,
    Can I display the 'coupon description' instead of the 'coupon code' in the:

    1. Order Information detail page (Account History Info).
    2. in the email that the customer get after he made an order

    (Especially in the occurrences i describe above but also in all the places the customer can see it)

    Thank you!

  2. #2
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Re: Change the Coupon code to description

    Anyone? please.

  3. #3
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Re: Change the Coupon code to description

    All I'm asking is how I'm showing to my buyer the "coupun description" or at least the "coupon name" instead of the coupon code in the order confirmation email and in the order history info page???? please...

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Change the Coupon code to description

    Sorry we are not as fast as you like to write the custom code for you but sometimes ...

    1 we are not here 24/7

    2 it takes quite some time to write the custom code

    See if this works if you customize the order class code with:
    Code:
        //comments area
        if ($this->info['comments']) {
          $email_order .= zen_db_output($this->info['comments']) . "\n\n";
          $html_msg['ORDER_COMMENTS'] = nl2br(zen_db_output($this->info['comments']));
        } else {
          $html_msg['ORDER_COMMENTS'] = '';
        }
    
    // bof: add coupon_description here
        global $db;
        $chk_coupon_code_query = "SELECT coupon_code
                      from " . TABLE_ORDERS . "
                      where orders_id ='" . $zf_insert_id . "'";
        $chk_coupon_code = $db->Execute($chk_coupon_code_query);
    
        $chk_coupon_id_query = "SELECT coupon_id
                      from " . TABLE_COUPONS . "
                      where coupon_code ='" . $chk_coupon_code->fields['coupon_code'] . "'";
        $chk_coupon_id = $db->Execute($chk_coupon_id_query);
    
        $chk_coupon_description_query = "SELECT coupon_description
                      from " . TABLE_COUPONS_DESCRIPTION . "
                      where coupon_id ='" . $chk_coupon_id->fields['coupon_id'] . "'";
        $chk_coupon_description = $db->Execute($chk_coupon_description_query);
    
        if ($chk_coupon_description->fields['coupon_description']) {
          // if found add to the comments
          $email_order .= 'Discount code should be: ' . $chk_coupon_code->fields['coupon_code'] . "\n\n" . zen_db_output($chk_coupon_description->fields['coupon_description']) . "\n\n";
          $html_msg['ORDER_COMMENTS'] .= nl2br(zen_db_output($chk_coupon_description->fields['coupon_description']));
        }
    // eof: add coupon_description here
    
        //products area
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Re: Change the Coupon code to description

    First, Sorry!
    Second Thank you!!
    (I guess I got a little bit swept away by my haste...)

    I will check it and update you.

  6. #6
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Re: Change the Coupon code to description

    Thaks,
    1. The coupon code still appear in the Order confirmation email. How can I remove it?
    2. How can I replace it also with the coupon description in the Order Information page (account_history_info)?

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Change the Coupon code to description

    You would need to customize the Discount Coupon Order Total module ot_coupon.php

    I believe the section of code you want to change would be:
    Code:
          $this->output[] = array('title' => $this->title . ': ' . $this->coupon_code . ' :',
                                  'text' => '-' . $currencies->format($od_amount['total']),
                                  'value' => $od_amount['total']);
    NOTE: removing that from the code will remove it from display on the order in the Customers ... Orders ... and it will remove it from the Customer's Account when review the order ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Re: Change the Coupon code to description

    Thanks Ajeh,
    As you said removing it removes it from all other places,

    Is there any way to replace the $this->coupon_code with $this->coupon_description in the above code?

    I want to show the buyer the coupon description and not the coupon code.

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Change the Coupon code to description

    What would happen is you would have the Totals section of the order displaying the Discount Coupon Description right in the middle ...

    Currently ...

    In the Order, the Store Owner can click on the link for the Discount Coupon for a popup for the description ...

    On the My Account the Customer can click on the link for the Discount Coupon to get a popup with the description ...

    The Customer can go to the Information box and click on a link for the Discount Coupons and get a page with the description ...

    In the email, just the Discount Coupon code is displayed in the Totals section of the Order email ...

    Adding the Discount Coupon description in the middle of the Order Totals is going to make things very difficult to read ...

    This is why I suggest adapting the email that is being sent out where you can add the code I posted somewhere in the email to give the summary in a clear and concise manner so as not to confuse the Customer or cause confusion on lost of information in the Admin Order for the Store Owner ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #10
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Re: Change the Coupon code to description

    Ok. Got it.
    But how can i display also the Discount Coupon description in the ot_coupon.php (account history info - the order Information page)?

    Thanks.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 List the coupon code on the invoice
    By cyberfolli in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 14 Dec 2013, 08:14 PM
  2. Hiding the coupon code box?
    By kinkyropes in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 12 Oct 2008, 10:41 PM
  3. Hiding the coupon code box...
    By aaelghat in forum General Questions
    Replies: 3
    Last Post: 22 Sep 2008, 06:11 PM
  4. How to Change "Redemption Code" to "Coupon Code" & "GV Code"
    By dmfelder in forum Basic Configuration
    Replies: 5
    Last Post: 16 Apr 2008, 05:50 PM
  5. How do I change the Coupon code in the welcome email?
    By kaety in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 4 Sep 2007, 05:29 AM

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