Zen Cart Logo

Hiding the coupon code box?

Locked

Views: 2,682

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
1 Sep 2008, 1:25 AM
#1
kinkyropes avatar

kinkyropes

New Zenner

Join Date:
Feb 2008
Posts:
9
Plugin Contributions:
0

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?

1 Sep 2008, 2:49 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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 ... :smile:

1 Sep 2008, 3:27 PM
#3
kinkyropes avatar

kinkyropes

New Zenner

Join Date:
Feb 2008
Posts:
9
Plugin Contributions:
0

Re: Hiding the coupon code box?

Ajeh:

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/ac_plan_before_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.

1 Sep 2008, 5:29 PM
#4
kinkyropes avatar

kinkyropes

New Zenner

Join Date:
Feb 2008
Posts:
9
Plugin Contributions:
0

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

<?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

<?php // ** BEGIN PAYPAL EXPRESS CHECKOUT ** } else { ?><input type="hidden" name="payment" value="<?php echo $_SESSION['payment']; ?>" /><?php
  }
  // ** END PAYPAL EXPRESS CHECKOUT ** ?>

and beforephp

<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.

12 Oct 2008, 9:41 PM
#5
kinkyropes avatar

kinkyropes

New Zenner

Join Date:
Feb 2008
Posts:
9
Plugin Contributions:
0

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
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
<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
<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?