Jump to content
Strider

Credit Class/Gift Vouchers/Discount Coupons 5.10

Recommended Posts

Is it possible, when there is coming a new version, to make

the Gift amount, welcome gift etc. visible for user in his

account page as CCGV Amount ?

 

ATM a user only know his amount from email, but is not

seeing in his account page in shop.

 

Regards

Hobbes

 

 

I do not know if this is what you are wanting but I made up something that adds your Voucher Account Balance to the My Account section. If you have a balance, you will see a screen like the image below for a screen shot. If there is nothing in your Voucher Account Balance, then nothing is displayed.

 

 

CCGV-4.jpg

 

 

This is the code for it. Make the changes to account.php...

 

Find (may look different - If so, look for MY_ORDERS_TITLE):

      <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><b><?php echo MY_ORDERS_TITLE; ?></b></td>
         </tr>
       </table></td>
     </tr>

 

 

Add this just above that, or where ever you want it to display the box:

<?php
// BEGIN - Added for CCGV to show Voucher Account Balance
 if (tep_session_is_registered('customer_id')) {
   $gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
   $gv_result = tep_db_fetch_array($gv_query);
   if ($gv_result['amount'] > 0 ) {
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><b>Credit Voucher Balance</b></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td width="60"><?php echo tep_image(DIR_WS_IMAGES . 'ccgv.gif'); ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
                 <tr>
                   <td class="main"><?php echo '<strong>Voucher Account Balance:</strong>  ' . $currencies->format($gv_result['amount']); ?></td>
                 </tr>
                 <tr>
                   <td class="main"><?php echo tep_image(DIR_WS_IMAGES . 'arrow_green.gif') . ' <a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a>'; ?></td>
                 </tr>
               </table></td>
               <td width="10" align="right"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   }
 }
// END - Added for CCGV to show Voucher Account Balance
?>

 

 

Here is the new image file you can use that the above code calls for. RIGHT-CLICK on it and save it to your catalog/images folder

 

ccgv.gif

 

 

 

What do you think?


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

Hey guys, is there anyone can help me the problems I got? Such as: "where to manage the "Queue Purchases" in the admin".

Share this post


Link to post
Share on other sites

Hopefully a simple question. How do you remove the Redeem button from the checkout_payment page?

 

The reason I ask is after loading the CCVV for cc.php when clicking the Continue button it verify's that a the proper data was entered into the CCVV field if not a popup window would display the error.

 

If I click on the Redeem button instead it bypasses the check of the CCVV field. Not sure wich would be easier to force the customer to only click the Continue button or find the proper order of the code and be able to use both Redeem or Continue button.

 

 

Any help would be appreciated.

Share this post


Link to post
Share on other sites

Is there going to be a "new" final release anytime soon? I am very very interested in this contrib, but I see so many "bug" fixes after the final release on Feb 4th I am very confused as to what I should install. Any plans to release a "new" final? :) Thanks.

Share this post


Link to post
Share on other sites
Wow Pop,

 

that is wonderful  :)

 

But can u make it so, that it use the lanfile for user in...

 

english or german ?

 

Cheers

Hobbes

 

 

Sorry, I only use 1 language and that is English, I do not know how to make it multi lingual.


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites
Hey guys, is there anyone can help me the problems I got? Such as: "where to manage the "Queue Purchases" in the admin".

 

 

Click on Gift Voucher Queue and it will take you to the Gift Voucher Release Queue page. If there are any to be released, they will be listed there.


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites
Hopefully a simple question.  How do you remove the Redeem button from the checkout_payment page?

 

The reason I ask is after loading the CCVV for cc.php when clicking the Continue button it verify's that a the proper data was entered into the CCVV field if not a popup window would display the error.

 

If I click on the Redeem button instead it bypasses the check of the CCVV field.  Not sure wich would be easier to force the customer to only click the Continue button or find the proper order of the code and be able to use both Redeem or Continue button.

Any help would be appreciated.

 

 

You could go into your checkout_payment.php and comment out the box where the button is located at. But my suggestion would be to add that box to the top, above the payment options box and change the wording to something like this...

 

"If you have a coupon or gift voucher redemption code, enter it here before going any further. By doing so, your credit balance can be used toward this purchase."


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

Hello PopTheTop, :)

 

to make it multilingual is easy, i post the code with changes here

now for you and other people ;)

 

Again, thx for that to share with us.

 

P.S.

Im waiting on a next final too, too many bugs into that 5.12 :(

 

Regards

Hobbes

 

find in your code in account.php

 

<td class="main"><b>Credit Voucher Balance</b></td>

 

and replace with

 

<b>Credit Voucher Balance<br>Verrechnungsguthaben</b>

 

find in your code

 

<td class="main"><?php echo '<strong>Voucher Account Balance:</strong>  ' . $currencies->format($gv_result['amount']); ?></td>

 

and replace with

 

<b>Voucher Account Balance<br>Verrechnungsguthaben</b>

 

Than you have in account.php both languages....

english and german. This is the easiest way to do it ;)

Share this post


Link to post
Share on other sites

Popthetop- I had apendicitis over the weekend, so I won't be able to help fix the problems mentioned for a little while. Sorry...

Share this post


Link to post
Share on other sites

I have two stores using the one database and I only want one to use this contribution.

 

Once installed both stores reference the keys in the database.

 

What I would like to know is, what file calls the keys from the database so I can set them manually in the file if possible.

 

I have had a very good look and can not see how it is done.

 

Any help appreciated.

 

Kind Regards

 

Brendon


You are spirit! This world is material, there lies the problem

Share this post


Link to post
Share on other sites
You could go into your checkout_payment.php and comment out the box where the button is located at. But my suggestion would be to add that box to the top, above the payment options box and change the wording to something like this...

 

"If you have a coupon or gift voucher redemption code, enter it here before going any further. By doing so, your credit balance can be used toward this purchase."

 

 

Thanks for the response but since I am new to this would you be able to give me the line of code that creates the redeem button in checkout_payment ?

 

Thanks

Share this post


Link to post
Share on other sites
Thanks for the response but since I am new to this would you be able to give me the line of code that creates the redeem button in checkout_payment ?

 

Thanks

 

 

It is just under

<?php
   $radio_buttons++;
 }

 

Mine was changed and customized for my site, and I added the update above that puts the dollar amount into the payment options box. But this is what I have...

 

<?php
   $radio_buttons++;
 }
// BEGIN - Added for the updated CCGV to be added in payment options list at checkout
 if (tep_session_is_registered('customer_id')) {
 if ($temp > 0) {
 echo ' <tr><td width="10">' .  tep_draw_separator('pixel_trans.gif', '10', '1') .'</td><td colspan=2><table border="0" cellpadding="2" cellspacing="0" width="100%"><tr class="moduleRow" onmouseover="rowOverEffect(this)" onclick="clearRadeos()" onmouseout="rowOutEffect(this)" >' . "\n" .
          '   <td width="10">' .  tep_draw_separator('pixel_trans.gif', '10', '1') .'</td><td class="main"><b>';
 if ($gv_result['amount'] > $temp)
   echo $currencies->format($temp).' ';
 else
   echo $currencies->format($gv_result['amount']).' ';
   echo $order_total_modules->sub_credit_selection();
 }
 }
// END - Added for the updated CCGV to be added in payment options list at checkout
?>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
 echo $order_total_modules->credit_selection();//ICW ADDED FOR CREDIT CLASS SYSTEM
?>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '30'); ?></td>
     </tr>


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

"easier to understand" - fix for my bug fix...

 

This is a fix to the fix for the bug fix for the easier to understand update. Hmm my easier to understand update is quickly becoming not very easy to install... Once I am feeling better I will post tested complete instructions on how to do this. For now, here is the fix for the fixed fix or whatever:

 

in the instructions where it says to add the function mod_process() use this code instead of the code provided.

 

function mod_process() {
     global $currencies;
       $my_order_total = $this->get_order_total();
       $my_od_amount = $this->calculate_credit($my_order_total);
       if ($this->calculate_tax != "None") {
         $tod_amount = $this->calculate_tax_deduction($my_order_total, $my_od_amount, $this->calculate_tax);
         $my_od_amount = $this->calculate_credit($my_order_total);
       }
       $this->deduction = $my_od_amount;
       //$order->info['total'] = $order->info['total'] - $my_od_amount;
       if ($my_od_amount > 0) {
         $this->my_output[] = array('title' => $this->title . ':',
                          'text' => '<b>' . $currencies->format($my_od_amount) . '</b>',
                          'value' => $my_od_amount);
       }
   }

This should fix everything.

 

What was hapening (if you care) is that I changed the variable names so that it did not update the real order total and such when calculating the amount, but I was still using the old variable names when doing the final part, so that it came up as $0.00.

Share this post


Link to post
Share on other sites

Hey All...

 

I had installed this mod some time ago, and am now going through my site making sure everything works and there are no bugs. While testing this, I now see two problems I had not noticed before after the initial install and testing.

 

Hopefully you can point me the right dirrection. I had searched the threadm but come up with 40+ possibilities every time, and even thought I've read many... don't see yet what I need.

 

SOOOooooo....

 

Issue #1)

If a person tries to redeen a discount coupon that has already been redeemed, there is no error or any type of message. It just keeps popping back to the payment screen. Should there be an error message? And if it's not already built in... how can we add one so the customer knows what is happening?

 

Issue #2)

When redeeming a gift voucher... Ooopppssss.... Nevermind #2! :0 Looks like the above is the only problem I see.

 

Any suggestions? Thanks in advance!


Steve K AKA - Knipper -

Share this post


Link to post
Share on other sites
It is just under

<?php
? ?$radio_buttons++;
?}

 

Mine was changed and customized for my site, and I added the update above that puts the dollar amount into the payment options box. But this is what I have...

 

Okay, I think I found what I wanted to do by editing the ot_coupon.php file. Im just not sure that I am commenting it out correctly and if I will cause other problems down the road. Eveything appears to be working. Here is what I did and let me know if you agree.

 

ot_coupon.php

global $customer_id, $currencies, $language;
$selection_string = '';
$selection_string .= '<tr>' . "\n";
$selection_string .= ' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>';
$selection_string .= ' <td class="main">' . "\n";

// COMMENTED OUT THE LINE BELOW

// $image_submit = '<input type="image" name="submit_redeem" onClick="submitFunction()" src="' . DIR_WS_LANGUAGES . $language . '/images/buttons/button_redeem.gif" border="0" alt="' . IMAGE_REDEEM_VOUCHER . '" title = "' . IMAGE_REDEEM_VOUCHER . '">';
$selection_string .= TEXT_ENTER_COUPON_CODE . 

tep_draw_input_field('gv_redeem_code') . '</td>';
$selection_string .= ' <td align="right">' . $image_submit . '</td>';
$selection_string .= ' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>';
$selection_string .= '</tr>' . "\n";
return $selection_string;
}

 

Thanks,

steve

Share this post


Link to post
Share on other sites
"easier to understand" - fix for my bug fix...

 

This is a fix to the fix for the bug fix for the easier to understand update.  Hmm my easier to understand update is quickly becoming not very easy to install...  Once I am feeling better I will post tested complete instructions on how to do this.  For now, here is the fix for the fixed fix or whatever:

 

in the instructions where it says to add the function mod_process() use this code instead of the code provided.

 

function mod_process() {
? ? ?global $currencies;
? ? ? ?$my_order_total = $this->get_order_total();
? ? ? ?$my_od_amount = $this->calculate_credit($my_order_total);
? ? ? ?if ($this->calculate_tax != "None") {
? ? ? ? ?$tod_amount = $this->calculate_tax_deduction($my_order_total, $my_od_amount, $this->calculate_tax);
? ? ? ? ?$my_od_amount = $this->calculate_credit($my_order_total);
? ? ? ?}
? ? ? ?$this->deduction = $my_od_amount;
? ? ? ?//$order->info['total'] = $order->info['total'] - $my_od_amount;
? ? ? ?if ($my_od_amount > 0) {
? ? ? ? ?$this->my_output[] = array('title' => $this->title . ':',
? ? ? ? ? ? ? ? ? ? ? ? ? 'text' => '<b>' . $currencies->format($my_od_amount) . '</b>',
? ? ? ? ? ? ? ? ? ? ? ? ? 'value' => $my_od_amount);
? ? ? ?}
? ?}

This should fix everything. 

 

What was hapening (if you care) is that I changed the variable names so that it did not update the real order total and such when calculating the amount, but I was still using the old variable names when doing the final part, so that it came up as $0.00.

 

 

I have the updates installed and the one you posted here. Since doing the updates, NOTHING is getting added to the bottom of the payment options box at all. It does not matter is I have a gift certificate balance, a redeemed coupon balance or no type of CCGV balance at all.

 

Only the payment types as usual are displayed.


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

Ok, I just tried something else...

 

I changed this...

  if (tep_session_is_registered('customer_id')) {
   if ($gv_result['amount'] > 0) {

 

To this...

  if (tep_session_is_registered('customer_id')) {
   if ($temp > 0) {

 

 

And now it works just fine.

 

BUT...

The Java script is not disabling the payment buttons if my CCGV balance is greater than or equal to the order total.

 

If I click on the Redeem button, it goes through fine with no errors.

 

But if I click on the Continue button, I get that pop-up error message telling me to choose a payment option.


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites

One more update, I changed all the document.checkout_payment back to document.form[0]

 

This still does not disable the other payment buttons when my CCGV balance is greater than or equal to the order total, but at least you can now checkout without choosing other payment options and only have the CCGV option checked with no errors.


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites
Ok, I just tried something else...

 

I changed this...

  if (tep_session_is_registered('customer_id')) {
   if ($gv_result['amount'] > 0) {

 

To this...

  if (tep_session_is_registered('customer_id')) {
   if ($temp > 0) {

And now it works just fine.

 

BUT...

The Java script is not disabling the payment buttons if my CCGV balance is greater than or equal to the order total.

 

If I click on the Redeem button, it goes through fine with no errors.

 

But if I click on the Continue button, I get that pop-up error message telling me to choose a payment option.

That is strange, the javascript is working fine for me. I probably failed to mention something or another. It's strange that changing that in your code fixed it... The only thing I can think of is maybe the new code is inserted a line or two off? Here is all the code from my checkout_payment.php, compare it to yours and see if you come up with any major differences that would be causing the errors.

 

http://shop.faerietreasures.com/checkout_p...nt_temp.php.txt

 

I will be removing that file after we fix this issue, since it is potentially a security risk when my shop goes live...

Share this post


Link to post
Share on other sites
Hi,

I might have mised something, but the (cart) scenario seems to be when you ONLY have products equal to the value of the gift voucher/s in the cart, as it seems to be, from the description above  ??

 

Can't you just check if the sub-total is equal to the (total) value of all gift vouchers (i.e. just in case you are using mutiple ones), the add the shipping amount, but _don't_ apply the gift voucher ?

 

Peter

 

products equal to the value of the gift vouchers?? um, i guess? the product -is- a gift voucher, so if thats all thats in my cart, then yes, the products price = gift voucher value.

 

the key does appear to be simply not to apply the gift voucher. but I'M not doing it :P ITS doing it, and i didnt write it, and i dunno how to fix it yet, so i post here.

 

thanks for the reply though, im getting mostly silence in here on this one. could it be that nobody else encountered some big coding logic error that ive found? it would be cool if anyone else acknowledged what im talking about, especially whoever is leading the project these days!!!!! -looks around the forum-

 

peace

allen

Share this post


Link to post
Share on other sites
products equal to the value of the gift vouchers?? um, i guess? the product -is- a gift voucher, so if thats all thats in my cart, then yes, the products price = gift voucher value.

 

the key does appear to be simply not to apply the gift voucher. but I'M not doing it :P ITS doing it, and i didnt write it, and i dunno how to fix it yet, so i post here.

 

thanks for the reply though, im getting mostly silence in here on this one. could it be that nobody else encountered some big coding logic error that ive found? it would be cool if anyone else acknowledged what im talking about, especially whoever is leading the project these days!!!!! -looks around the forum-

 

peace

allen

What exactly triggers the mess-up again?

 

Is it buying a gift voucher with a coupon? I have been able to produce this "error". It's funny that you have shipping cost on a gift voucher though.

 

When I produce the error, the 15% coupon only takes off of the amount of the shopping cart without the gift voucher in it. This seems logical to me, since if there is a coupon, it is treated as a "promotion" not as "cash"

 

You wouldn't want a "promotion" to take cost off of a voucher, because that is basically giving away money, which in most cases you do not want to do. What you do want to do is take money off of actual merchandise. Hope I'm interpreting your problem right.

 

 

especially whoever is leading the project these days!!!!! -looks around the forum-
I'm pretty sure we are on our own. I have been trying to help out a lil bit, at least all that I can. At this point I think it is community members helping comunity members(for this contrib), there are no project leaders that are hanging around, at least none that are very vocal...

 

Hope I helped some

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×