Jump to content
Strider

Credit Class/Gift Vouchers/Discount Coupons 5.10

Recommended Posts

great glad to hear it... I tried to go over everything and have other people do it also but at 4 and 5 in the morning my fingers sometimes had a life of their own...


(my knowledge is so small you would think that an ant was a genius in comparison)

Share this post


Link to post
Share on other sites

lol...

 

I hear what your saying.

 

Well that's one prob down. :)

 

---------------------------------------

 

Sorry to bug you Strider, but can you please add the Gift Voucher Balance info and Send Gift Voucher link to the account.php file? B)

 

Adding a new box under the E-mail Notifications box that works like the shopping cart box would be great. I don't use the shopping cart box, so the GV info doesn't show.

 

Example:

 

Title-> Gift Vouchers / Coupons

 

Green arrow -> Gift Voucher Balance $50.00

Green arrow -> Send Gift Voucher

 

I've tried to make it work, but no luck.

 

Thanks!


Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet!

Share this post


Link to post
Share on other sites

am trying to use gift voucher, too,

and i have the problem that the gift voucher amount can be anyhow - it will not be possible to pay any order with the gift voucher money... :-((

 

can it be that i didn't get the idea of gift voucher?

or where is the fault?

Share this post


Link to post
Share on other sites

what i have been looking for might be in the area catalog/includes/languages/german/modules/order_total/ot_gv.php

 

define('MODULE_ORDER_TOTAL_GV_USER_PROMPT', 'Bitte hier klicken um das Guthaben zu verrechnen -> ');

Share this post


Link to post
Share on other sites

Hi guys,

 

I just installed the 5.10 version and everything works fine but I found something wirld.

 

When I send gift voucher my voucher balance is updated but when I buy stuff in my shop, it remains the same amount even when I'm processing my order...

 

Any Idea? <_<

Share this post


Link to post
Share on other sites

AAARGH when I also redeem a gift on my account it doesn't update... so what's the deal? something I did wrong?

Share this post


Link to post
Share on other sites
Sorry to bug you Strider, but can you please add the Gift Voucher Balance info and Send Gift Voucher link to the account.php file? B)

 

Adding a new box under the E-mail Notifications box that works like the shopping cart box would be great. I don't use the shopping cart box, so the GV info doesn't show.

 

Example:

 

Title-> Gift Vouchers / Coupons

 

Green arrow -> Gift Voucher Balance $50.00

Green arrow -> Send Gift Voucher

 

I've tried to make it work, but no luck.

I modified the header code below to eliminate the shopping cart box and show the shopping cart info and GV info in the header at the top of the screen.

 

In the /catalog/includes/header.php file find the following code:

 

// check session.auto_start is disabled
?if ( (function_exists('ini_get')) && (WARN_SESSION_AUTO_START == 'true') ) {
? ?if (ini_get('session.auto_start') == '1') {
? ? ?$messageStack->add('header', WARNING_SESSION_AUTO_START, 'warning');
? ?}
?}

?if ( (WARN_DOWNLOAD_DIRECTORY_NOT_READABLE == 'true') && (DOWNLOAD_ENABLED == 'true') ) {
? ?if (!is_dir(DIR_FS_DOWNLOAD)) {
? ? ?$messageStack->add('header', WARNING_DOWNLOAD_DIRECTORY_NON_EXISTENT, 'warning');
? ?}
?}

?if ($messageStack->size('header') > 0) {
? ?echo $messageStack->output('header');
?}
?>

 

Add this code after it and modify its format to suit your needs and store layout:

 

<!-- Start Header Mod Here -->
<!-- Delete existing code section and post to the Design Notes. ?Replace with code section below -->

<table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top: 10">
?<tr class="header">
? ?<td valign="middle" width="265"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'your_logo.gif', 'Your logo image') . '</a>'; ?></td>
? ?<td width="350" align="center" valign="center" class="header">
? <table width="295" border="0" align="center" cellpadding="0" cellspacing="5">
? ? <tr class="header">
? ?<td width="199" align="right" class="header">
? ? ?<?php
? ?echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . HEADER_TITLE_CART_ITEM_COUNT . '</a> ' . $cart->count_contents() . '<br>';
? ?echo HEADER_TITLE_CURRENT_TOTAL . ' ' . $currencies->format($cart->show_total());
?	?>
? ?</td>
? ?<td width="96" align="left" valign="center"><?php echo '  <a href="' . tep_href_link(FILENAME_SHOPPING_CART, '', 'SSL') . '">' . tep_image(DIR_WS_IMAGES . 'header_cart.gif', HEADER_TITLE_CART_CONTENTS) . '</a>'; ?></td>
?</tr>

<!-- ICW ADDED FOR CREDIT CLASS GV -->
<tr class="header">
<td colspan="2" align="center" class="header">
<?php
// ICW ADDED FOR CREDIT CLASS GV
?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 ) {
?echo tep_draw_separator();
?echo VOUCHER_BALANCE . ' ' . $currencies->format($gv_result['amount']);
?echo ' | <a href="' . tep_href_link(FILENAME_GV_SEND, '', 'SSL') . '">' . BOX_SEND_TO_FRIEND . '</a>';
? ?}
?}
?if (tep_session_is_registered('gv_id')) {
? ?$gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");
? ?$coupon = tep_db_fetch_array($gv_query);
echo tep_draw_separator() . ' ' . VOUCHER_REDEEMED . ' ' . $currencies->format($coupon['coupon_amount']);
?}
?if (tep_session_is_registered('cc_id') && $cc_id) {
? ?echo tep_draw_separator() . ' ' . CART_COUPON . ' ' . '<a href="javascript:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>';
?}
// ADDED FOR CREDIT CLASS GV END ADDITTION ? ?
?>
</td>
</tr>
<!-- EOM Credit Class GV Module -->

? </table>
</td>
? ?<td align="right" valign="bottom" class="header">  </td>
?</tr>
</table>

 

I hope this helps.

Edited by Proetorian

Share this post


Link to post
Share on other sites

lena: look to make sure that the admin->modules->order total->gift voucher is installed. Also look at your sort orders.

 

Proetorian: Thanks for the header mod. I will put that in the doc if that is ok with you

 

hal1: Yes I believe you didn't place all the code out of checkout_process.php in the correct locations or possibly out of checkout_success.php .. but I think it is in process after you process the order.


(my knowledge is so small you would think that an ant was a genius in comparison)

Share this post


Link to post
Share on other sites
Proetorian: Thanks for the header mod. I will put that in the doc if that is ok with you

Yes. You may add it to the doc. Please note that the code above has a specific header layout but can be easily modified to accommodate any store layout as necessary.

Share this post


Link to post
Share on other sites

Thanks for the code Proetorian,

 

I've successfully added it, (after a few changes) ;) to the account.php page.

 

I'll gladly post the installation info if anyone else wants to add the GV info to their account.php page. :)

 

HAPPY HOLIDAYS EVERYONE! :D


Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet!

Share this post


Link to post
Share on other sites

Here's an example picture:

 

the pic is here :D


Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet!

Share this post


Link to post
Share on other sites

Boy did I ever mess up.

First let me say I apologize. In my haste to get this release out I .... well messed up.

 

There are two files that need to be edited.

ot_gv.php located in the catalog/includes/modules/order_total directory

and

order_total.php located in the catalog/includes/classes directory.

 

in order_totals.php

on line 179 you need to change the line from

 

$post_var = 'c_' . $GLOBALS[$class]->code;

 

to

 

$post_var = 'c' . $GLOBALS[$class]->code;

 

on line 181 you need to change that line from

 

if (!tep_session_is_registered('post_var')) tep_session_register('post_var');

 

to

if (!tep_session_is_registered($post_var)) tep_session_register($post_var);

 

 

and online 237 you need to change the line from

 

$post_var = 'c_' . $GLOBALS[$class]->code;

 

to

 

$post_var = 'c' . $GLOBALS[$class]->code;

 

 

and in the file ot_gv.php located within the catalog/includes/modules/order_total directory

you need to change line 41

 

if ($this->calculate_tax != "none") {

 

to be

 

if ($this->calculate_tax != "None") {

 

 

and that be it... Once again I apologize.


(my knowledge is so small you would think that an ant was a genius in comparison)

Share this post


Link to post
Share on other sites

Hi Strider,

 

I had already changed:

 

if ($this->calculate_tax != "None") {

 

Someone posted it a while back, but your other code was new to me, so thanks! :D

 

What did the other code break, could it have been something in the coupon part of the mod? I have the GV part working okay and haven't tried the coupon part yet!


Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet!

Share this post


Link to post
Share on other sites

Well strider,

 

I checked all my files and it looks ok...

As I said before all other features are working OK is it possible because I use "Check/money order" for payement?

Share this post


Link to post
Share on other sites

No I messed up hal1, and there is still a problem. Or at least I think it is a problem.

there are at present besides the edits listed above 3 more edits that one needs to do.

 

It will be tomorrow before I list them because I am still missing one edit and I haven't found it yet...

 

quiz for today .... what 3 edits are they...*grins* .. hint .. session values


(my knowledge is so small you would think that an ant was a genius in comparison)

Share this post


Link to post
Share on other sites

Hi Jason, Hi All,

 

I am still fighting with the gift vouchers. I have recently compared all the files on my server and DIFF them with MS2 and the CCGV 5.10 contrib. I have updated some but everything is exactly the same at the moment. However, I still get the following problem:

 

When a customer redeems a GV, it appears correctly in his shopping cart. When they want to checkout and the total amount is less than the Gift Voucher amount it does not allow the customer to check the 'Use Gift Voucher...' and proceed. Instead, it returns to the same page with the following error:

Credit Card Error!

 

The first four digits of the number entered are: <br>If that number is correct, we do not accept that type of credit card.<br>If it is wrong, please try again.

 

and the address bar looks like this:

 

Since I checked and compared with ms2, I know it is not the authorizenet.com module because I never changed it. What can it be?

 

please help/advise

 

Ron Peled

Share this post


Link to post
Share on other sites

ron,

I am working on it now.

if you edit the code fixes I did just a post or two back and then add

actually replace

on line 38 replace

      if ($cot_gv) {

with

      if (tep_session_is_registered('cot_gv')) {

 

and on line 71 replace

      if ($cot_gv) {

with

      if (tep_session_is_registered('cot_gv')) {

 

and on line 147 replace

      if ($cot_gv) {

with

      if (tep_session_is_registered('cot_gv')) {

 

then if you have shipping set to false in your discount coupon module set that to true and it should play ok

 

I apologize for this inconvenience and will have the rest of the fix sometime today.


(my knowledge is so small you would think that an ant was a genius in comparison)

Share this post


Link to post
Share on other sites

That just didn't make any sense did it... so I am going to put all the fixes here just to make sure we have them in one place

 

There are two files that need to be edited.

ot_gv.php located in the catalog/includes/modules/order_total directory

and

order_total.php located in the catalog/includes/classes directory.

 

in order_totals.php

on line 179 you need to change the line from

 

$post_var = 'c_' . $GLOBALS[$class]->code;

 

to

 

$post_var = 'c' . $GLOBALS[$class]->code;

 

on line 181 you need to change that line from

 

if (!tep_session_is_registered('post_var')) tep_session_register('post_var');

 

to

if (!tep_session_is_registered($post_var)) tep_session_register($post_var);

 

 

and online 237 you need to change the line from

 

$post_var = 'c_' . $GLOBALS[$class]->code;

 

to

 

$post_var = 'c' . $GLOBALS[$class]->code;

 

and in the file ot_gv.php located within the catalog/includes/modules/order_total directory

you need to change line 41

 

if ($this->calculate_tax != "none") {

 

to be

 

if ($this->calculate_tax != "None") {

 

you also need to replace the following lines in ot_gv.php

 

on line 38 replace

      if ($cot_gv) {

with

      if (tep_session_is_registered('cot_gv')) {

 

and on line 71 replace

      if ($cot_gv) {

with

      if (tep_session_is_registered('cot_gv')) {

 

and on line 147 replace

      if ($cot_gv) {

with

      if (tep_session_is_registered('cot_gv')) {

 

and to make matters worst... if you have discount coupons installed you need to make sure that your admin->modules->order total->discount coupons->include shipping and include tax are both set to true. or put the discount coupons sort order to 760 where the gv is set to 740

 

I apologize for the mess and I am trying to get the last edit out now


(my knowledge is so small you would think that an ant was a genius in comparison)

Share this post


Link to post
Share on other sites

Jason,

 

I just did the fixes that you posted. I have updated the 'include tax' and 'include shipping' both in the discount coupon and under the gift voucher to be true.

 

I can get past the checkout_payment.php but it bounces back when I try to confirm and claims:

There has been an error processing your credit card. Please try again.

 

I can tell that the solution is couple of changes away. Any idea?

 

Ron Peled

Share this post


Link to post
Share on other sites

WOW! WOW! WOW! :huh:

 

Jason you are working to fast! I guess you will have release a 5.11 soon after all your fixes ^_^

 

Have you ever heard swiss people are slooooow! :wacko:

 

Well I just thought about a little change but for later!

 

In state of sending email with all the wishlist wouldn't be better to make possible to access the wish list from any account (with a password of course) and so all you have to do is to transfer things to the cart to send it to the one who request the list?

 

On the other hand, this feature should require some kind of security that restock the product in the list if the customer doesn't buy the Item...

 

Hum I'll stop here I'm getting a nervous breakdown when thinking to fast! :wacko:

Share this post


Link to post
Share on other sites

OUPS!!! To Tired Guys I posted my thread in the wrong topic....

 

SORRY!!!!! :(

Share this post


Link to post
Share on other sites

I have just noticed another confusing issue, the sort order:

I have my order total modules set up the following way:

  • Sub total - 1
  • Shipping - 2
  • Tax - 3
  • Discount Coupons - 7
  • Gift Vouchers - 8
  • Total - 9

If I change the order to have the GV before the Discount Coupons the small checkbox: 'use GV account balance' does not appear.

 

Please confirm this confusing matter, there are so many referrences to this issue in the thread that by now who knows?

 

Thanks!

Ron Peled

Share this post


Link to post
Share on other sites

Hello there. I really enjoy the contribution but I seem to have a problem.

 

Everything is working on the front end and it shows your customer coupon discount when you enter the proper code but on the admin back end, it doesn't show up. It still gives total as the oritional price.

 

Is there anything that I am doing wrong?

 

Thanks so much for your help.

 

David ;)

Share this post


Link to post
Share on other sites

akasharkbow: Sounds like you don't have the checkout process setup correctly. You can tell this for sure by looking in your orders table and seeing if the discount coupon was entered there.

 

RonPeled: I just redid the files ron if you email me I will email you back the zip of the three files that need to be updated. If you wait another day I will upload them to the contribs section. I just want to test them out a little bit longer.


(my knowledge is so small you would think that an ant was a genius in comparison)

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

×