Community Add-Ons
Credit Class & Gift Voucher
for osCommerce Online Merchant v2.2
The base credit class and the Gift Voucher module in one package.
Legend:
Download
Report
This are only the /admin/coupon_admin.php and /admin/includes/boxes/gv_admin.php files which were modified to work in the new admin interface in osCommerce 2.3.1
I'm trying to port all the contrib to osCommerce 2.3.1 since most of the files can't be replaced since they are much different from RC2.
I'll be contributing the rest of my modifications but I can't make the text field where the customer types his coupon code appear anywhere so I'm stuck.
If any of this contribution developers or contributors could explain how the coupon code input works so I can try to update the contribution (or help me do so :P) would be great
I started a dorum topic about this
http://forums.oscommerce.com/topic/374736-credit-class-gift-vouchers-ccgv-for-231/
and you can contact me over there, I'm the first post user
if you delete coupon, the description is not deleted for DB.
only file modified
-Fix some bugs.
-Organized for Core Oscommerce.
-Fix for contrib POINTS AND REWARDS MODULE. (optional: for activate delete // comment)
-full package
After creating one new coupon with Free Shipping option, Free Shippping checkbox not selected.
Solve:
-->catalog/admin/coupon_admin.php
Find:
<tr>
<td align="left" class="main"><?php echo COUPON_FREE_SHIP; ?></td>
<td align="left"><?php echo tep_draw_checkbox_field('coupon_free_ship', $coupon_free_ship); ?></td>
<td align="left" class="main"><?php echo COUPON_FREE_SHIP_HELP; ?></td>
</tr>
Replace:
<tr>
<td align="left" class="main"><?php echo COUPON_FREE_SHIP; ?></td>
<td align="left"><?php echo tep_draw_checkbox_field('coupon_free_ship', '1', $coupon_free_ship); ?></td>
<td align="left" class="main"><?php echo COUPON_FREE_SHIP_HELP; ?></td>
</tr>
only coupon_admin.php file attached
Thanks
catalog/checkout_process.php
@line 73
find:
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'));
}
replace with:
if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) && (!$credit_covers) ) || (is_object($$payment) && ($$payment->enabled == false)) ) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL'));
}
2 days of work to undestand it!
Enjoy!
fix payment problem!
*Sorry. Forgot some files in last upload. This is the full package.
When installing on a fresh install of RC2a, the following errors occur in admin section:
errors on admin/coupon_admin.php
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /gearupaz/public_html/admin/includes/functions/database.php on line 107
errors on admin/gv_mail.php:
Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in /gearupaz/public_html/admin/includes/functions/database.php on line 117
Warning: Cannot modify header information - headers already sent by (output started at /gearupaz/public_html/admin/includes/functions/database.php:117) in /gearupaz/public_html/admin/includes/functions/general.php on line 22
This is a fix for the CCGV (Contibution 282) where certain database.php errors and other problems are happening with the admin side.
This is a full package for new installation, where the previous package caused some problems for new (drop-in) installations.
*Built onto version 5.21
*Credit for these solutions goes to original contributors and forum users.
Fix gv_mail.php error:
On line 64 replace:
$insert_id = tep_db_insert_id($insert_query);
with:
$insert_id = tep_db_insert_id();
Fix coupon_admin.php (under case: voucherreport, lines:227-230)
replace:
$cc_query_raw = "select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . (int)$coupon_id . "'";
$cc_query_numrows = tep_db_num_rows($cc_query);
$cc_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $cc_query_raw, $cc_query_numrows);
$cc_query = tep_db_query($cc_query_raw);
with:
$cc_query_raw = "select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . (int)$coupon_id . "'";
$cc_query = tep_db_query($cc_query_raw);
$cc_query_numrows = tep_db_num_rows($cc_query);
$cc_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $cc_query_raw, $cc_query_numrows);
*Thanks OSC community for all efforts and making one of the most practical contributions a possibility.
When installing on a fresh install of RC2a, the following errors occur in admin section:
errors on admin/coupon_admin.php
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /gearupaz/public_html/admin/includes/functions/database.php on line 107
errors on admin/gv_mail.php:
Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in /gearupaz/public_html/admin/includes/functions/database.php on line 117
Warning: Cannot modify header information - headers already sent by (output started at /gearupaz/public_html/admin/includes/functions/database.php:117) in /gearupaz/public_html/admin/includes/functions/general.php on line 22
This is a fix for the CCGV (Contibution 282) where certain database.php errors and other problems are happening with the admin side.
This is a full package for new installation, where the previous package caused some problems for new (drop-in) installations.
*Built onto version 5.21
*Credit for these solutions goes to original contributors and forum users.
Fix gv_mail.php error:
On line 64 replace:
$insert_id = tep_db_insert_id($insert_query);
with:
$insert_id = tep_db_insert_id();
Fix coupon_admin.php (under case: voucherreport, lines:227-230)
replace:
$cc_query_raw = "select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . (int)$coupon_id . "'";
$cc_query_numrows = tep_db_num_rows($cc_query);
$cc_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $cc_query_raw, $cc_query_numrows);
$cc_query = tep_db_query($cc_query_raw);
with:
$cc_query_raw = "select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . (int)$coupon_id . "'";
$cc_query = tep_db_query($cc_query_raw);
$cc_query_numrows = tep_db_num_rows($cc_query);
$cc_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $cc_query_raw, $cc_query_numrows);
*Thanks OSC community for all efforts and making one of the most practical contributions a possibility.
Go to catalog/checkout_process.php
Change
if ($credit_covers) $payment='';
to
if ($credit_covers) $payment='credit covers';
Done! It worked for me. Hopefully it works for you.
That's the only thing in this update. Not a full package, just this fix.
Upgrading from 5.19 to 5.21 broke several of my payment methods. The
problem happens in includes/classes/payment.php. To fix it, find the
OLD line and replace it with the NEW line.
OLD:
if (defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED) && !$module == 'credit_covers') {
NEW:
if (defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED) && $module != 'credit_covers') {
1) Remove illogical condition.
file: catalog/checkout_payment.php
line: if (MODULE_ORDER_TOTAL_INSTALLED)
action: remove this line
2) Add missing constant.
file: catalog/includes/languages/add_ccgvdc_english.php
line: define('ERROR_NO_ACCOUNT_GV', 'You must sign in to your account to
redeem a Gift Certificate');
action: add this line
When editing in the step...
1) catalog/checkout_confirmation.php
Right Under:
$order = new order;
$payment_modules->update_status(); (around line 61)
Replace:
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')); (around line 55)
}
With:
// Start - CREDIT CLASS Gift Voucher Contribution
$order_total_modules = new order_total;
$order_total_modules->collect_posts();
$order_total_modules->pre_confirmation_check();
// >>> FOR ERROR gv_redeem_code NULL
if (isset($_POST['gv_redeem_code']) && ($_POST['gv_redeem_code'] == null)) {tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));}
// <<< end for error
// 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) ) {
// End - CREDIT CLASS Gift Voucher Contribution
Be sure to add a } after the "// End - CREDIT CLASS Gift Voucher Contribution
No file or full package attached.
-Found the old manual and updated it
-Fix some bugs - thanks Andyy!
-Removed erroneous GVEF code from gv_redeem.php that was inserted somewhere in about version 5.13 for some reason - was never caught till now.
When changing the coupon status from Active to Inactive the Dropdown Status form field auto sets to Active Coupons.
This makes the Inactive Coupons invisible. If you want to see the Red Active and the Green Inactive status when changing statused then simlpy follow the these instructions:
Enjoy
in catalog/admin/coupon_admin.php
find:
if ($HTTP_GET_VARS['status']) {
$status = tep_db_prepare_input($HTTP_GET_VARS['status']);
} else {
$status = 'Y';
}
Replase with:
if ($HTTP_GET_VARS['status']) {
$status = tep_db_prepare_input($HTTP_GET_VARS['status']);
} else {
$status = '*';
}
The fix did not show correctly in the description in my last submission - it is in the downloaded file
If you have error when adding GV to cart or checkout using V5.20a then try this fix in catalogincludesclasses/paymant.php
// Start - CREDIT CLASS Gift Voucher Contribution
// function javascript_validation() {
function javascript_validation($coversAll) {
//added the $coversAll to be able to pass whether or not the voucher will cover the whole
//price or not. If it does, then let checkout proceed when just it is passed.
$js = '';
if (is_array($this->modules)) {
if ($coversAll) {
$addThis='if (document.checkout_payment.cot_gv.checked) {
payment_value='cot_gv';
} else ';
} else {
$addThis='';
}
// End - CREDIT CLASS Gift Voucher Contribution
REPLACE WITH THIS
// Start - CREDIT CLASS Gift Voucher Contribution
// function javascript_validation() {
function javascript_validation($coversAll) {
//added the $coversAll to be able to pass whether or not the voucher will cover the whole
//price or not. If it does, then let checkout proceed when just it is passed.
$js = '';
if (is_array($this->modules)) {
if ($coversAll) {
$addThis='if (document.checkout_payment.cot_gv.checked) {
payment_value='cot_gv';
} else ';
} else {
$addThis='';
}
// End - CREDIT CLASS Gift Voucher Contribution
In checkout_payment.php, if your tables become lop-sided here is the fault.
search for directly below the <!-- body_text //-->:
<?php
// Start - CREDIT CLASS Gift Voucher Contribution
// <td width="100%" valign="top"><?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php /* End - CREDIT CLASS Gift Voucher Contribution */ ?>
replace with:
<?php
// Start - CREDIT CLASS Gift Voucher Contribution
// <td width="100%" valign="top"><?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?>
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php /* End - CREDIT CLASS Gift Voucher Contribution */ ?>
no file attached, it is simply a table in the wrong spot
patch of the difference between 5.20_1 and 5.20_2 included in package
Full package
Credit Class and Gift Voucher/Coupon V5.20 contribution for osCommerce RC2/RC2a
Includes all fixes up to June 18 2008.
Fixed a typo error. only one file changed - but this is a FULL package
Feel free to give feed back!
The NEW Paypal has NOT been tested (paypal_standard.php - only). Other older versions have been depreciated - grab and old file if you still want it.
Feel free to give feed back!
Credit Class and Gift Voucher/Coupon V5.20 contribution for osCommerce RC2/RC2a
Includes all fixes up to June 18 2008.
Cleaned up files - coded and formatted to OSC standards - properly marked all changes with the same type of comment.
The NEW Paypal has NOT been tested (paypal_standard.php - only). Other older versions have been depreciated - grab and old file if you still want it.
Feel free to give feed back!
Fixes an issue when a customer buys a gift voucher and pays with paypal, the order_id stored in the coupon_gv_queue table is always 0.
The problem is that the order id that is being stored is referencing a global, but the call is nested in the paypal payment class
so $insert_id is not in the global scope.
The fix is to update all definitions of the update_credit_acount method to accept a second $order_id param.
All calls to update_credit_account($i) should also be replaced with update_credit_acount($i,$insert_id).
MOD INSTRUCTIONS ATTACHED
This fixes an issue existing in CCGV 5.19.
If you try to edit a special then you will get a blank screen due to a
PHP error. The function tep_set_coupon_status() is redefined when
tep_set_specials_status() is invoked, but it was already defined in
CCGV5.19/catalog/admin/includes/add_ccgvdc_application_top.php.
The fix is to remove the redundant function definition from
CCGV5.19/catalog/admin/includes/functions/general.php
Considering that product_price() only uses its argument in calling get_product_price(), which in turn sanitizes it with tep_get_prid(), I do not see how the proposed change can make a difference.
I suspect that to fix the problem, one should go to Modules, Order Total, edit, and toggle Include Shipping.
Hi all, found an other bug when creating a new voucher.
In admin/coupon_admin.php, line 159
replace
$insert_id = tep_db_insert_id($query);
by
$insert_id = tep_db_insert_id();
this will prevent to have errors when adding a new voucher.
This will also fix when there is no name or description in final voucher
Just found a bug when you are restricting coupons to certain categories using a percentage. The bug causes the redemtion to deduct the coupon amount from the shipping costs.
To fix, open up /includes/modules/order_total/ot_coupon.php
locate line 230
and change
$pr_c = $this->product_price(tep_get_prid($order->products[$i]['id']));
to:
$pr_c = $this->product_price($order->products[$i]['id']);
and thats it
there are two definitions for ERROR_REDEEMED_AMOUNT_ZERO that comes up when a valid coupon number is added, but the restrictions(i.e. uses, expiration date, etc.) prevent it from being used.
the two are defined in:
catalog/includes/languages/english/add_ccgvdc_english.php
catalog/includes/languages/english/modules/order_total/ot_coupon.php
And called for in catalog/includes/modules/order_total/ot_coupon.php
---------------------------------------------------------------------------------------------------------------------------
1. *** catalog/includes/languages/english/add_ccgvdc_english.php ***
REMOVE OR COMMENT:
define('ERROR_REDEEMED_AMOUNT_ZERO', '<br>***HOWEVER:No reduction available, please see the coupon restrictions***');
2. *** catalog/includes/languages/english/modules/order_total/ot_coupon.php ***
CHANGE:
define('ERROR_REDEEMED_AMOUNT_ZERO', 'a valid coupon number. HOWEVER: No reduction will be applied, please see the coupon restrictions that was sent within your offer email**');
TO:
define('ERROR_REDEEMED_AMOUNT_ZERO', '*** This is a valid coupon code. HOWEVER: No price reduction can be applied, please see the coupon restrictions that were sent with your email offer. **');
3. *** in catalog/includes/modules/order_total/ot_coupon.php ***
CHANGE:
if ( strlen($cc_id)>0 && $coupon_amount==0 ) {
$err_msg = ERROR_REDEEMED_AMOUNT.ERROR_REDEEMED_AMOUNT_ZERO;
} else {
$err_msg = ERROR_REDEEMED_AMOUNT.$coupon_amount_out;
}
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode($err_msg), 'SSL'));
TO:
//lildog ccgv coupon restrictions error fix
if ( strlen($cc_id)>0 && $coupon_amount==0 ) {
// $err_msg = ERROR_REDEEMED_AMOUNT.ERROR_REDEEMED_AMOUNT_ZERO;
$err_msg = ERROR_REDEEMED_AMOUNT_ZERO;
} else {
$err_msg = ERROR_REDEEMED_AMOUNT.$coupon_amount_out;
}
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode($err_msg), 'SSL'));
This fix adds a new text so at checkout_payment.php when a GV is redeemed/applied to an order with the redeem box, it says "The gift voucher has been successfully added to your gift certificate account for "... instead of "The coupon has been successfully applied for "... It also clarifies a little bit what to do after a voucher has been applied to their account. See enclosed Screenshot.
in catalog/includes languages/YOUR LANGUAGE(s) HERE/add ccgvdc_english.php:**REPEAT WITH ALL LANGUAGES YOU USE***
FIND:
define('ERROR_REDEEMED_AMOUNT', 'The coupon has been successfully applied for ');
ADD AFTER:
define('ERROR_REDEEMED_AMOUNT_GV', 'The gift voucher has been successfully added to your gift certificate account for ');
define('ERROR_REDEEMED_AMOUNT_GV_2', 'You may now use this as payment below by checking the 'used from Gift Vouchers box'.');
in catalog/includes/modules/order_total/ot_gv.php
FIND:
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_REDEEMED_AMOUNT. $currencies->format($gv_amount)), 'SSL'));
CHANGE TO:
tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error='.$this->code.'&error=' . urlencode(ERROR_REDEEMED_AMOUNT_GV. $currencies->format($gv_amount).'. '.ERROR_REDEEMED_AMOUNT_GV_2), 'SSL'));
Small fix to an issue when credit balance covers all and you have shipping included, but you still get an error where the system wants you to choose payment method even if it's not supposed to.
First change following in checkout_confirmation.php and checkout_process.php:
if ($credit_covers) $payment=''; //ICW added for CREDIT CLASS
to:
if ($credit_covers) $payment='credit_covers'; //ICW added for CREDIT CLASS
And to includes/classes/payment.php:
if (defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED)) {
to:
if (defined('MODULE_PAYMENT_INSTALLED') && tep_not_null(MODULE_PAYMENT_INSTALLED) && !$module == 'credit_covers') {
That's it! Now if credit covers whole order, it won't try to load any payment module. Didn't want to use $payment as an empty string to keep better track of changes.
Included a text file with this information.
there is a erro in
CCGV5.19
in
catalogincludesclassespayment.php line 89
if ($coversAll) {
$addThis='if (document.checkout_payment.cot_gv.checked) {
payment_value=cot_gv; alert ('hey yo');
} else ';
} else {
$addThis='';
}
it will case not get payment value
change to
if ($coversAll) {
$addThis='if (document.checkout_payment.cot_gv.checked) {
payment_value='cot_gv';
} else ';
} else {
$addThis='';
}
in admin/gv_mail.php
$insert_id = tep_db_insert_id($insert_query);
in create_account.php
$insert_id = tep_db_insert_id($insert_query);
this may cause can not get ID for insert in to next table
and the admin/gv_sent.php can not get anything
change to
$insert_id = tep_db_insert_id();
all is ok
no file include
around on gv_mail.php 84
$insert_id = tep_db_insert_id($insert_query);
this can not get $insert id and have the next db operation may be erro
around on create_accout.php
251
$insert_id = tep_db_insert_id($insert_query);
the same erro
change to
$insert_id = tep_db_insert_id();
all good
full files with bug fix on ccgv5.19
There is a bug in the coupon report in the coupon admin section. This is where you can select a coupon and then click "Report". The bug is that the admin section says there have been X redemption and then you click into report and it says there are Y redemptions.
To fix, edit /admin/coupon_admin.php
around line 226 where:
$cc_query_raw = "select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . (int)$coupon_id . "'";
$cc_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $cc_query_raw, $cc_query_numrows);
$cc_query = tep_db_query($cc_query_raw);
change to:
$cc_query_raw = "select * from " . TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . (int)$coupon_id . "'";
$cc_query = tep_db_query($cc_query_raw);
$cc_query_numrows = tep_db_num_rows($cc_query);
$cc_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $cc_query_raw, $cc_query_numrows);
the splitPageResults function wasen't receiving anything for $cc_query_numrows.
The TYPE keyword in MySQL has been deprecated. This file replaces all instances of the TYPE keyword with the proper ENGINE keyword. Enjoy. This file is from the 5.19 CCGV package.
This contains no files, this is just a note to say that i have added some install notes to the version 5.19 in english, if anybody wants to take the reigns on this and start to translate/improve my install notes then feel free, :)
English install notes included. hope these are helpful. this should help install this on a heavily modded site, while at the same time giving you a small lesson in where to look to change link texts etc.. :)
The CCGV5.18 now with danish language
A few fixeds for ccgv that include ability to add dollar signs before the amount when sending GVs in catalog and admin. Button alignments table cleanups and colored bar at the bottom og the send gv page.
I posted these fixes and no one responded, they worked for me. apparently no one cares that an amount of 0.00 is returned when a customer sends a gv to someone and enters the amount as $10.00 and not 10.00......
full version + patches
This is just a roll up of 5.18 plus all of the patches since 7 Nov 2006. Downloaded, but didn't apply checkout_payment.php FIX from xXDesertRoseXx on 24 Dec 2006 (files are in this zip if needed).
Hope this saves you some time.
We still need someone to write up some manual instructions. Included are instructions for 5.16.
This fixes an issue introduced by CCGV 5.18.
If you redeem a gift voucher that could cover an order, but you do not use the voucher to pay, then it skips your payment module's pre_confirmation_check(). However, it still uses your payment module, which might error out because of the earlier skipped step.
The fix is to check whether you are using the voucher to pay. If not, then do not set $credit_covers = true.
As ridiculous as it may seam, this is simply a replacement for the CCGV Release Button.
It amazingly replaces the release button that says "Redeem" with one that says "Release" in the "Gift Voucher Release Queue" page of the Admin.
The previous Redeem Button may lead to some confusion when you really need to Release the Gift Voucher.
To apply this fix simply copy the included "button_release.gif" over the one installed at:
OsC_catalog/admin/includes/languages/english/images/buttons/
If you are getting this error.
unexpected $end in C:xxxxxxxxcatalogcheckout_payment.php on line 577
try changing lines 190 - 193
}<? } else { $coversAll=false;?>
function clearRadeos(){
document.checkout_payment.cot_gv.checked=!document.checkout_payment.cot_gv.checked;
}<? } ?>
to this
}<?php } else { $coversAll=false;?>
function clearRadeos(){
document.checkout_payment.cot_gv.checked=!document.checkout_payment.cot_gv.checked;
}<?php } ?>
I just added the 'php' just after the opening tag and it fixed up the error message I was getting.
CCGV 5.18 Checkout 'ot_coupon.php' Display Fix
This fixes a problem where in checkout (www.yoursite.com/catalog/checkout_payment.php)
the 'Payment Method - Gift Vouchers & Coupons' box formating displays the "Enter Code..."
instructions appear below the "Redeem Code" line and where the "Enter Redeem Code" is in
the wrong font formating.
This file included the replacement 'ot_coupon.php' and the instructions found below.
Edit the file:
catalog/includes/modules/order_total/ot_coupon.php
At line 60 find:
function credit_selection() {
global $customer_id, $currencies, $language;
$selection_string = tep_draw_form('checkout_payment_gift', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post');
$selection_string .= '<div><br />';
$selection_string .= TEXT_ENTER_GV_CODE . tep_draw_input_field('gv_redeem_code', 'redeem code') ;
$selection_string .= tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'onclick="return submitFunction()"');
$selection_string .= '</div><br /></form>';
return $selection_string;
}
Replace this with:
function credit_selection() {
global $customer_id, $currencies, $language;
// START Checkout Display Fix by BTBlomberg
$selection_string = '<tr><td></td><td class="main">';
$selection_string .= tep_draw_form('checkout_payment_gift', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post');
$selection_string .= '<div><br /> ';
$selection_string .= TEXT_ENTER_GV_CODE . tep_draw_input_field('gv_redeem_code', 'redeem code') ;
$selection_string .= ' ';
$selection_string .= tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'onclick="return submitFunction()"');
$selection_string .= '</div><br /></form></td></tr>';
// END Checkout Display Fix by BTBlomberg
return $selection_string;
}
This will put the instructions above the Redeem Code line and fix the Font issue with
the text before the entry box "Enter Redeem Code". More may be able to be done to clean
it more but this will get it working better than it was.
By BTBlomberg 12/10/2006
The GV total order is wrong !
In version 5.17, 5.18 at least in line 57 to 60
$order->info['total'] = $order->info['total'] - $od_amount;
$order->info['total'] = tep_round($order->info['total'],2);
$od_amount = tep_round($od_amount,2);
$order->info['total'] = $order->info['total'] - $od_amount;
GV amount ($amount) is calculated 2 times !
May be one more ?
So comment one of these lines
// $order->info['total'] = $order->info['total'] - $od_amount;
And you xill get a correct GV amount.
The link given in the last upadate by mauriziomagnino below is for CCGV(trad). It is based more on an earlier (bug free) version of CCGV.
However, if you download the following from this version you will have a fully functional CCGV with a few things that aren't covered in CCGV(trad) such as 'auto-release' of vouchers/queue (disabled in CCGV(trad) for security reasons) if you don't want to release them manually, the Treeview and the Coupon roll up1,2 3 which allows much easier/convenient control of coupons administration and also the handy coupons redeemed info pop-up for product_info.php
----------------------------------------------
Rigadin 22 Apr 2005-Full Contribution
Rigadin 18 May 2005-Fix
Gyakutsuki 24 May 2005-Fix
Jennifer Sullivan 26 May 2005-Fix
Taryn 29 May 2005-Fix
Beer Monster 8 Aug 2005-Treeview Add-on
molafish 22 Feb 2006-Good Add-on
The above list of downloads work fine as long you don't get carried away with contribution add-ons from people who have posted little adjustments and then not helped fixing them or putting them right.
----------------------------------------------
If you have this version of CCGV installed then this is STILL the thread for you:
http://forums.oscommerce.com/index.php?showtopic=158518
There is a blank file attached - nothing to download here.
support :
http://forums.oscommerce.com/index.php?showtopic=158518&st=4220
For use Credit Class & Gift Voucher
Install contrib, install with phpmyadmin the SQL file.
Go to ADMIN / configure.php page
Select DOWNLOAD OPTION
Set Enable download to TRUE
Go to ADMIN / module.php option
Select Order Total
Install : Gift Vouchers (-)
Install : Discount Coupons
Go to ADMIN / module.php option
Select Payment
Install Credit Class Error
For Use Credit Class & Gift Voucher
Go to ADMIN / Vouchers/Coupons option
Attention please, for create the Credit Class in catalog, use
ADMIN / Catalog / "Categories/Products"
full version + patch
cor correct payment to browser with javascript disabled
fix the file : CATALOG/checkout_confirmation.php
to lin 60
// ################# Added CGV Contribution ##################"
// CCGV Contribution
$order_total_modules = new order_total;
$order_total_modules->collect_posts();
$order_total_modules->pre_confirmation_check();
add :
// >>> FOR ERROR gv_redeem_code NULL
if (isset($_POST['gv_redeem_code']) && ($_POST['gv_redeem_code'] == null)) {tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));}
// <<< end for error
When you send a voucher to an email address from the shopping cart (and possibly from admin), its likely the recipient won't ever be able to redeem the vouchers.
When sending the voucher email, a SQL error may be displayed: (i was not seeing the error however until I put a break in gv_send.php)
[quote]Warning: mysql_insert_id(): supplied argument is not a valid MySQL-Link resource in /home/USERNAME/public_html/catalog/includes/functions/database.php on line 112[/quote]
The fix for this seems to be:
BACKUP NOW!
/catalog/gv_send.php
find -->
$insert_id = tep_db_insert_id($gv_query);
replace with-->
$insert_id = tep_db_insert_id();
the extra $gv_query inside the brackets was causing a 0 to be returned instead of the 'just created' coupon record id. This in turn stopped a user redeeming the voucher as the coupon_id link between the coupon and coupon_email_track tables were broken, coupons containing the real coupon_id and coupon_email_track containing 0 for coupon_id.
Hope that helps.
Also there is a bunch of rubbish in the more recent /catalog/gv_redeem.php files - it is a set of fixes (that dont seem to work even when applied correctly) that have been inadvertently pasted in and gone unnoticed by everyone, I cant say wether they actually cause any problems or not..
to remove the mistake, delete from:
/*
GV_REDEEM_EXPLOIT_FIX (GVREF)
down to and including the line:
define('TEXT_NEEDS_TO_LOGIN', 'We are sorry but we are unable to process etc etc............
BACKUP FIRST!
No file attached..
derived on free contrib for zen-cart, the image EURO for gift
version 5.16 + all patch
not included German tax.
+ Credit Stats
file TAR GZ2
full version !
THIS DOWNLOAD IS A BLANK FILE.
There has been some confusion on which package to download with the version 2 instructions. It is still CCGV5.16 by BlueNoteMKVI. Download the Version2 instructions dated 30th June 2006 and then download CCGV5.16 and you will have all that you need to install the excellent Credit Class & Gift Voucher contribution. Have fun.
Hi,
I don't know how you can NOT to add the full package... The last complete pack is dated "8 Feb 2006" and have 15 new updates, and no update have the complete pack...
It is not any effort to upload yours mods + full package, because it is in your PC... and If someone want to use this contrib withe the last updates, it will take hours in updating it...
Can somebody upload the complete package with all the updates? Thanks. Greetings.
Hello just thought I would post a bug fix for a small problem which occur if a customer decide to change is mind and NOT use is gift voucher balance after all.
Basically once the box is ticked, even if you go back to checkout_payment and leave the box unticked, the balance is still used.
Even if you log off and back in, its still registered with the session !
Anyway here is the line that need to be added to get rid of this bug:
In checkout_payment.php
After:
if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers'); //CCG
Add:
if(tep_session_is_registered('cot_gv')) tep_session_unregister('cot_gv'); //CCGV
And we might as well clean this up in logoff.php also
After
tep_session_unregister('gv_id');
Add
tep_session_unregister('cot_gv');
Note that this problem does not apply to Discount codes, only the gift vouchers.
Only dummy file attached, all instruction required are in here
The previous set of instructions have been, combed through, edited and finally re-released here. Hope they are helpful. They contain instructions on how to manually install this excellent contribution. And have far fewer errors than the previous version.
All kudos must go to the original author(bopper) who obviously spent days of effort in creating these instructions. Errors or no errors, it has been very helpful to me and i hope you find these updated instructions just as helpful.
DEATHGOD
broke out the manual installation into steps...
sql, new files, files to edit and the edits...
no promises but close to golden
Corrected version for admin/includes/languages/german/coupon_admin.php
No fullpackage
Englisch:
Sorry, I included the wrong File in the .zip Package...
Here the new Package with the right ot_coupon.php
You do not need to download the Version below, this is the complete Package!
German:
Sorry, ich hatte die falsche Datei ins .zip-Package gepackt...
Hier das neue Package mit der richtigen ot_coupon.php
Ihr braucht das andere Package nicht herunterzuladen, dies ist das komplette Package!
To install this you need only one File with the included one.
German Support Thread: http://forums.oscommerce.de/index.php?showtopic=40684
What this Fix does:
English:
The original Code just doesn't work for German Tax System, total and tax (VAT) arent re-calculated correctly.
So I decided to rewrite most of the Code to work for German Tax System (perhaps this also works for other countrys, you have to try it out)
I think the Code is now also much more clean and easier to understand (only needed lees than half the Lines of Code!).
Note that this Code is ONLY A FIX FOR THE COUPON-PART! The Gift-Vouche Part isn't fixed yet!
German:
Der original Code funktionierte nicht für das deutsche Steuersystem, Summe und MwSt.wurden falsch berechnet.
Also habe ich beschlossen den größten Teil des Codes neu zu schreiben damit er für das deutsche Steuersystem funktioniert (eventuell funktioniert der Cde auch für andere Länder, müsst ihr ausprobieren)
Ich denke der Code ist jetzt wesentlich sauberer und leichter zu verstehen (nichtmal mehr halb soviel Code!).
Beachtet das dieser Code NUR EIN FIX FÜR DEN COUPON-TEIL ist! Der Gutschein-Teil (Gift-Voucher) ist noch nicht gefixt!
v1.1 of my fixes instructions
This is for CCGV5.16, and is NOT the entire package, just a text file with revised instructions. (this instruction file replaces the original one)
NEW: add missing define in language file
NEW: align redeem button to input text field
0) add define for IMAGE_REDEEM_VOUCHER
1) fix the misalignment of the gift voucher/coupon code redeem table. including alignment of input field to redeem button image.
2) eliminate the checking of credit card info when the redeem button is pressed. i.e. redeem without entering credit card info, which is anyway erased after redeeming the coupon code.
3) move the gift voucher/coupon code table above the credit card table
4) fix round off errors in subtracting coupon value
5) checkout_confirmation.php does not pass coupon code to checkout_process.php
-avi
My first contribution... hope someone finds this useful.
This is for CCGV5.16, and is NOT the entire package, just a text file with instructions.
1) fix the misalignment of the gift voucher/coupon code redeem table.
2) eliminate the checking of credit card info when the redeem button is pressed. i.e. redeem without entering credit card info, which is anyway erased after redeeming the coupon code.
3) move the gift voucher/coupon code table above the credit card table
4) fix round off errors in subtracting coupon value
5) checkout_confirmation.php does not pass coupon code to checkout_process.php
-avi
This release only adds one new feature to the coupon admin page:
added to the coupon_admin page (without having to click on report):
- number of redemptions
- date of last redemption
- redeemed coupons view filter
This rollup is comprehensive, in that it includes all the changes from the coupon admin bug rollup packages 1 and 2 that I posted earlier.
I've included a screenshot for your viewing pleasure.
This is a "diff" of modified files from "oscommerce-2.2ms2 update 051113" and CCGV5.16.
I successfully used it in a very personalized OSC:
zcat CCGV5.16.patch.gz | patch -F 3 -p1
You Assure that the format of the files been involved is unix
error in v5.16 cause the email sent by this file to contain duplicate text.
Fix:
lines 81-83
$gv_email .= EMAIL_GV_LINK . ' ' . "<a HREF='" .
tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $id1,'NONSSL',false) . "'>" . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $id1,'NONSSL',false) . "</a>n" .
$gv_email .= "nn";
Change to:
$gv_email .= EMAIL_GV_LINK . ' ' . "<a HREF='" .
tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $id1,'NONSSL',false) . "'>" . tep_href_link(FILENAME_GV_REDEEM, 'gv_no=' . $id1,'NONSSL',false) . "</a>n" ;
$gv_email .= "nn";
replace '.' with ';' at end of line 82
Some file-errors:
"admin/filenames.php"
should be:
"admin/includes/filenames.php"
"admin/languages/"your_language.php"
should be:
admin/includes/languages/"your_language.php"
I've updated the Install-instructions for a better english . . .
sorry for that
I've made an addon for this contrib to view the credit stats of the customer.
Please tell me your opinions.
Aki
-Based on 5.15a2
-Incorporates all fixes to date, including:
--Coupon admin fix (thanks to molafish)
--Change English order total module back to English (thanks to HallMarc)
--Included the full PayPal IPN contribution to avoid errors about missing files (thanks to brucelim)
--Removed debug code (thanks to hillro)
--Coupon admin fix #2 (thanks to molafish). I moved the extra function into add_ccgvdc_application_top.php, this way you do not need to modify includes/functions/general.php.
--Updated rollup #2 to fix decimal places (thanks to insomniac2)
-In addition to packaging all of this up into one file, I fixed several things that were bugging me:
--Several places in the files were different from the original osCommerce files by only a few whitespace characters. I have updated the contribution files to match the osCommerce files. This will help you if you use a file comparison program to install this package.
--Integrated several security fixes from osCommerce 2.2 Milestone 2 Update 051113
--Removed extraneous defines.
---All of the database tables and files are defined in add_ccgvdc_application_top.php, so there is no need to update database_tables.php or filenames.php. Only one line needs to be changed in application_top.php.
---All of the necessary language defines are in add_ccgvdc_$language.php or separate files in the $language directory. Only one line should be added to $language.php.
This is a complete package. I have installed it on a new installation I'm working on for a client and so far have had no problems. I will update this package with fixes should I run into any.
Please direct all support requests to the forums.
Thanks to all who came before me to update this package!
I still had a problem with the numbers showing no decimal places ... so I simply adjusted the number_format fields fixed by molafish who by the way did a great job figuring that problem out.
No other changes have been made other than the number_format to show 2 decimals
Again .. thanx molafish.
This corrects several bugs in the coupon admin page within CCGV.
This rollup is comprehensive, in that it includes all the changes from the coupon admin bug rollup 1 that I posted earlier.
These are the bug fix highlights exclusive to rollup 2:
- fixed Date Created field from being reset to the modified date upon editing coupons.
- fixed coupon_admin from reporting coupon already exists after receiving an error when editing a coupon.
- cleaned up display of coupon amounts and coupon minimum order. Only display post decimal data if coupon amount has a decimal value (i.e. 10% instead of 10.00%).
- added Coupon Minimum Order to coupon_admin summary box.
- fixed formatting text entries in coupon_admin summary box.
- added the green and red radio buttons that categories.php uses for active/inactive status. This replaces the old coupon_admin.php method of 'deleting' coupons to mark inactive. Now you can delete coupons altogether through the admin page.
- fixed next page link from always resetting display back to 'Active Coupons' sort.
- fixed delete and confirm delete buttons from always resetting page display to 'Active Coupons' sort, page 1.
I've included a screenshot for your viewing pleasure.
There is what appears to be some bad debug code left over which does not do anything except cause errors. This patch removes the code from checkout_payment.php
<<Fix some Paypal Mod error (is work fine to me) Not a Full Package, u still need to dowload CCGV5.15a2 1st>>
refer to forums http://forums.oscommerce.com/index.php?showtopic=43364&pid=783972&st=440&#entry783972
Guys if u face below problem in admin:"Payment Modules" page
Warning: main(/home/yourdomain/domains/yourdomain.com/public_html/catalog/includes/languages/english/modules/payment/paypal_ipn.php): failed to open stream: No such file or directory in /home/yourdomain/domains/yourdomain.com/public_html/catalog/admin/modules.php on line 128
Warning: main(/home/yourdomain/domains/yourdomain.com/public_html/catalog/includes/languages/english/modules/payment/paypal_ipn.php): failed to open stream: No such file or directory in /home/yourdomain/domains/yourdomain.com/public_html/catalog/admin/modules.php on line 128
Warning: main(): Failed opening '/home/yourdomain/domains/yourdomain.com/public_html/catalog/includes/languages/english/modules/payment/paypal_ipn.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/yourdomain/domains/yourdomain.com/public_html/catalog/admin/modules.php on line 128
but i still face problems in checkout_process.php
in catalog: "Delivery Information" page
once i click on continue button, the link page is blank page.y?anyone got this idea to fix it?
Good Luck n thanks
A slight oversight here. This whole mod is set for English installation yet that one file installed in French. This is the English version just replace your file in cataloginludesmodulesorder_totalot_gv.php
This corrects several bugs in the admin interface of the Coupon Administration.
I thought I would release it before the big contribution because it's just one file replacement and adding 1 section to a language file.
Here's the highlights:
- Fixed coupon_admin from overwriting dates and customer uses fields to defaults when editing or displaying an error.
- Removed non-working length check of coupon_name field in coupon_admin, fixed other possibly non-working checks. (instead of fixing the check, I made the name optional. It was desirable for me to have the option to display just the coupon code to the customer).
- Fixed problem where free shipping coupons deduct an additional amount (if the amount was specified on the coupon_admin page) above the shipping cost. During coupon creation now, the amount will be zeroed out if free shipping is checked.
- Fixed missing or hard coded language text used on coupon_admin page for errors and buttons.
- Changed Coupon Name help text to reflect the unrequired nature of that field. (Your contrib probably still displays nothing if the name field is blank for a language - I have changed all instances of that to display the coupon code instead in my unpublished contrib. Until I put up the full contrib, just continue to enter the coupon name field to avoid this).
This is simply the previous part 1 and part 2 files that were in rar format put together into one zip file for people without the ability to unzip a rar file.
This file contains catalog files . All the install instructions as well as SQL fileare in part 2.
Also remove the .zip from the file name as this file is actualy a rar (would not upload as an rar)
Updates in clude the following:
Includes easy to install Easier to Understand Payment Addon v1.2 (and Joseph Primanti's (primadude) Fixes)
Now coupons work on first time entered!!
This file contains install instructions as well as SQL file. All the catalog files are in part 1.
Also remove the .zip from the file name as this file is actualy a rar (would not upload as an rar)
Updates in clude the following:
Includes easy to install Easier to Understand Payment Addon v1.2 (and Joseph Primanti's (primadude) Fixes)
Now coupons work on first time entered!!
Do not use the CCGV 5.15a file below as it has an error.
This file contains all the catalog files. Download part 2 for install instructions as well as SQL file.
Also remove the .zip from the file name as this file is actualy a rar (would not upload as an rar)
Updates in clude the following:
catalogincludeslanguagesenglishmodulesorder_totalot_coupon.php (thanks to bonhommie) "ERROR_REDEEMED_AMOUNT_ZERO" Fix
catalogincludesclassespayment.php (thanks to clustersolutions) "Cart Total Less Than Voucher Amount" Fix
Spanish image for credit class fix (thanks to jaleel)
Clickable link in sent gift voucher/coupons
catalogincludesmodulespaymentpaypal_ipn.php Voucher balance deduction fix
No more 1146 errors.
No more manual editing the files on simple install.
This is the install instructions for part 1 and also contains the SQL file.
This is an update to the 5.15 - basicly I fixed the dreaded 1146 error problem.....
Also includes bonhommie's Fix for 'ERROR_REDEEMED_AMOUNT_ZERO' error for COUPONS 5.15
If you find a error and you fix it - please take the time to upload the corrected file. No sence in everyone wasting a lot of time doing the same thing.
Change filenale from zip to rar
the original image for spanish is in english, my friend made it in spanish for me.
just replace the one come with 5.15 with this one
This is just an update for anyone who installs the contrib and plans to use the COUPON functionality. Some of the commands for the COUPON and the GIFT VOUCHER are in the same files.. some are not.
if you encounter the problem above where you get an error EVEN THOUGH the coupon is applied (and you will if you install version 5.15), you need to include the define line
[code]
define('ERROR_REDEEMED_AMOUNT_ZERO', 'a valid coupon number. HOWEVER: No reduction will be applied, please see the coupon restrictions that was sent within your offer email***');
[/code]
in the osc/includes/languages/english/modules/order_total/ot_coupon.php file and not in the
osc/includes/languages/add_ccgvdc_english.php file.
NOTE: that in the version 5.15, the define line is ALREADY INCLUDED in the osc/includes/languages/add_ccgvdc_english.php file and this error is still encountered (because this file works for the GV alone).
All you do is copy the above code and paste in the ot_coupon.php file and you're on your way! or use the attached file.
if you're using the GV alone, you don't need this step because the code is already in the file.
thank you guys for all your contributions.
maybe somebody who plans to put out an update on the 5.15 can include this oversight in the package.
Bukie
This should apply to 5.14, and 5.15 assuming the code I mention is identical which it should be since 5.15 is a repack.
Basically your commenting out one of the functions that JONYO within the "easier to understand update contribution" adds, it causes an error when
someone wants to purchase products from your site, has an active voucher, but chooses NOT to use it at the time of purchase because they are saving
it for something else in the future (assuming you have repeat customers). This error occurs whether the checkbox is selected or not selected when the total order
value is LESS than the Voucher balance which creates this problem. (If the total order is greater, then the problem is not apparent)
Even if you don't use the voucher and want to pay for an item via paypal or CC or MO, the bug would not pass the data to the proper payment module, yet an order is
still placed in the database for something that hasn't been paid for.
Also 5.15 is not a final fix because the installation routine is STILL in french. Use caution, I only found this out by mistake of looking and comparing against the original installation of 5.14.
Incorporates version 5.14 and fixes up-to-date. And also a fix to the files:
catalog:includes:modules:order_total:ot_coupon.php
catalog:includes:modules:order_total:ot_gv.php
to stop the payment input checking from being circumvented.
All credit to those below.
Cheers,
Emmett ( yesUdo )
This contains a text document with allsorts of SQL that can be used to clear down the CCGV system, delete a specific coupon/voucher and help find allsorts of useful info.
use these at your own risk and before you do
!!!!ALWAYS MAKE A BACKUP OF YOUR DATA!!!!
HTH
Si.
An amalgamation of many pieces of information which resulted in this file which makes the most excellent Authorize.Net AIM solution work with the most excellent CCGV v5.14 solution.
There were two authors that helped me get this solution together. They are Austin Renfroe and Kevin Bray.
Thank you!!
Here we go again. This should nail it this time. I had missed a very small but vital piece of code in the readme.html.
This has now been tested by others and works fully.
Ignore v1.1 and v1.0 listed in this contribution area, just use this one.
Aaron
There were some missing bits in the readme file from my previous contribution of the same title ( a couple of entries below)
This is a complete file. Ignore the one below.
Aaron
Includes a text file with instructions for fixing the MODULE_ORDER_TOTAL_COUPON_TEXT_ERROR and buttons that are closer to oscommerce-style buttons.
How many times do you have to explain to customers how to use their gift vouchers?
Thankfully, not so much after I installed this beauty.
This is an addon to this contribution based on v5.14
It is designed to make the payment screen when using gift vouchers easier for the customer to understand and use.
Support thread has been started here for this addon
http://forums.oscommerce.com/index.php?showtopic=180746
There is a easy to read readme.html with a sample picture of what you get after the install.
Aaron
This is a correction to the redeem message at checkout_payment.php which informs the customer when a voucher has been applied. It now also shows a warning if the voucher does not meet the criteria.
eg
order £5 minimum order value £20
message will show:-
The coupon has been successfully applied for
***HOWEVER:No reducion available, please see the coupon restrictions***
order £5 minimum order value £0 5% discount
message will show :-
The coupon has been successfully applied for £0.25
HTH
Si.
If you are trying to install CCGV as I was, you are probably trying to decide which of these contributions you should start with. Based on advise from the support forum, I went back to Rigadins Full Package 5.13 22Apr2005 as my starting point.
This is NOT a contribution and will not get a working install of CCGV, but contains notes that explain which files changed in most of the contributions since v5.13 and whether to use them or not.
As I mention in the notes, to get an actual working version on my store, I had to hack and hardcode a number of things that are only applicable to my store and my implementation of CCGV. I will try and post some notes on the changes that I made after the listed contributions, but wanted to make these notes available first.
Adds a box on the account.php page which shows the Gift Voucher Balance and an FAQ link
Rearranges the 'credits available' box in checkout_payment.php, which before I thought was un user-friendly and just confusing. There are two screenshots included so you can check you like it before you install!
Unfortionatly the patch will only work on a fresh, unaltered install of osCommerce 2.2 ms2. It has to do with the patch checking binary differences to determine the version of the files themselves. The binary differences are incorrect for the files that you have changed so the patch thinks its the wrong version. I am researching a workaround for this. Sorry, I tried.
Few minor bug fixes.
Sorry, this is a duplicate upload. I displayed the wrong version in the first one.
I do not take credit for creating this contribution. I just extremely simplified its installation.
I haven't had time to completely test this so "YOU" will be the tester. I strongly suggest you backup your database and the entire /catalog/ directory before the installation. If I get positive feedback about this new install process, then I might start doing it for other contributions.
This was made to work with osCommerce 2.2 ms2 and should work with any modifications that you might have made to your store as long as the file names and directory structure is unchanged. Added files will not effect the installation. You will get errors if you are missing english.php, german.php, or espanol.php because those language files are the 3 that are bieng edited. You can view the errors in the "patch.log" file that will be created.
HOW IT WORKS:
the "patch" will go through all the files that need to be changed and make the necessary changes. It will also add the files that need to be added.
Created by Jesse Shaw using FolderSync
I do not take credit for creating this contribution. I just extremely simplified its installation.
I haven't had time to completely test this so "YOU" will be the tester. I strongly suggest you backup your database and the entire /catalog/ directory before the installation. If I get positive feedback about this new install process, then I might start doing it for other contributions.
This was made to work with osCommerce 2.2 ms2 and should work with any modifications that you might have made to your store as long as the file names and directory structure is unchanged. Added files will not effect the installation. You will get errors if you are missing english.php, german.php, or espanol.php because those language files are the 3 that are bieng edited. You can view the errors in the "patch.log" file that will be created.
HOW IT WORKS:
the "patch" will go through all the files that need to be changed and make the necessary changes. It will also add the files that need to be added.
Created by Jesse Shaw using FolderSync
This contribution adds a categories/products treeview popup to the coupon_admin.php page which allows you to select the valid categories/products for your coupon by selecting the relevant checkboxes. When you close the popup the values are automatically passed back to the coupon_admin.php page.
SEE screen_shot.jpg!!!!!!
This modification is VERY easy to implement. 2 simple steps
1) Backup your existing admin/coupon_admin.php file. This is the only existing file to be changed.
2) Copy the following files to your admin folder:
coupon_admin.php,
treeview.php,
dtree.css,
dtree.js
and the img folder
Tested on Internet explorer and firefox browsers!
Based on ccgv 5.14 but will probably work with earlier versions!
Try it, it really is very cool!
english language only (so far).
I have translated the ot_gv.php to english and have included a couple of admin files that I found to have a problem. If you use a shared ssl cert and you have admin setup to use ssl for all links, the link in emails is not right. In the files I changed the variable referred to was HTTP_SERVER changing that to HTTP_CATALOG_SERVER fixes it for shared ssl users and should also work for others.
Only the changed files are included in the zip file.
Just installed it on a heavyly modded installation.
No problems at all, just make sure you follow the instructions in the HTML file to the letter and compare your files with the ones provided.
One tip: in the provided files search for ICW as well as CGV to find all additions and modifications.
You always have to edit some files (as mentioned in the HTML) even on a clean install and on new files .
No file attached
The directions say to edit the /admin/includes/database_tables.php file but in reality, you must edit the /catalog/includes/database_tables.php file (or possibly both)
The attached zip file is empty.
Using Paypal IPN and CCGV will allow the customer to use a voucher forever. The voucher balance won't be deducted, because the Paypal IPN files are used instead of the checkout_process.php files.
This fix shows the bits that you need to put into the Paypal file to achieve the same results as your other payment processors, like cheque, bank transfers, etc.
Aaron
This is just a small fix on v5.14 to replace the SQL file that was French to English.
My French is good enough to just deal with it, but I've got clients who don't speak French and I know there are other's here who are fluent in neither french or PHP.
Could someone please put together a file with all the fixes for the french problem? I've run through the forum and there are bits and pieces here and there on how to fix it, but not one place for the whole fix.
I thought this latest install would fix it, but alas it did not.
Since the last 2 upgrade haven't been added, here is an update for ya'll labeled as CCGV 5.14, no major updated, but 5.13 was getting a little outdated.
This is the FULL PACKAGE and included the PayPal fix and brettsg's 4 fixes. I don't take no credit for this, just re-packaged and included all of the replaced files for everybody to have the updated version.
Enjoy!
There were several bugs that were posted on the forums over the last month. I have
modified/fixed the following issues to apply to v5.13d:
1) The error: 'MODULE_ORDER_TOTAL_COUPON_TEXT_ERROR' would be posted
upon every coupon redemption.
2) After a successful coupon code entry the message 'Congratulations
you have redeemed' would be displayed in the red box followed by no other text.
3) The 'more info' popup window in the left column after a coupon entry
was not functioning correctly. I modified this code in order to show the
coupon entered instead of having to open a popup window to see the information.
4) The update 5.13b had french configuration keys in the ot_order.php file.
**NOTE*** I did not include the 'Paypal fix as I did not require it.
Therefore, if you use the Paypal feature please download the previous update
in addition to these files.
When using version v5.13d incorrect totals are being sent to paypal and often ending up with a negative total on the paypal screen. A fix is going to require a lot of editing by the contribution author's and I cant even find the forum for this contribution. I have read about other people with the problem so I wanted to post this. This is the easiest way to fix the problem. It is one of the paypal files but what it does is eliminate shipping on the paypal page and simply adds it to the total instead. This keeps everything correct.
Hopefully someone can come out with an actual fix to CCGV?
*BUG in Detail*
Coupon module used by client is incorrectly adjusting the total value of the payment and as such sends false values to the paypal website upon completion of the order.
Problem was that if free shipping was included in the coupon it would send a TOTAL to paypal that included this discount. Unfortunately PayPal was already setting the shipping to = $0 and as such the TOTAL presented to the customer to pay was equal to the algorithm below.
TOTAL = TOTAL - DISCOUNT
Should the total be less than the discount an negative total was used.
Corrected version with the two missing files.
This is nothing more than all the latest updates and fixes compiled into one zip file. It includes the instructions for the clickable email link contribution in the folder, but I didn't integrate it into the script, as I've not tried it out yet.
Some users (like myself) had no clickable link in sent emails. Not a big deal, but much simpler for the gift voucher receiver! After some playing around, I got it fixed! This is a very simple one step modification.
For those of you that have a hard time searching the forum, I've included the fixes for the following files: catalog/includes/modules/order_total/ot_gv.php and
catalog/includes/modules/order_total/ot_coupon.php
It incorporates the previous version's files, and the only thing changed are two typos in each of the files.
Just a little update in ot_coupon payment. Now you can use free shipping with an amount. It does'nt work before.
But I identified another bug ! When you select a special product, you can deduce the coupon. Or I don't think that a good option. It 's interesting to not diplay the coupon case in checkout_payment when you a have a special products !!!
This is only an update: 3 files to copy over v5.13.
It includes:
- Fixes from Joseph Dalton on 30 Apr 2005
- Now customer will always be back to payment page with corresponding message ("no code", "wrong code", "success") when pressing the redeem button.
- Typo error introduced in v5.13 removed, was causing errors in tax calculation.
- Some wrong comments removed.
See txt file for details.
- Rigadin
This is an update to the /includes/modules/order_total/ot_coupon.php file
Simply replace that file for installation
This update fixes the following bugs (see the forums for full details):
* Tax not being deducted for products in valid categories
* Products in valid subcategories not having tax deducted
* Double counting of percentage discounts when multiple valid categories are listed
Regards,
Joseph
Hey guys, installed smoothly, however found spelling error in cat/includes/languages/english/modules/order_total/ot_gv.php.
I uploaded the fixed file here.
Sorry, i mispelled some things in last contrib, please use this.
I think it's useful to let your customers know what kind of discount coupon you deserve for every new registration
It simply adds in index.php two variables
amount and message
amount show up discount amount
and message is the message you associated to that discount
Full package v5.13 with coupon and gift voucher modules.
In this release:
- Important security fix for those having magic_quotes off.
- Previous security fixes
- Bug fixes
Not in this release:
- "Show up discount ..." by Francisco. But you can do his modifications over this one if you want.
- "Easier to understand" modification by Jonyo available in the forum.
Please read install.html file for more details.
I think it's useful to let your customers know what kind of discount coupon you deserve for every new registration
It simply adds in index.php two variables
amount and message
amount show up discount amount
and message is the message you associated to that discount
just the german translation for the coupon_admin.php
$voucher_number=tep_db_prepare_input($HTTP_GET_VARS['gv_no']);
$gv_query = tep_db_query("select c.coupon_id, c.coupon_amount from " . TABLE_COUPONS . " c, " . TABLE_COUPON_EMAIL_TRACK . " et where coupon_code = '" . addslashes($voucher_number) . "' and c.coupon_id = et.coupon_id");
This will cure this very very serious bug.
All thanks and paypal payment to the usual places
i just merged all the content to one file and it works just fine now
Sorry - the bugs were my problem. I had some files that are o/C2.2 mile stone 1 and some files of an earlier version. There is no runtime error when an empty coupon is redeamed.
I introduced a small change to the file checkout_shipping.php (look for the string 05FEB2005). It examones the total weight of the order, and if it is zero, it assignes the content_type = 'virtual_weight'. This causes to skip the shipment address screen, and there is no charge for shipping, of course.
Thanks again for the wonderful contribution!
the final compilation based on all the corrections. i decided to compiled all for my own use, but i guess it might be good if i share with to those complaining that they dont know what to download.
For those people wanting to use this contribution with: osCommerce PayPal IPN Module v1.0 For 2.2MS2.
In short the paypal_ipn.php file integrates some of the code that would otherwise be found in other files e.g. checkout_process.php. In this case the code that can be found in checkout_process is replicated in the paypal_ipn file under the function: before_process()
So in order to maintain compatibility with the Credit Class & Gift Voucher contribution we need to 'remake' those changes here.
Addition to translation GERMAN:
in contrib:
Der Kupon streicht die Versandkosten. Dadurch erhöht sicher der Kuponwert um die Versandkosen bei geringem Bestellwert.
should be:
Der Kupon streicht die Versandkosten. Diese Option überschreibt den Kuponwert, es werden nur die Versandkosten gestrichen. Der Kuponbetrag wird ignoriert.
Only changes in coupon_admin.php
This ist a zip file with german language files for shop and admin section with the file structure.
Not as elagant as the fix posted by Frederic Ricaforte, but a simple one page fix (gv_redeem.php)
would be to add:
// if the customer is not logged on, redirect them to the login page
if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
}
after the line:
require('includes/application_top.php');
The reason I thought to post this is because there are less loose parts and changes all over the place, so less points of failure. This in essence does the same thing to prompt a login or account creation, afterwhich the customer is automatically redirected to the redemption page.
Kudos to Strider and team!
Wlad
GV_REDEEM_EXPLOIT_FIX (GVREF)
---------------------------------------------
* case: guest accounts can exploit gift voucher sent using "Mail Gift Voucher" (admin area),
* by sharing the code until somebody logs with a valid account
* or successfully created new account.
*
* obv: the session remains on user while served as a guest.
* The gift voucher can now be reused to all guest users until
* gift voucher is redeemed
* soln: before releasing the gift voucher, the user must login first
* or asked to create an account.
*
*
-- Frederick Ricaforte
This file basically contains the latest of the latest. So many people have contributed little pieces of code that we must add to 5.10c and so I thought that it would be nice if we could download 1 package that would have all the fixes in one. This package has absolutely no new tweaks, but has all language tweaks and security flaw updates from everybody else, except that you dont need to download them individually anymore. Great work everyone!
This note is so you will understand what is wrong.
I was informed by David M. Graham who was informed by Chris Larocque, of
this problem he provided the test code for the exploit.
He has also informated OSC team of the exploit and they have pulled
one of the contributions until it can be fixed. I thought you might be
able to use this file.
Because of the of the assignment of the value 'virtual_weight' rather than 'virtual' in shopping_cart.php the TAX zone system breaks when delivering virtual products.
Attached file simply points out the line but a simple search of the file is easy enough to do.
Translated this contribution in Dutch.
Hans Mignon
info@cartridge-online.be
I found an error in a file of "German translation"
Use the corrected "add_ccgvdc_german.php"
I translated the descriptions in the german language files into german and changed some errors in writing and grammar.
No other changes are done. This package includes all files and the sql-file which are included in version 510c.
There is an error in the implementation of some code that is executed during the shipping process of checkout that may cause problems with other contributions such as Ryan Hobbs' Address Enhancer.
Full bug description and instructions for implementing the fix are included in the archive file.
Note: It may be useful to perform this fix even without any other contributions installed as it is plausible that this bug could affect other contributions added to your store at a later date.
I translate ccgv-510c into Traditional Chinese language.(include Button)
Add to:
catalog/includes/languages/add_ccgvdc_tchinese.php
catalog/includes/languages/tchinese/gv_send.php
catalog/includes/languages/tchinese/gv_faq.php
catalog/includes/languages/tchinese/gv_redeem.php
catalog/includes/languages/tchinese/popup_coupon_help.php catalog/includes/languages/tchinese/create_account.php
catalog/includes/languages/tchinese/images/buttons/button_confirm.gif
catalog/includes/languages/tchinese/images/buttons/button_redeem.gif
catalog/includes/languages/tchinese/images/buttons/button_send.gif
---------
admin/includes/languages/add_ccgvdc_tchinese.php
admin/includes/languages/tchinese/coupon_admin.php
admin/includes/languages/tchinese/gv_queue.php
admin/includes/languages/tchinese/gv_mail.php
admin/includes/languages/tchinese/gv_sent.php
admin/includes/languages/tchinese/images/buttons/button_confirm_red.gif
admin/includes/languages/tchinese/images/buttons/button_release.gif
admin/includes/languages/tchinese/images/buttons/button_report.gif
---------
There are no updates, bug fixes/pacthes in this release.
This zip file contains ONLY the 2 files:
1. gv_faq.php
2. popup_coupon_help.php
I have made a few corrections to spelling and grammatical errors (possibly the same ones Kristina de Bon made) but I have also added some formatting to "pretty up" the display of the FAQ section.
(see: http://jack-of-arts.com/catalog/gv_faq.php)
There have been NO other changes to these files.
A simple upload & overwrite
All credit to Ian Wilson for this original contribution.
Fixed some typos and grammer in the gv faq file. This is the only file included here. Great contribution! Thanks all.
I fixed a slight bug in the admin so that now when you click on the Catagory's title it will open the catagory, and show the first subcatagory instead of just staying on what ever catagory you where on before.
These are just the "button_send.gif," "button_confirm.gif," and "button_redeem.gif" graphics which go with the "Gift Voucher + Credit Class" contribution. The ones provided in other languages were weak, so here are remade versions in German, French, and Spanish. They go in the catalog/includes/languages/[language]/images/buttons folders. Enjoy!
Translation of the languages files into French.
Traduction des fichiers langues en Français
Hi.
This is a very minor update. I installed the latest version of this credit class module, and noticed a typo in the file I am including here. It causes search-engine friendly redemption URL's to break.
Hope this was helpful.
This fixes some bugs in the last release. I apologize for this having to come out so fast but it needed to be done. Forums for this start about
http://forums.oscommerce.com/index.php?showtopic=52161&st=660
This release fixes most of the bugs that have been found from the previous releases and many that were not found. the simple change log is as follows
Changelog
create_account.php fixed for double email text
Session vars redone to be compliant with osc's api
bugs fixed on computation in discount coupon
bugs fixed within gift voucher
bugs fixed in sending emails with apostrophes. add slashes called for all input variables
documentation added
Defines for creating gv and dc during create account moved to admin store configuration
Please note: indivual file mods are listed within changelog of the install doc
This release should take all the fixes from 5.04 til present that were presented in the forums. Notes on each bug fix etc have been compiled by modom and she is actually the architect of this release. As with any contrib please use good coding practice and make backups prior to installation.
Thanks to everyone that has helped with this. The forum for this release is a continuation of
http://forums.oscommerce.com/index.php?showtopic=52161&st=230 and starts about page 24 or so.
Rob's original fix for product discounts based on percentages worked great for me but it helped me find another problem. If one restricts a coupon to categories and sets a percentage discount the current code calculates incorrectly. The problem only comes up when products are added from both restricted and unrestricted categories. The current code seems to apply the coupon to everything, ignoring the fact that some products do not fall under the coupon's scope.
Please let me know if you find any problems in relation to this fix.
This contrib fixes the missing TEXT_SINGLE_EMAIL files displayed in admin/gv_mail.php for all languages
and changes some german language files.
You need to have installed credit class !
This contribution contains all files from Credit Class/GV/Discount Coupons v5.04 but with some bugfixes i found in the forum.
All changed files are commented in the UPDATE_README_FIRST.txt
I also translated all language files to german.
<b>Updated for OSC 2.2ms2</b>
This should bring the ccgv up to the 2.2ms2 release. One file was deprecated and folded into another and all files modified after the last release were updated.
This also includes Rob Cote's fix for the discount coupon.
Doc was updated and other bugs fixed.
I found what I think are two bugs with the current gift voucher contribution. These bug fixes are related to calculating the order total for coupons that are based on a percentage discount.
I'd appreciate it if the author could verify that the changes I am proposing are correct and then fold them into the next release of the module.
If anyone finds a problem with these changes, please bring it to my attention and I'll repost a correction.
UDATED
Many bug fixes. New install docs see install.htm also contains upgrade instructions from 5.02
Fixes 3 Bugs.
Missing define for FILENAME_COUPON
Missing GV Value in coupon redeem release email
PHP 4.3.1 problem affecting Discount Coupons
Files affected
admin/includes/add_application_top.php
admin/gv_queue.php
catalog/includes/classes/order_total.php
catalog/includes/modules/ot_gv.php
catalog/includes/modules/ot_coupon.php
Bug Update.
Fixes Mysql error when new customer with Gift Voucher creates an account.
Gift voucher FAQ missing define for navbar
Two files affected
catalog/includes/add_application_top.php
catalog/includes/languages/english/gv_faq.php
An updated version of the Credit Class/Gift Voucher/Discount Coupon contributions.
Updated areas are as follows
Core Credit Class Code.
The whole database structure has been changed. This was needed to help with the single redeem box,
and to provide better reporting possibilities.
Changes to the order_total ouput to allow for a single redeem box.
Gift Voucher System
Thanks to gdfwilliams, I've done away with separate box to show the amount in a customers Gift Voucher Account.
This is now shown in the shopping cart box.
The code now uses the get_content_type function to skip shipping selection if the Gift Voucher is the only item
in the cart.
The decision to queue purchases of Gift Vouchers is now set in admin rather than having to edit a DEFINE in
add_application_top.php
A new tax option has been added to treat Gift Vouchers like credit notes. If you don't know what that
means it probably doesn't concern you.
Redemption by email is now much simpler. There is no need to login, as the redeemed value is stored
in a session variable until the user checksout.
It is now possible to set a variable (in includes/add_application_top.php) to send a Gift Voucher
to new customers when they create an account.
define('NEW_SIGNUP_GIFT_VOUCHER_AMOUNT', '10');
It is also now possible to set the length of the redeem codes generated by the system.
define('SECURITY_CODE_LENGTH', '10');
again this is located in catalog/includes/add_application_top.php
If Voucher purchases are queued then the customer is informed by email when the amount is released
by admin.
Discount Coupon System
Lots of tidying up in the admin area, including the addittion of a proper voucher usage report.
A new Free Shipping Voucher (again thanks to gdfwilliams for the idea).
As for the Gift Voucher a new tax calculation treating the Coupon as a Credit Note.
The whole tax calculation logic has in fact been rewritten.
Again like the GV system, you can now set a Disount Coupon to be sent to a new customer on signup.
define('NEW_SIGNUP_DISCOUNT_COUPON', '3');
the value (e.g. '3') is the coupon id as created in admin.
The discount coupon is now shown in the shopping cart box when redeemed, this also has a 'more info' link
that gives full details of what the Coupon is worth including any category/product restrictions.
I'm currently working on a much more intuitive way of defining category/product restiction for the Discount
Coupon system. I will release this as an upgrade file asap.
These images are for use with Ian C Wilson's Credit Class & Gift
Voucher system. Although they certainly could be used in another
package as well. Included are standard 5,10,25,50,100 gift vouchers
in gif format with an image size of 100px by 80px. Also, included is
2 photoshop documents (*.psd) that you can use to customize other values you
require.
Changes from v4.1
-------------------
Most importantly the code is now based on the osCommerce MS1 release.
I've tried to make sure that all text is now in language files, and not hardcoded. The same goes for
database table names. If I've missed anything let me know.
Thanks to gdfwilliams, I've done away with separate box to show the amount in a customers Gift Voucher Account.
This is now shown in the shopping cart box.
The code now uses the get_content_type function to skip shipping selection if the Gift Voucher is the only item
in the cart.
The decision to queue purchases of Gift Vouchers is now set in admin rather than having to edit a DEFINE in
add_application_top.php
I've also included some diff files to make life easier as well.
Credit Class & Gift Voucher system for New Checkout. Main changes are :
Inclusion of updated shipping modules to allow for no shipping charge on Gift Vouchers.
Inclusion of Linda Mcgrath's free shipping contribution.
Updated Tax logic to handle the vagaries of German Tax law.
This is the credit class/ Gift Voucher code for the new checkout system.
I've included some minor tweaks to the send Gift Voucher function, but apart from that this should be funtionally equivalent to v3.2
Updated version of the Credit Class & Gift Voucher module.
Tax recalculation now works properly
If you are updating from v3.0 or 3.1 read the install docs as there are only 2 files to update.
The Credit Class with Gift Voucher system updated to current cvs (23 Aug 2002) .
The base credit class and the Gift Voucher module in one package. This is based on a July snapshoy before the new breadcrumb logic was intoduced.
Oops, previous contribution should have read v2.1
Updated to be compatible with v1.1 Credit Class System.
Have added helper functions to shopping cart class to aid in changing shipping classes to ignore Gift Vouchers in calculations
Updated to be compatible with v1.1 Credit Class System.
Have added helper functions to shopping cart class to aid in changing shipping classes to ignore Gift Vouchers in calculations.
This is an updated version, which fixes all known bugs in version 1.0.
It also adds support for German Tax Laws, and hopefully covers other countries as well. Basically it lets you decide in admin whether each discount class should be applied to the order total including/excluding shipping and or Tax.
This is the Gift Voucher Module re written to use the new credit class.
http://www.oscommerce.com/downloads.php/contributions,249
Feature wise it's exactly the same as v1.1 just a lot easier to install.
Don't forget you must install the Credit Class first.
The Credit Class has been developed to allow the easy installation of discount systems, such as gift vouchers, rewards, vouchers etc.
As a test i have included a discount module which will give a % discount if the amount purchased is ove r a certian amount. e.g. 10% if total is > $100
The variables are easily set in admin.
I have plans for a number of discount/credit classes. These include an updated gift voucher system, a points.reward system, and a global discount voucher system.
The good news is that once this class system is installed, installation of the other discount systems won't require any hacking, just drop a file into the modules/credit directory and away you go.
Hopefully i'll be publishing an api so other programmers can use the credit class to produce there own discount system shortly.
Oops - missed a file. checkout_address.php from catalog folder.
Updated to lastest (6th June 2002) snapshot.
Fixed some teeny bugs
New checkout system gets rid of annoying problem of having to select a payment method even when gv covers cost of cart.
Plus I personally think it's nicer than standard osc (more like amazon)
Admin tidied up, and added new gv mailer. Lets admin send gift voucher of any value by email to a group of customers - Great incentive marketing tool.
Patched Version of the Gift Voucher System to fix bugs in item shipping class, and totals calcualtions in checkout. Install as a full version or just replace 3 files from original.
Full details in install file.
I've finally got to a point where I can release a version of my Gift Voucher System to the osc community.
There are still a few issues to be resolved. But the system works. I would not recommend a newbie to install this, read the installation instructions thoroughly.
This is based on a 4th May 2002 snapshot. If you have some courage and a bit of 'nouse' you should be able to adapt for other snapshots.
One thing that I haven't tidied up is the format of the gift voucher email. if you can install this then sorting that out shouldn't be a problem.
Please, Please Please, give me some feedback, I promise I'll act on it.
BTW I offer installation service for the mod. Only $6000,000 dollars a go. HEHE
