Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

jacobr: does the sts take out the headers error msg routine on about line 67 you should have

<?php
?if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) {
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
?<tr class="headerError">
? ?<td class="headerError"><?php echo htmlspecialchars(urldecode($HTTP_GET_VARS['error_message'])); ?></td>
?</tr>
</table>
<?php
?}

 

that should take care of the error msg's based on the ot_gv's code.

 

Strider,

 

in my checkout_confirmation - this is what I have from line 66 to 70. If I run a search for "error_message", this is the only place in the file where it comes up.

// 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'));
 }

Should I replace this with the code you have above or append it somehow?

Link to comment
Share on other sites

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

jacobr: no the code I showed you goes into your includes/header.php

 

glassraven: it sounds like you don't have your add_ccgv_application_top.php included where it is suppose to be on the catalog side and the other problem sounds like you have a parse error

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

Link to comment
Share on other sites

Thanks Strider

 

glassraven: it sounds like you don't have your add_ccgv_application_top.php included where it is suppose to be on the catalog side

I had put the file in the folder specified (ie within the includes folder) and uploaded, but I just uploaded it into the root directory of the store and its working now?? No idea why as thats not supposed to be where it is, but hey ho! Not going to argue with it lol!

 

Thanks for that - saved me lots of aggro there.

 

Will look into where the possible parse error is coming from and get that fixed.

 

I really appreciate you taking the time to help me out on this one - I owe you a beer or ten :)

Sadie

Link to comment
Share on other sites

1146 - Table 'hemprest_osc1.coupon_gv_queue' doesn't exist

 

select count(*) as total from customers c, coupon_gv_queue gv where (gv.customer_id = c.customers_id and gv.release_flag = 'N')

 

If hemprest_osc1 is the name of your database, you have to be missing a table.

 

In phpmyadmin or whatever you use to access your database, run this sql.

-- 
-- Table structure for table `coupon_gv_queue`
-- 

CREATE TABLE IF NOT EXISTS `coupon_gv_queue` (
 `unique_id` int(5) NOT NULL auto_increment,
 `customer_id` int(5) NOT NULL default '0',
 `order_id` int(5) NOT NULL default '0',
 `amount` decimal(8,4) NOT NULL default '0.0000',
 `date_created` datetime NOT NULL default '0000-00-00 00:00:00',
 `ipaddr` varchar(32) NOT NULL default '',
 `release_flag` char(1) NOT NULL default 'N',
 PRIMARY KEY  (`unique_id`),
 KEY `uid` (`unique_id`,`customer_id`,`order_id`)
) TYPE=MyISAM AUTO_INCREMENT=17;

 

 

And when I try to install it in the payment modules admin I get the following error:

 

Warning: Cannot modify header information - headers already sent by (output started at /home/hemprest/public_html/store/admin/includes/application_top.php:213) in /home/hemprest/public_html/store/admin/includes/functions/general.php on line 18

 

Check for whitespace at the beginning and end of both of those files. It could be that application_top.php contains a function that is already in general.php. You can try to put those in either side of Beyond Compare and see if anything matches, but sometimes that doesn't work at all ;)

 

 

Hope that helps,

 

Tim

Link to comment
Share on other sites

jacobr: no the code I showed you goes into your includes/header.php

 

Strider,

 

I checked my /includes/header.php file, and that is in there, just a few lines below where you said it would be (because it also includes info for the down for maintenance contrib i have installed...)

 

Any other ideas on why the errors don't appear? thanks for all your help.

 

jacob

Link to comment
Share on other sites

Being new to OSC I spent the past 7 hours cussing and yelling because I could not figure out how to install this contribution. However, in the end this contribution is totally worth it. Man it's going to make life so much simpler. Although I think the documentation could be dumbed down a bit, thanks so much for this hack. :D

Link to comment
Share on other sites

I just installed the lates mod 5.10c but i've got a problem with it:

 

When i press the confirm order button it brings me back to the payment information tab.

 

I also found where the problems at:

 

checkout_shipping.php

// if the order contains only virtual products, forward the customer to the billing page as
// a shipping address is not needed
// if ($order->content_type == 'virtual') {
if (($order->content_type == 'virtual') || ($order->content_type == 'virtual_weight') ) {
 if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
 $shipping = false;
 tep_session_unregister('sendto');
 tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
}

 

and then escpecially:

($order->content_type == 'virtual_weight') )

The problem is that my shop has a standard shipping fee and it doesn't look at the weight of each product. All my products weigh 0 grams.

 

Is it a problem if i unncomment it and let it be as it was?

What is it for actually?

 

Cheers

Link to comment
Share on other sites

hmn, it's weird, I've uploaded all the files, edit the code easily but when creating a new product with model and name it GIFT25, I still get the shipping charge of $6 when checking out.

 

The $6 is flat charge, I try to switch the option of include shipping to False and then back to True but there is still shipping charge (it does not disappear as it's suppose to). No want would be gift certificate with shipping charge since there is nothing to ship. What did I do wrong? Please help.

 

Btw, this is one of the best hack for OScommerce, I believe it should implemented as a standard feature in the next version.

 

nam: weight needs to be 0 and downloads = true and model=GIFT*. but there is a problem with flatrate if there is more than a gv in the cart I believe. Also be sure to checkout your checkout_shipping script. The GV_ text is because you didn't include the edit the admin app_top file to include the app_top_ccgv

 

hi strider, thanks for your help. I've double check everything, weight is 0, model start with GIFT*. But when I set download = true in confirguation there is no Shipping charge on ALL of physical products, not just the gift certificate.

 

Is is the problem with the flat rate? Please elaborate more on the problem when you talked about more than a gv. Also, I did include the edit admin app_top to include app_top_ccgv file.

 

Thanks again, any hint would be very appreciated.

Link to comment
Share on other sites

I have installed this contribution, and followed the instructions. Works well, and I can manually create a gift voucher and email it, and then log in and pay with it. Maybe I have misunderstood this application, but what I would also have liked was:

 

1) To create some rules (administrator level), so that customers are automatically given a gift voucher (or discount coupon or whatever the name is), based on their purchase. For example 5% of purchases of category id 1 and 2. I have tried to make such rules, but nothing happens, and there is not even created a voucher that I can redeem under admin.

2) To send some more advanced gift vouchers, for example a special x-mas campaign with 10% of everything for purchases made before 23.12.2004 to all customers with "yes" to newsletter.

 

En error I have puzzled with is that when I in admin writes 5%, this is changed to 5?. Even if I change the 5.0000 til 5.0000?, this is still changed to 5?.

 

Have I completely misunderstood this contribution???

 

Cheers

Mogens

Link to comment
Share on other sites

I'm looking for a solution to a one-off price for shipping.

 

example: unexpectedly, a customer wants items shipped to Albania, my default shipping calculator doesnt support Albania so he sends an email, I check out prices with Fedex, I give the guy a special one-off quote..

....The guy adds that one-off quoted shipping price to the shopping cart and orders the items including the price for shipping.

 

can Credit Class & Gift Voucher be used for this purpose ??

 

(which one is the latest download package ? the contributions list is a mess.. :'( )

 

Thanks,

 

L

http://robosavvy.com/

*Do not advertise in your signature

Link to comment
Share on other sites

I am sad ! :'(

 

I reinstall oscommerce after my server hdd died. now once ready i reinstall the Credit Class & Gift Voucher then I installed some other contrib after it.

 

I install Credit Class & Gift Voucher first before others so i can just replace it.

 

Now the Credit Class & Gift Voucher system work in admin area but not showing anything in costomer area.

 

any tip for me so i dont need to go through all the files manually?

 

Thanks

Link to comment
Share on other sites

Yes, it does seem that if a product has an attribute, the discount does not work. I chased this down all day.

 

Does anyone have a fix, even if it involves removing code making adjustments for attribute costs? I don't use any price difference at present and need the attributes on my products.

Link to comment
Share on other sites

OK, I'm sure that somewhere, someone has posted a fix for this but can I find the answer anywhere? I don't think so!

 

So unfortunately, I'm going to have to ask again, sorry and all that!

 

I'm using the CCGV and Paypal IPN V2.9 and when a customer pays by paypal and opts to use his gift voucher balance in part payment, the gift voucher amount gets subtracted from his cart but his voucher balance remains the same enabling him to use the voucher over and over and over and over again.

 

how do I fix this?

 

Thanks

 

Peter

Link to comment
Share on other sites

http://www.oscommerce.com/community/contributions,282

 

Can someone, preferably the original author, please repackage this contrib with all the current fixes or something? It's contrib page is a mess of people adding their stuff to it.

 

I wish the contrib section would move more along the lines of sourceforge's repositories as opposed to the current, unintuitive system there is now.

Link to comment
Share on other sites

it seems that this answer has been asked before but i couldn't find an answer - the contribution is running well except nothing i do will get the error messages to display on the checkout_payment.php page - the error message appears in the URL correctly but for the standard user, the page simply appears to be refreshing over and over again -

 

for example most of the coupons are 1 time only per customer and i would like the error message that is in the modules files to display that this coupon is only allowed to be used 1 time...

 

any ideas on where to look?

 

thanks for any help

 

forgot to mention - that any other errors display correctly - like cc # errors, etc - just not the coupon error codes....

Edited by rubygirl
Link to comment
Share on other sites

it seems that this answer has been asked before but i couldn't find an answer - the contribution is running well except nothing i do will get the error messages to display on the checkout_payment.php page - the error message appears in the URL correctly but for the standard user, the page simply appears to be refreshing over and over again -

 

for example most of the coupons are 1 time only per customer and i would like the error message that is in the modules files to display that this coupon is only allowed to be used 1 time...

 

any ideas on where to look?

 

thanks for any help

 

forgot to mention - that any other errors display correctly - like cc # errors, etc - just not the coupon error codes....

 

 

I think the error messages from ot_coupon get put in the url as error_message that gets read by the header.php file and displayed at the end of the header versus the other errors that are set the the message stack that get displayed in the checkout_payment.php page. At least that's what was happening with my implementation of it..

 

hope that helps.

Link to comment
Share on other sites

I think the error messages from ot_coupon get put in the url as error_message that gets read by the header.php file and displayed at the end of the header versus the other errors that are set the the message stack that get displayed in the checkout_payment.php page.  At least that's what was happening with my implementation of it..

 

hope that helps.

 

 

thanks for the reply - that does appear to be what i does but i had used this contrib in previous code and the errors did display for the customer to read in the same fashion as the other errors - quite honestly that only makes sense because without it all the customer thinks is that they have to re-enter the cc info over and over...

 

any other ideas????

Link to comment
Share on other sites

it seems that this answer has been asked before but i couldn't find an answer - the contribution is running well except nothing i do will get the error messages to display on the checkout_payment.php page - the error message appears in the URL correctly but for the standard user, the page simply appears to be refreshing over and over again -

 

for example most of the coupons are 1 time only per customer and i would like the error message that is in the modules files to display that this coupon is only allowed to be used 1 time...

 

any ideas on where to look?

 

thanks for any help

 

forgot to mention - that any other errors display correctly - like cc # errors, etc - just not the coupon error codes....

 

Here's the fix for the coupon code errors not appearing. I take ZERO responsibility if this mucks up your system - please, please backup prior. I got this from spacey_girl:

 

 

Right after this patch of code:

<tr class="infoBoxNoticeContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td class="main" width="100%" valign="top"><?php echo tep_output_string_protected($error['error']); ?>

 

paste the following

<?php echo $HTTP_GET_VARS['error_message']; ?>

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

<?


if($HTTP_GET_VARS['error_message']){

?>

<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td class="main"><b><?php echo TABLE_HEADING_ERROR; ?></b></td>
</tr>
</table></td>
</tr>
<tr>
<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBoxNotice">
<tr class="infoBoxNoticeContents">
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td class="main" width="100%" valign="top"><?php echo $HTTP_GET_VARS['error_message']; ?>


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

?>

 

the code above is right before the following

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

 

I'm still struggling with where the coupon error messages are defined - if you figure that out I'm all ears. (errr... eyes? :P) Hope this works for you.

 

jacob

Link to comment
Share on other sites

I need to install the Coupon part of the contribution, but not the Gift Voucher part. Does anyone know of a straightforward way to install only the Coupon part?

 

Thanks.

Link to comment
Share on other sites

I need to install the Coupon part of the contribution, but not the Gift Voucher part.? Does anyone know of a straightforward way to install only the Coupon part?

 

Thanks.

 

Perhaps you have a more technical reason why, but I would guess it would be a lot easier just to install the contrib but 'turn off' the vouchers (but leave coupons on) in the order total module. Then (I think, just conjecture from using it) it should just be a matter of changing all the language defines to remove copy that refers to the vouchers.

 

Anybody else?

 

jacob

Edited by jacobr
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...