Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2008
    Posts
    9
    Plugin Contributions
    0

    Default Hiding the coupon code box?

    Mods, please move thread if Im not asking in the correct forum .....

    I am trying to set up a 'secret location' for entering the cupon code. I do now want the box with all that information and the entry box+button to show up just on the checkout page. I want to split it off onto a page all by itself.

    If you ever listen to any radio advertising and have heard the blurb 'Go to our webpage and click on the radio microphone button and enter promo code blahblahblah' then you know what Im talking about. Anyone I would give the coupon code to I would also tell special instructions on how to get to the page where they can enter the coupon. The ~secret~ link I can program in on my own, but I dont know how to generate the cupon code to be anyplace else besides the checkout page.

    If the whole thing is impossible and im just chasing rainbows, would it at least be possible to code some kind of expand/collapse function so that the coupon code only takes up a single line of the checkout page until you click on it?

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

    Default Re: Hiding the coupon code box?

    The Discount Coupon code has to be entered during the checkout ...

    Even if it is a secret, why not leave it there as only those customers in the know will know what to enter ...
    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!

  3. #3
    Join Date
    Feb 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Hiding the coupon code box?

    Quote Originally Posted by Ajeh View Post

    Even if it is a secret, why not leave it there as only those customers in the know will know what to enter ...
    Mostly because of clutter. But also because of conversion rate. See http://www.google.com/analytics/cu/a...fore_test.html

    At the very least, I would like to move the coupon code down some so that users without a coupon code wont have to scroll down the page in order to enter their info. That should be a simple matter of rearranging the cude blocks at the appropriate place but Im not sure what file those code blocks are located in.

  4. #4
    Join Date
    Feb 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Hiding the coupon code box?

    Scratch that. I found it.

    In case anyone else years from now should stumble across this thread while searching for the same thing, hre is what I did.

    First of all, take the file /public_html/store/includes/templates/template_default/templates/tpl_checkout_payment_default.php and make a copy of it in /public_html/store/includes/templates/YOURTEMPLATENAME/templates. Then edit the copy as folows .....

    move the block of code
    PHP Code:
    <?php
      $selection 
    =  $order_total_modules->credit_selection();
      if (
    sizeof($selection)>0) {
        for (
    $i=0$n=sizeof($selection); $i<$n$i++) {
          if (
    $_GET['credit_class_error_code'] == $selection[$i]['id']) {
    ?>
    <div class="messageStackError"><?php echo zen_output_string_protected($_GET['credit_class_error']); ?></div>

    <?php
          
    }
          for (
    $j=0$n2=sizeof($selection[$i]['fields']); $j<$n2$j++) {
    ?>
    <fieldset>
    <legend><?php echo $selection[$i]['module']; ?></legend>
    <?php echo $selection[$i]['redeem_instructions']; ?>
    <div class="gvBal larger"><?php echo $selection[$i]['checkbox']; ?></div>
    <label class="inputLabel"<?php echo ($selection[$i]['fields'][$j]['tag']) ? ' for="'.$selection[$i]['fields'][$j]['tag'].'"'''?>><?php echo $selection[$i]['fields'][$j]['title']; ?></label>
    <?php echo $selection[$i]['fields'][$j]['field']; ?>
    </fieldset>
    <?php
          
    }
        }
    ?>

    <?php
        
    }
    ?>
    and move it down close to the bottom of the file right after
    PHP Code:
    <?php // ** BEGIN PAYPAL EXPRESS CHECKOUT **
          
    } else {
            
    ?><input type="hidden" name="payment" value="<?php echo $_SESSION['payment']; ?>" /><?php
          
    }
          
    // ** END PAYPAL EXPRESS CHECKOUT ** ?>
    and before
    PHP Code:
    <fieldset>
    <legend><?php echo TABLE_HEADING_COMMENTS?></legend>
    <?php echo zen_draw_textarea_field('comments''45''3'); ?>
    </fieldset>
    Should be easy from here to use somekind of javascript expand/colapase function to make it even more non-clutered. I will make a post about that when I get around to it.

  5. #5
    Join Date
    Feb 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Hiding the coupon code box?

    Ok, very old bump on my part I know, but Im having truble getting PHP and javascript triping over eachother.

    I added the folowing code to the javascript header for the checkout payment page
    PHP Code:
    function switchMenu(obj) {
    var 
    el document.getElementById(obj);
    if ( 
    el.style.display != 'none' ) {
    el.style.display 'none';
    }
    else {
    el.style.display '';
    }

    Next up was to change the tpl_checkout_payment_default.php file where it displays the boxes. The folowing three things must be included. It must be wraped in a unique div name that I just called shrink0 / shrink1 / shrink2 /shrink3 / etc. Next it must set the div style display to be invisible. Third, it needs to have a clickible like for turning it on and off. For language neturatility I just had this link be [+/-] It was originaly
    PHP Code:
    <fieldset>
    <legend><?php echo $selection[$i]['module']; ?></legend>
    <?php echo $selection[$i]['redeem_instructions']; ?>
    <div class="gvBal larger"><?php echo $selection[$i]['checkbox']; ?></div>
    <label class="inputLabel"<?php echo ($selection[$i]['fields'][$j]['tag']) ? ' for="'.$selection[$i]['fields'][$j]['tag'].'"'''?>><?php echo $selection[$i]['fields'][$j]['title']; ?></label>
    <?php echo $selection[$i]['fields'][$j]['field']; ?>
    </fieldset>
    and I want to change it to
    PHP Code:
    <fieldset>
    <legend><?php echo $selection[$i]['module']; ?><a onclick="switchMenu('xxxxx');" title="display/hide"> [+/-]</a></legend>
    <div <?php echo 'id="shrink'.$i.'" style="display:none">' ?>
    <?php 
    echo $selection[$i]['redeem_instructions']; ?>
    <div class="gvBal larger"><?php echo $selection[$i]['checkbox']; ?></div>
    <label class="inputLabel"<?php echo ($selection[$i]['fields'][$j]['tag']) ? ' for="'.$selection[$i]['fields'][$j]['tag'].'"'''?>><?php echo $selection[$i]['fields'][$j]['title']; ?></label>
    <?php echo $selection[$i]['fields'][$j]['field']; ?>

    </div>
    </fieldset>
    but for the life of me I cant figure out how to include the div name in the function call to switchMenu. I cant seem to throw a PHP echo in at that spot inside the single quotes, and if I try and do the whole onclick function as a PHP echo the turning on and off of the single quotes nessasary switches it back out of php.

    Any ideas on what I can put in the place of xxxxx that will successfuly call the switchMenu munction with the corect div name?

 

 

Similar Threads

  1. Restrict coupon code on PO Box shipping addresses
    By marcopolo in forum General Questions
    Replies: 2
    Last Post: 12 Jan 2016, 01:56 AM
  2. PayPal Express Coupon Discount Promo Code Box
    By jasmel in forum PayPal Express Checkout support
    Replies: 9
    Last Post: 14 Aug 2013, 02:50 PM
  3. Hiding the quantity box on product listing
    By RobM in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 13 Jan 2009, 01:51 PM
  4. Hiding the coupon code box...
    By aaelghat in forum General Questions
    Replies: 3
    Last Post: 22 Sep 2008, 06:11 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