Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Credit Class/Gift voucher/Discount Coupon v5


Ian

Recommended Posts

Hi Ian all the rest,

I am trying to get the GV contribution to work with the Paypal IPN (0.971) contribution and could use some ideas from you. My idea is to add the same GV code that you have added to checkout_process.php and checkout_confirmation.php to the Paypal IPN contribution.

 

As you pointed out before, the PayPal IPN contribution use it's own process and confirmation code, which is checkout_paypalipn.php and paypal_notify.php.

 

The things here is that paypal_notify.php is "redirected" from PayPal itself. This means that session vars may be old/deleted etc and you can not trust it's there anymore. My idea then is to update the file checkout_paypalipn.php with the same GV code. The file checkout_paypalipn.php contains code which save an order (with all products and attributes etc) to the database, unregister session vars and redirecting to PayPal. If you update the file checkout_paypalipn.php with:

 

<?php

/*

?$Id: checkout_paypalipn.php,v 0.971 2003-20-02 10:56:31 pablo_pasqualino Exp pablo_pasqualino $

?osCommerce, Open Source E-Commerce Solutions

?http://www.oscommerce.com



...

$order_total_modules->update->credit_account($i);

...

$order_total_modules->apply_credit();

...

if ($credit_covers) $payment='';

$payment_modules = new payment($payment);

$payment_modules->update_status();



$order_total_modules = new order_total;

$order_total_modules->collect_posts();

$order_total_modules->pre_confirmation_check();



if ( (is_array($payment_modules->modules)) && (sizeof($payment_modules->modules) > 1) && (!is_object($$payment)) && (!$credit_covers) ) {

?tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));

}



if (is_array($payment_modules->modules)) {

?$payment_modules->pre_confirmation_check();

}

... 

//unregister session vars

$order_total_modules->clear_posts();

...

tep_redirect("https://www.paypal.com/cgi.....")

 

There is one issue (at least) with this and that is if a customer aborts the confirmation at PayPal then the GV and/or DC will be gone since the coupon/GV is marked as redeemed. I guess that if you inform about this then it's ok.

 

Any thoughts about this? All input on this is appreciated.

 

/Fred

Anyone happen to get this to work?

Link to comment
Share on other sites

  • 4 weeks later...
  • Replies 499
  • Created
  • Last Reply

Top Posters In This Topic

Helo all!

 

I have a small question that, being of limited mental powers and having the worst luck searching in these forums, may someone can help me out with.

 

I am using osc 2.2 MS2 with RMA_return_2.2a and CC_GV_DC 5.05.

 

When applying a credit to a customer via a gift voucher the RMA system mails the customer a gift voucher. How am I able to get a full time field in the payment method section of checkout to stay in place even if the customer has no listing in the real gift voucher database tables? Same thing would apply for customers who have had a gift voucher mailed to them by a friendI suppose.

 

I already have the gift voucher module enabled b going to admin->order totals-> gift vouchers.

 

My sort order is default set at 704.... not sure what that means according to the docs suggested seemed to be 4 for no tax and 3 for tax.

 

Anyway if anyone could help me with this I would greatly appreciate it. Oh and at the smae time it would be nice to have the coupon box showing also. Any way if I missed the posted fix for this my apologies but as I said before I have a hard time finding things on the forums here.

 

Thanks in advance!

Link to comment
Share on other sites

Sorry to bother you all with my last post here. I found my problem, it was simply in my sort orders it would seem.

 

I do have a small problem though when a customer purchases a gift voucher, with no other product, then they are directed to the shipping checkout_shipping.php page. It was my understanding that if the gift voucher has a weight of 0 then the shipping page would be bypassed. Btw I am using OSC 2.2 MS 2 with CC_GV_DC 5.05. I have scanned this thread only briefly so I apologize if I missed the fix for this if it exists.

Link to comment
Share on other sites

  • 2 weeks later...

Hi all,

I just loaded this contribution and I am very impressed. Still working out some minor bugs, but that's not why I'm writing. While I was uploading this contribution, I noticed that there were some great functions in the code that would be beneficial in other areas. I've read, in other threads, a need for a start date for Specials (so a person might may implement future sales at any given time) and the ability to apply a sale to an entire category (Say 25% off all items in a category - Not just Manufacturer). Both of these Ian has used in the coupon_admin.php. I have copied some of the lines I thought I would need to implement the contribution, into my catalog/admin/specials.php, but here in lies the problem. I have NO EXPERIENCE IN PHP OR PROGRAMMING, except for getting my shop up and running. I think I have the start date in there (not tested and not where I want it) I edited catalog/admin/includes/languages/english/specials.php, but aside from that and the admin/specials I have not edited anything else. I have no idea how to integrate the listcategories.php to show up, but I think it could be easily used as everything that is needed for this is there.

I have contacted Ian and he is super busy on other things and has no interest to do this at the present time, but I thought I would write and see if there was someone who knows, uses and has an interest, in helping me with some code?

You can pm me and I will send you what I presently have...Any help from some wonderful helpful PHP Guru would be greatly appreciated and welcome.

Best wishes to all

Teresa

Link to comment
Share on other sites

  • 1 month later...

Hi all...

 

I would like to give 5% of a customers total order value(excluding shipping costs) back to them as gift vouchers (incentives ;) ) automatically at the end of their purchase (through paypal) ...

 

Is this possible... :blink: Could someone please help me figure out how to do this?

-Thanks so much

 

Steve

Link to comment
Share on other sites

  • 6 months later...
  • 2 months later...
  • 2 weeks later...

Please can somebody tell me how i can set the shipping price to free (?0), when somebody buys the gift voucher?

IO can't do it by weight as i don't use weights.

I was thinking that maybe there was a way to choose which products to offer free shipping on maybe?

 

Thanks,

Steve

Link to comment
Share on other sites

I have a question that I really hope someone can answer for me. : )

 

I am trying to change the way my order confirmation page looks and cannot figure out how to do something.

 

I have figured out that the shipping amount, tax, credits, and total is called with the following code:

 

<?php
? ? ? ? ? ? ? ? ? ? ? ? ? ? if (MODULE_ORDER_TOTAL_INSTALLED) {
? ? ? ? ? ? ? ? ? ? ? ? ? ? $order_total_modules->process();
? ? ? ? ? ? ? ? ? ? ? ? ? ? echo $order_total_modules->output();
? ? ? ? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? ??>

 

I wanted to make the shipping display on a different line below the products like this:

 

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

 

Products (Edit)

 

1 x Product1 --------------------------------- $10.00

2 x Product2 --------------------------------- $20.00

--------------------------------- -------------- ______

--------------------------------- -------------- $30.00

Shipping (Edit)

United Parcel Service (Ground) ------------- $6.00

 

----------------------------------- Discounts -$10.00

-------------------------------------------- Tax $1.56

------------------------------------------ Total $27.56

 

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

 

I used the following code to display the shipping type and total on a line by itself:

 

 ?<tr>
? ? ? ? ? ? ? ?<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
? ? ? ? ? ? ? ?<td class="main" width="65%"><?php echo $order->info['shipping_method']; ?></td>
? ? ? ? ? ? ? ?<td class="main" width="35%" align="right">
? ? ? ? ? ? ? ?<?php
? ? ? ? ? ? ? ? if ($order->info['shipping_cost'] > '0'){
? ? ? ? ? ? ? ? echo '$' . $order->info['shipping_cost'];
? ? ? ? ? ? ? ? } else {
? ? ? ? ? ? ? ? echo '$0.00';
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ??>
? ? ? ? ? ? ? ?</td>
? ? ? ? ? ? ? ? ? </tr>

 

Then I went to the admin and unchecked "display shipping" in the order total, shipping admin so it would not display with the total.

 

I have the look that I wanted above now but the problem is that the shipping type and amount now does not show in invoices, orders in the admin, etc.

 

My question is how can the code that displays the order total, tax, etc be manipulated to display only the things I want so that I do not have to turn "display shipping" off in the admin? I have tried "echo $order_total_modules->output(tax);" and several other things like that but nothing works. I cannot understand the ot_ files enough to figure it out so hopefully someone here can help me out.

 

Any help is appreciated!!

 

Craig

Edited by zboyblue
Link to comment
Share on other sites

I am a numnutz and posted this in the wrong place. So here it is... I am receiving the following errors:

 

QUOTE

Fatal error: Cannot redeclare class ot_coupon in /home/httpd/vhosts/officialbrettfavre.com/httpsdocs/store/includes/modules/order_total/ot_coupon.php on line 15

 

 

QUOTE

Fatal error: Cannot redeclare class ot_gv in /home/httpd/vhosts/officialbrettfavre.com/httpsdocs/store/includes/modules/order_total/ot_gv.php on line 14

 

 

Note: I get the first error when I upload both ot_gv.php and ot_coupon.php but only the second when I upload ot_gv.php.

 

I get these errors after installing ccgv 5.10 when attempting to enable it through the admin > modules > order totals. I reuploaded fresh files for modules > order_totals as well as classes > order_total.php... don't know if that did anything!

 

Thanks in advance for any help.

 

Cheers!

 

//jantzie

Link to comment
Share on other sites

Thanks for the great contribution.

 

I have one small problem though:

 

When I email a gv, the link in the email doesn't work.

 

It comes up as

http://www.dreamcrafter.co.uk/catalog//catalog/gv_redeem.php?gv_no=******

How can I get rid of the duplicated Catalog?

 

Tamsyn

Edited by Tamsyn
Link to comment
Share on other sites

I am a numnutz and posted this in the wrong place.  So here it is... I am receiving the following errors:

 

QUOTE

Fatal error: Cannot redeclare class ot_coupon in /home/httpd/vhosts/officialbrettfavre.com/httpsdocs/store/includes/modules/order_total/ot_coupon.php on line 15

QUOTE

Fatal error: Cannot redeclare class ot_gv in /home/httpd/vhosts/officialbrettfavre.com/httpsdocs/store/includes/modules/order_total/ot_gv.php on line 14

Note: I get the first error when I upload both ot_gv.php and ot_coupon.php but only the second when I upload ot_gv.php.

 

I get these errors after installing ccgv 5.10 when attempting to enable it through the admin > modules > order totals. I reuploaded fresh files for modules > order_totals as well as classes > order_total.php... don't know if that did anything!

 

Thanks in advance for any help.

 

Cheers!

 

//jantzie

 

 

Okay... I got rid of these errors and got the ccgv to work after reinstalling the whole contribution... must have had errors in my edits!

 

However now my customers are not receiving email confirmations when placing orders or after I update their order within the admin. Has anyone experienced this?

 

Cheers!

 

//jantzie

Link to comment
Share on other sites

  • 3 weeks later...

I installed this and I am not getting the "redeem" in my checkout page. The admin section seems to work fine, but I am not able to redeem the disount codes.

 

All i want to do is offer free shipping with first order. It seems like a simple thing, but I can't get it to work.

 

Any suggestions?

 

Thanks in advance,

Shawn

 

I'm using OSC M2.2.

Link to comment
Share on other sites

I just want to create a free shipping discount coupon. I went to the admin and create a new coupon with all information entered. I also checked the checkbox "free shipping" too.

 

Now my question is, if I have multiple shipping methods such as 1 day air, ground ... how do i restrict the free shipping coupon only applying to ground or standard shipping, and not to like 1 day air or so?

Link to comment
Share on other sites

Hi All!

 

I was wondering if there was a way of allocating a multiple discounting structure based on a single coupon code.

 

Ie the same coupon code will give 10% off category A, while only 5% off category B.

 

As I understand the current setup allows for only a single discount to be applied as either a blanket discount or to single product(s), but no means of a tier discounting structure.

 

Cheers!

Link to comment
Share on other sites

  • 4 months later...
Okay... I got rid of these errors and got the ccgv to work after reinstalling the whole contribution... must have had errors in my edits!

 

However now my customers are not receiving email confirmations when placing orders or after I update their order within the admin.  Has anyone experienced this?

 

Cheers!

 

//jantzie

 

 

You did not do wrong. Most likely you missed the functions/general.php edits because the error you were getting I got too. I found that they asked to have 3 functions added to general.php AND also included them in the "add_ccgvdc_application_top.php" file. Thus when you loaded any page you would get redeclare errors.

 

If any one gets these errors please remove the 3 fucntions from both add_ccgvdc_application_top.php files (one for admin and one for catalog)

 

Thanks for this mod.

 

Kevin

Link to comment
Share on other sites

Hiya

 

I've recently installed this contribution and everything appears to be working fine. I've created several gift vouchers as products and you can purchase these. Once you release these in the admin panel the customer gets an email saying:

 

"You recently purchased a Gift Voucher from our online store.

For security reasons this was not made immediately available to you.

However this amount has now been released. You can now visit our store and send the value via email to someone else

 

The Gift Voucher(s) you purchased are worth ?25.00"

 

Question is now when I log back into my account there doesn't seem to be any reference to the voucher so I can't see how you would redeem it. Has anyone come accross this problem before?

 

Jonathan

Link to comment
Share on other sites

Hi,

I broke my Paypal_IPN and CCGV again....

I did not even change any code that should have bothered it. Now everything works on the site except that when people try to use a coupon the correct total does not get passed to paypal. I won't paste my code here until someone asks me too. Please feel free to PM too. I am DESPERATE for help. Last time all I did to fix it was re-upload the same files I uploaded a 100 times before.

 

I appreciate any help, thank you

Link to comment
Share on other sites

  • 3 weeks later...

I just installed CCGV 5.14.

 

I can e-mail a gift voucher and the redeem link works fine.

 

The shopping cart shows the voucher balance.

 

But when I get to the payment screen at checkout, there is nothing there to indicate that there is a voucher balance to be applied -- just the credit box to enter a code to redeem.

 

What's wrong ??!?!???

Link to comment
Share on other sites

Just finished installing CCGV and have fully tested it, or at least I think I have :)

 

 

I was wondering if there was a way to show how much $ has been spent using each Coupon.

 

 

Such that when you go to the report for each coupon besides showing you

Customer id, Customer Name, IP Address, and Date Redeemed it also shows the purchase amount after coupon rebate.

 

Any Idea if there is a mod for this?

Link to comment
Share on other sites

Hello,

 

I've installed CCGV and it worked perfectly. Well now I want the customer to be able to enter the coupon code while still in the shopping cart. When the customer redeems his coupon, it will be applied in the shopping cart where it shows the subtotal and what not. I've been modifing files that refrence to checkout_payment.php and switching it to shopping_cart.php (FILENAME_SHOPPING_CART). I added the ccgv code from the checkout_payment.php to the shopping cart, I also added the JS that was necesary. Unfortantly I still can't get this thing to work properly. Has anyone been able to do this?

 

Thanks

Sean

Link to comment
Share on other sites

I saw the following comment in the checkout_payment.php file:

 

// if we have been here before and are coming back get rid of the credit covers variable

// #################### Added CGV ######################

if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers'); // CCGV Contribution

// #################### End Added CGV ######################

 

 

I want to know the reason for having to get rid of the credit covers variable. I think the code comment could have been more informative. I think the code comment describes what the code does (a programmer can easily determine this from the code anyway!). I expected to see an explanation of why the credit_covers variable is being unset. How does this session variable relate to the whole operation of the credit class and gift voucher contribution?

Link to comment
Share on other sites

Issue/Bug Report

 

Category restriction not respected in coupon redemption notice.

 

Steps to reproduce the issue:

1. Select a few products from category Y

2. Checkout

3. Use a coupon code that restricts the coupon to a single product category Z.

 

Where Y is a different category from Z and are mutually exclusive. That is, neither Z nor Y is a subset of the other.

 

Actual Results:

"Congratulations, you have redeemed a coupon worth 10% on orders greater than $40.00"

 

Expected Results:

"Sorry, you must purchase products from category Z to redeem this coupon."

 

Rationale:

The user will be confused if they are told the coupon is redeemed but see on the order confirmation that the coupon does not, in fact, apply.

 

The order confirmation page is working correctly from the store owner's point of view. However, from the customer's point of view, they will think they have redeemed a coupon where in fact they haven't really.

 

Next Steps:

Can someone please confirm this issue?

Link to comment
Share on other sites

  • 2 weeks later...

I have just installed this, not sure which version because the contribution listing is a right mess.

 

Anyway, a user can buy a giftvoucher,

they can email gift vouchers (the email actually has all the info twice)

the redeem link works fine.

 

however when I get to the checkout I have the voucher balance visible in the cart box, but no way for the user to redeem the amount.

 

Also if I email the voucher to myself and log back into the site and use the voucher code sent in the email I get told code invalid.

 

How should this work?

Has anyone else come across these problems?

Is anyone supporting this anymore?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...