Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

In my store Handy Candy the restrict to Categories does not seem to work when more than one category is entered. Basically it only seems to take the first category id and restricts to that.

 

Has anyone else had this problem?

 

Also if anyone has any great ideas regarding this other problem they would be much appreciated - I am about to start using Protx for my credit card processing, but they have a minimum transaction amount of ?1.00.

 

This causes me problems when people pay for goods with a gift voucher and only have a small amount to pay (ie less than a pound!) I've got around this by basically changing the code so any value under ?1.00 is just zeroed, but a better fix would be to only credit enough of the gift voucher to leave ?1 left (unless the gv covers total purchase).

 

I don't really expect an answer to this problem, just thought it might be handy info in case anyone else is thinking of using Protx! (who otherwise are very good)

Link to comment
Share on other sites

Hello,

 

I have this contribution running smoothly now and just need one thing done. Does anyone know where I would go in the code to change it so that when the customer enters a coupon code in the redeem box and clicks redeem it will stay on the checkout_payment.php page instead of going to the checkout_confirmation.php page allowing them to still change their payment oprions. I have customers that are taken a little off guard when they click redeem and are suddenly taken to the confirmation page. The reason I want to do this is because I set up the checkout_payment.php page to show a subtotal of the orders and everything. So that this will allow the customer to see their order total with the coupon before continuing to the checkout_confirmation.php page.

 

Thanks,

 

JT

Edited by aceclimber
Link to comment
Share on other sites

Hi,

 

I have installed this contribution over a fairly new - only paymate contrib and some stylesheet changes.

 

It all seems to be working o.k. but I get this error on every page in my admin -

 

Fatal error: Cannot redeclare create_coupon_code() (previously declared in /home/scrapbox/public_html/catalog/admin/includes/add_ccgvdc_application_top.php:25) in /home/scrapbox/public_html/catalog/admin/includes/add_ccgvdc_application_top.php on line 25

 

Line 25 of this file looks like this -

 

function create_coupon_code($salt="secret", $length=SECURITY_CODE_LENGTH) {

 

Any help would be appreciated.

 

thanks - as you can tell I'm new at all this.

 

Maria

Link to comment
Share on other sites

I added this contribution (which Rules), however when using the coupon code I don't see the discount when I go in the admin side to process the order. I am assuming I did something wrong but I can't figure out what, I did a complete reinstall. It just shows the complete total without discount in the admin area, however when you place a test order the discount appears properly. But once I get the retail confirmation order email it gives me the complete total, and doesn't show the discount. Thanks in advance - I am using OSC 2.2MS2

 

You can do a test on my site if I am being confusing : http://www.behealthyfitness.com/healthy-fitness

 

Coupon Code memberdiscount

Edited by surfking
Link to comment
Share on other sites

I have found a possible bug in the CCGV contribution dated 2 Jan 2004 - (ccgv-510b / zip file size 171802). In the file catalog/includes/classes/order_total.php on line 259 the source reads as follows:

 

$output_string = ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >' . "\n" .

 

I believe that the operation on $output_string should be an append (.=) instead of an assignment (=). Without the append the customer is never offered the opportunity to use a gift voucher because the HTML code to do so is overwritten by redeem code for coupons on the second pass through the "while (list(, $value) = each($this->modules))" loop.

 

Please let me know if I missed something or I'm incorrect.

Link to comment
Share on other sites

Follow up on my possible bug report. If the changes I suggested in my last post are made, the checkbox for redemption does appear and seems to work correctly if a voucher is redeemed via a customer clicking the redeem link in the email sent to them to annouce the gift.

 

However, if the voucher has not been redeemed prior to checkout, the customer will see two identical redeem boxes at checkout. Only the lower of the two redeem functions appear to work. Note: if the customer does NOT have a voucher available for redemption, only one redeem box will appear.

 

I'll keep playing with the code, but I don't really know enough (it took me 2 hours just to get this far) to make many more meaningful changes.

Link to comment
Share on other sites

Art, your are right. Whren i put the dot in that string there appears two redeem fields in the checkout.

 

I dont' know if that's a bug, cause the contrib. works fine without that dot. Maybe thats was leaved that way by the creator..

Link to comment
Share on other sites

Mutter,

 

Thanks for the reply. Well, on my system it doesn't work without the modification. The checkbox to redeem a voucher will just simply never show up unless I change the code. I added 10 different ECHO statements in and around this section of code and tested about 30 times to determine that the HTML code for the voucher checkbox ($output_string) was being overwritten by the redeem code for coupons. Looking at the code, I think my change was a reasonable assumption if I was wrong:

 

if ( ($use_credit_string !='' ) || ($selection_string != '') ) 
             $output_string .=  '<tr colspan="4"><td colspan="4" width="100%">' .  tep_draw_separator('pixel_trans.gif', '100%', '10') . '</td></tr>';
             $output_string = ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >' . "\n" .
                              '   <td width="10">' .  tep_draw_separator('pixel_trans.gif', '10', '1') .'</td>' .
                              '     <td class="main"><b>' . $GLOBALS[$class]->header . '</b></td>' . $use_credit_string;
             $output_string .= '<td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') . '</td>';
             $output_string .= '  </tr>' . "\n";
             $output_string .= $selection_string;
}

 

The line that I'm questioning is third in the snippet above. It's important to remember that this snippet is nested in a loop that loops through the different credit class classes. So on my basic system it is executed twice: once for GV and once for coupons. (I think that's correct.)

 

On the second line we are appending (.=) to $output_string. I'm not sure of the logic why we would overwrite the $output_string variable contents from line 2 immediately in line 3. That's why I'm exploring the need for an append (.=) action on line 3.

 

The above snippet was taken directly from the contribution source, not my modified source. I've also verified my installation of CCGV four times using the Mark I eyeball and twice using diff and I can find no installation related errors. That's not to say there are none, but for the life of me I can't find any mistakes on my part.

Link to comment
Share on other sites

Im determined to use this contrib :D

 

I have a scheme where customers to the store will get their first 3 items free, whatever they may be, different prices etc.

 

What I am going to do is set up a secure account creation page for these customers and part of the account creation activates their 'gift certificate' but it needs to be for a number of items not a set amount of money.

 

Is this contrib set up to do that easily?

 

Cheers

Stot

Link to comment
Share on other sites

Hi, Art.. i remember.. when i install the contrib the credit checkbox was missing. I dont know what i did to fix that, but im sure that wasn't that string dot, maybe was another mistake that i made when installing the contrib. and then i fixed...

 

I have installed a lot of contribs in my OSC and the Gif Vouchers seems to still working very good. Maybe one contrib or a thing you change is causing the problem in your case.

Link to comment
Share on other sites

Great mod , I am new here , got a stupid question , after I install all things

 

it went great , works ok , but I can't find how can I purchase the GV in the store .

 

or I miss sth ?

 

thx for help

Link to comment
Share on other sites

This looks like a great contrib, but obtaining it is very confusing. in the contrib section there are tons of updates, but the most recent ones seem to not include the entire thing.

Do I have get version 5.03 (the most recent update by the original author, Ian), and then get all the updates above it for bugfixes?

 

Is there any chance that there is a more recent complete package available anywhere?

Thanks

Link to comment
Share on other sites

Hi there,

 

I have a somewhat interesting situation, I am hoping the coupon gurus can help out with. I am in the process of finishing a store. The store has many products, and the coupons are only on certain products. So while the entire order shows a coupon discount, the coupon discount is still only based on the "eligible" products.

 

The store authorizes the credit card upon checkout, and then ships items accordingly as stock permits. Well, the store only charges the card for the items shipped when they ship the item(s). The charge for each item needs to include the applicaple coupon discount applied, if any.

 

So basically, has anyone come up with something like this, where, not only is the coupon applied to the order, but in the tables, its actually mapped to the products inside the order? At what point during checkout process would you try to do map this in the db, plus a myriad of other questions.

 

Any and all insight, thoughts, suggesstions are most appreciated.

 

thank you,

 

Gottaloveit

Link to comment
Share on other sites

Hi there,

 

I have a somewhat interesting situation, I am hoping the coupon gurus can help out with. I am in the process of finishing a store. The store has many products, and the coupons are only on certain products. So while the entire order shows a coupon discount, the coupon discount is still only based on the "eligible" products.

 

The store authorizes the credit card upon checkout, and then ships items accordingly as stock permits. Well, the store only charges the card for the items shipped when they ship the item(s). The charge for each item needs to include the applicaple coupon discount applied, if any.

 

So basically, has anyone come up with something like this, where, not only is the coupon applied to the order, but in the tables, its actually mapped to the products inside the order? At what point during checkout process would you try to do map this in the db, plus a myriad of other questions.

 

Any and all insight, thoughts, suggesstions are most appreciated.

 

thank you,

 

Gottaloveit

Link to comment
Share on other sites

Is this for Milestone 2? I'm just beginning to modify everything, but I don't know why my installed M2 version already differs with the first modification.

 

Milestone 2 code:

// load the selected payment module
 require(DIR_WS_CLASSES . 'payment.php');
 $payment_modules = new payment($payment);

 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;

 $payment_modules->update_status();

 if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
   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();
 }

 

 

CCGV code:

// load the selected payment module
 require(DIR_WS_CLASSES . 'payment.php');
 if ($credit_covers) $payment='';
//ICW added for CREDIT CLASS
 $payment_modules = new payment($payment);
//ICW ADDED FOR CREDIT CLASS SYSTEM
 require(DIR_WS_CLASSES . 'order_total.php');

 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;

 $payment_modules->update_status();
//ICW ADDED FOR CREDIT CLASS SYSTEM
 $order_total_modules = new order_total;
//ICW ADDED FOR CREDIT CLASS SYSTEM
 $order_total_modules->collect_posts();
//ICW ADDED FOR CREDIT CLASS SYSTEM
 $order_total_modules->pre_confirmation_check();

// ICW CREDIT CLASS Amended Line
//  if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
 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();
 }

 

 

Why does CCGV have a variable called "$credit_covers":

 

if ($credit_covers) $payment='';

 

 

This appears *before* the ICW Comment, so it's implied that it should already be in my current document's code - which it is not with Milestone 2. Where did it come from? Am I supposed to copy that as well (going against the instructions that all modifications appear *after* the ICW Comment)?

 

Thank you in advance,

BD

Link to comment
Share on other sites

Forget it... it's on the same line (which means it is a comment of that line, ergo it's new and shouldn't exist previously). I don't know why my editor moved the comment down a line originally.

 

Ughh, I hate coding all night/day and losing focus. See you,

BD

Link to comment
Share on other sites

Hi, Strider:

 

I could use a little help. I'm writing (or at least trying to write) a payment module for Stormpay IPN utilizing the 3rd party cart feature (which itemizes product/qty/price). So far so good, untill I come to CCGV support.

 

I'm looking for a concise block of code to extract the coupon/gv info, much as is done in checkout_confirmation.php, so I can pass it on to Stormpay as individual line items. Oy! I've been all over your wonderful contribution (which I use extensivly), but with no success.

 

Any suggestions would be appreciated.

 

[email protected]

Link to comment
Share on other sites

I just don't get it.

 

I have everything installed (did it manually, as there were already mods in some of the files.)

 

User1 purchased a $50 voucher. Admin approved it. User1 then sent it to User2. So User2 gets the email, logs in and it shows Voucher Balance $50.00 in the cart. User2 adds a product to the cart and goes to checkout. Puts the Redeem Code in the clicks Redeem. Shows "Invalid Redeem Code" at top. If User2 is not logged on and clicks on the email link, it also shows "The Gift Voucher number may be invalid or has already been redeemed".

 

So what's going on? That's the only code in the coupons table!

 

Next: how should the link work if a customer is not already logged on? Shouldn't the customer first be prompted to logon and then it would show me the voucher balance?

 

And another question: how does a customer get back their redeem code if they lost their email. It doesn't appear anywhere in the account information.

 

Finally, a question that presumes that I can get this working. Where am I supposed to be prompted for how much of my voucher I want to apply to the order?

 

Thanks!

Edited by Zdub
Link to comment
Share on other sites

Hi Guys, I understand that there should be a field in the "Payment Information" page where the customer can enter the coupon code to redeem the discount that you've created... does anybody know why I don't see this field?

 

(I've tried to look for previous reply to this problem, found the topic but there's no reply to it, so I'm asking again)

 

Well... everything else is working fine, like creating a coupon and such, but if I can't redeem it... it's not going to be any good :lol: , please, any help on this issue will be great. Thanks in Advance!

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