Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class & Gift Vouchers for 2.3.4


T. Thomas

Recommended Posts

I'm trying to get ahead of the curve by starting this thread. I have been trying to get CCGV to work with 2.3.* for almost a year now. I have not been able to get CCGV working and most of the people I talk to have also run into problems.

 

 

Old Thread Dealing with CCGV 2.3.1: http://www.oscommerce.com/forums/topic/374736-credit-class-gift-vouchers-ccgv-for-231/

Community Addon Code Link: http://addons.oscommerce.com/info/8002

 

 

To get this thread rolling anyone who has worked with 2.3.4 please answer the following questions.

 

 

1. Do you have CCGV working on a 2.* OSC production site?

2. If so what steps did you follow or code did you modify. Please describe your setup (Paypal, other addons, etc)

 

 

I will be working on revamping CCGV for 2.3.4 but need your help.

 

 

If you have any questions, code, or comments please feel free to post.

Link to comment
Share on other sites

  • 2 weeks later...

Hi

 

I have gotten this to work on oscommerce v2.3.3 after many hours and days.

 

I have over 20 addons on my development site.

 

Are you using Paypal? What Steps did you follow? I've been trying to install it on an unmodified 2.3.3 setup with paypal standard with no luck.

 

CCGV is old and tired. It needs a top down bottom up rewrite from start to finish.

 

I would not use it on any site that I take care of.

 

What Should we be using? Any advice on where to get started?

Link to comment
Share on other sites

  • 2 months later...

I've tried to install this and get a blank white screen for checkout_payment.php

Nothing in the log files.

I will be removing and adding back the stock file system. This is a bummer as MailBEEZ system does not work properly without this addon. There is no other addon for discounts for osc 2.3.3.4?

@@MailBeez

Link to comment
Share on other sites

If addon A relies on addon B to work, then the developers of the addon A did not think about things when they coded their addon.

 

Suggest to mailbeez that they rip out the need for this broken addon asap and instead code more generically so users can fit any discount system they wish.

Link to comment
Share on other sites

This is a bummer as MailBEEZ system does not work properly without this addon.

@@MailBeez

 

Mailbeez used to work without this addon. If they have changed something that now requires it, as you rightly say its a bummer. If you look through the addons area there is another newsletter addon that may work with the latest version.

REMEMBER BACKUP, BACKUP AND BACKUP

Link to comment
Share on other sites

Suggest to mailbeez that they rip out the need for this broken addon asap and instead code more generically so users can fit any discount system they wish.

MailBeez supports a range of discount / coupon add-ons, see:

http://www.mailbeez.com/documentation/configbeez/config_coupon_engine/

Link to comment
Share on other sites

This is a bummer as MailBEEZ system does not work properly without this addon.

well, MailBeez works great without any coupon system, but if you would like to sent personalised coupons using one of the premium modules you need to have a coupon system installed, which is supported: http://www.mailbeez.com/documentation/configbeez/config_coupon_engine/

 

Please let me know if you miss any important coupon system.

Link to comment
Share on other sites

I didn't mean to offend at all. MailBEEZ is pure AWESOMENESS!!

I just need CCGV to work as it is the code that I originally installed. I'm stuck on the checkout_paymnet.php page. The Source Code shows a blank page. Not sure what to decode. If anyone has a working checkout_payment.php please submit it. I would like to do a file compare

 

Thanks!

Link to comment
Share on other sites

  • 2 months later...

I've just uploaded a working Credit Class, Gift Vouchers and Coupon Codes for osCommerce 2.3.3.4 - it can be found here Credit Class, Gift Vouchers & Discount Coupons osC2.3.3.4 Complete set ready to drop on top of a clean installation of osCommerce 2.3.3.4.

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Link to comment
Share on other sites

CCGV is old and tired. It needs a top down bottom up rewrite from start to finish.

 

I would not use it on any site that I take care of.

 

I've been using it for years for many clients, the problem is that here is too many of them that dont actually work - the one and only one that did ever work feel between the cracks and was overlooked by so many. Too many well meaning contributors have messed up the addon with little fixes to the extent that the original author simply gave up and hasnt been seen on this form since 2010.

 

Things do work - you just got to use the right addon - I installed CCGV working on all sites since osC MS1 in less than 12 hours and it takes me less than a day to do CCGV, SPPC and Quantity Price Breaks

"The doorstep to the temple of wisdom is a knowledge of our own ignorance."

Link to comment
Share on other sites

  • 3 weeks later...

I understand that adding it to the official 2.* branch would be a pain in the butt, but personally I think Giftcards is a feature that should be built into OSC3 from the jump. A lot of people use and request it enough that it should be a core feature. I've started a github project for 2.* OSC Giftcards with the hopes that I'll be able to keep it updated and working with the official branch as it progresses, but I haven't been coding as much as I like. @@mommaroodles thanks for helping us all out and I encourage everyone to keep posting their experiences and problems in this thread.

Link to comment
Share on other sites

  • 4 weeks later...

I have worked on this addon for only a few hours now and cannot access the files in the admin area. Everything looks good as far as the boxes are concerned however when you click on one of the links, you get this error page.

 

The requested URL /clients/essential7/admin/FILENAME_COUPON_ADMIN was not found on this server.

 

I would dearly love to have this addon work for me. I am going to keep fiddling with it and hope someone can help me fix it.

 

As far as how I went about adding this addon, I use Filezilla as my FTP client as it allows me to open files directly from the server for editing. I opened each file to be modified from my server and using WinMerge, pasted it to the right (always the right for server files) and pasted the new file on the left (always the left for new files) If I had made no modifications through previous addons, I simply copied the new file and pasted it onto the server file and saved. I did NOT close this file since, if something went wrong, I wanted to be able to undo my changes and start over.

 

The files that I had previous changes too, WinMerge showed me the line differences and I simply transferred the new code over to my old file, saved and uploaded.

 

I remember having this issue before but thought it was due to the files not being uploaded. I have checked, they are there.

 

I have added many addons before, some hard others not, and this is about medium only because of the # of files to be modified.

Link to comment
Share on other sites

Ok, I got everything working on the admin side (I think) but I cannot get the coupon field to display on the payment page. I have checked the addon for an example includes/languages/english/checkout_payment.php page but it isn't included to use as a reference. If anyone has a working copy of the page that actually displays the english checkout_payment where the voucher or coupon field is suppose to go, could you post it for me? I need to make sure everything works.

 

Thanks!

Edited by L. Haase
Link to comment
Share on other sites

I guess I should paste my "checkout_payment.php" here so I can get help figuring out where the issue is as well as the URL which is http://aquarian-artisan-bath-body.com/clients/essential7. Since I had not made any changes to this page with my previous addons, I just dropped it on top of the original.

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

$Mod: MVS V1.2.3 2011/04/13 JCK/CWG $

adapted for CCGV v5.20a 05/1/2011

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

// Start - CREDIT CLASS Gift Voucher Contribution

if (tep_session_is_registered('cot_gv')) tep_session_unregister('cot_gv');

// End - CREDIT CLASS Gift Voucher Contribution

// MVS start

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT);

 

// print 'Vendor Shipping: ' . SELECT_VENDOR_SHIPPING . "<br>\n";

// print 'Array Vendor Shipping: <pre>';

// print_r ($shipping);

// print '</pre>' . "<br>\n";

// print 'Vendor Count: ' . count ($shipping['vendor']) . "<br>\n";

// print 'Cart Vendor Count: ' . count ($cart->vendor_shipping) . "<br>\n";

 

// exit;

 

// If a shipping method has not been selected for all vendors, redirect the customer to the shipping method selection page

if (SELECT_VENDOR_SHIPPING == 'true') { // This test only works under MVS

if (!is_array ($shipping['vendor']) || count ($shipping['vendor']) != count ($cart->vendor_shipping)) { // No shipping selected or not all selected

tep_redirect (tep_href_link (FILENAME_CHECKOUT_SHIPPING, 'error_message=' . ERROR_NO_SHIPPING_SELECTED, 'SSL'));

}

}

// MVS end

 

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

}

 

// if there is nothing in the customers cart, redirect them to the shopping cart page

if ($cart->count_contents() < 1) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

}

 

// if no shipping method has been selected, redirect the customer to the shipping method selection page

if (!tep_session_is_registered('shipping')) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

}

 

// avoid hack attempts during the checkout procedure by checking the internal cartID

if (isset($cart->cartID) && tep_session_is_registered('cartID')) {

if ($cart->cartID != $cartID) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

}

}

 

// Start - CREDIT CLASS Gift Voucher Contribution

if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');

if(tep_session_is_registered('cot_gv')) tep_session_unregister('cot_gv');

// End - CREDIT CLASS Gift Voucher Contribution

 

// Stock Check

if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {

$products = $cart->get_products();

for ($i=0, $n=sizeof($products); $i<$n; $i++) {

if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

break;

}

}

}

 

// Start - CREDIT CLASS Gift Voucher Contribution

// #################### THIS MOD IS OPTIONAL! ######################

// load the selected shipping module

require(DIR_WS_CLASSES . 'shipping.php');

$shipping_modules = new shipping($shipping);

// #################### THIS MOD WAS OPTIONAL! ######################

// End - CREDIT CLASS Gift Voucher Contribution

 

// if no billing destination address was selected, use the customers own address as default

if (!tep_session_is_registered('billto')) {

tep_session_register('billto');

$billto = $customer_default_address_id;

} else {

// verify the selected billing address

if ( (is_array($billto) && empty($billto)) || is_numeric($billto) ) {

$check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'");

$check_address = tep_db_fetch_array($check_address_query);

 

if ($check_address['total'] != '1') {

$billto = $customer_default_address_id;

if (tep_session_is_registered('payment')) tep_session_unregister('payment');

}

}

}

 

require(DIR_WS_CLASSES . 'order.php');

$order = new order;

// Start - CREDIT CLASS Gift Voucher Contribution

require(DIR_WS_CLASSES . 'order_total.php');

$order_total_modules = new order_total;

$order_total_modules->clear_posts();

// End - CREDIT CLASS Gift Voucher Contribution

 

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

if (isset($HTTP_POST_VARS['comments']) && tep_not_null($HTTP_POST_VARS['comments'])) {

$comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);

}

 

$total_weight = $cart->show_weight();

$total_count = $cart->count_contents();

// Start - CREDIT CLASS Gift Voucher Contribution

$total_count = $cart->count_contents_virtual();

// End - CREDIT CLASS Gift Voucher Contribution

 

// load all enabled payment modules

require(DIR_WS_CLASSES . 'payment.php');

$payment_modules = new payment;

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT);

 

$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

 

require(DIR_WS_INCLUDES . 'template_top.php');

?>

 

<script type="text/javascript"><!--

var selected;

<?php // Start - CREDIT CLASS Gift Voucher Contribution ?>

var submitter = null;

function submitFunction() {

submitter = 1;

}

<?php // End - CREDIT CLASS Gift Voucher Contribution ?>

function selectRowEffect(object, buttonselect) {

 

// Start - CREDIT CLASS Gift Voucher Contribution

if (!document.checkout_payment.payment[0].disabled){

// End - CREDIT CLASS Gift Voucher Contribution

if (!selected) {

if (document.getElementById) {

selected = document.getElementById('defaultSelected');

} else {

selected = document.all['defaultSelected'];

}

}

 

if (selected) selected.className = 'moduleRow';

object.className = 'moduleRowSelected';

selected = object;

 

// one button is not an array

if (document.checkout_payment.payment[0]) {

document.checkout_payment.payment[buttonselect].checked=true;

} else {

document.checkout_payment.payment.checked=true;

}

 

// Start - CREDIT CLASS Gift Voucher Contribution

}

// End - CREDIT CLASS Gift Voucher Contribution

}

 

function rowOverEffect(object) {

if (object.className == 'moduleRow') object.className = 'moduleRowOver';

}

 

function rowOutEffect(object) {

if (object.className == 'moduleRowOver') object.className = 'moduleRow';

}

 

<?php

// Start - CREDIT CLASS Gift Voucher Contribution

if (MODULE_ORDER_TOTAL_INSTALLED)

$temp=$order_total_modules->process();

$temp=$temp[count($temp)-1];

$temp=$temp['value'];

 

$gv_query = tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");

$gv_result = tep_db_fetch_array($gv_query);

 

if ($gv_result['amount']>=$temp){ $coversAll=true;

 

?>

function clearRadeos(){

document.checkout_payment.cot_gv.checked=!document.checkout_payment.cot_gv.checked;

for (counter = 0; counter < document.checkout_payment.payment.length; counter++) {

// If a radio button has been selected it will return true

// (If not it will return false)

if (document.checkout_payment.cot_gv.checked){

document.checkout_payment.payment[counter].checked = false;

document.checkout_payment.payment[counter].disabled=true;

} else {

document.checkout_payment.payment[counter].disabled=false;

}

}

}

<?php

} else {

$coversAll=false;?>

 

function clearRadios(){

document.checkout_payment.cot_gv.checked=!document.checkout_payment.cot_gv.checked;

}<?php } ?>

//--></script>

<?php // echo $payment_modules->javascript_validation(); ?>

<?php echo $payment_modules->javascript_validation($coversAll); ?>

<?php // End - CREDIT CLASS Gift Voucher Contribution ?>

 

<h1><?php echo HEADING_TITLE; ?></h1>

 

<?php /* Start - CREDIT CLASS Gift Voucher Contribution */ ?>

<?php /* echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"', true); */ ?>

<?php /* End - CREDIT CLASS Gift Voucher Contribution */ ?>

 

<div class="contentContainer">

 

<?php

if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {

?>

 

<div class="contentText">

<?php echo '<strong>' . tep_output_string_protected($error['title']) . '</strong>'; ?>

 

<p class="messageStackError"><?php echo tep_output_string_protected($error['error']); ?></p>

</div>

 

<?php // Start - CREDIT CLASS Gift Voucher Contribution ?>

<?php // #################### THIS MOD IS OPTIONAL! ###################### ?>

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><b><?php echo HEADING_PRODUCTS; ?></b><? echo ' <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . EDIT . ')</span></a>'; ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td>

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<?php

//}

 

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

echo ' <tr>' . "\n" .

' <td width="10%" class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .

' <td width="60%" class="main" valign="top">' . $order->products[$i]['name'];

 

if (STOCK_CHECK == 'true') {

echo tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty']);

}

 

if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {

for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {

echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';

}

}

 

echo ' </td>' . "\n";

 

if (sizeof($order->info['tax_groups']) > 1) echo ' <td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '% </td>' . "\n";

 

echo ' <td width="30%"class="main" align="right" valign="top">' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . ' </td>' . "\n" .

' </tr>' . "\n";

}

?>

<tr>

<td COLSPAN="3" valign="top" align="right">

<table border="0" cellspacing="0" cellpadding="3">

<?php

if (MODULE_ORDER_TOTAL_INSTALLED) {

echo $order_total_modules->output();

}

?>

</table>

</td>

</tr>

</table>

</td>

</tr>

</table></td>

</tr>

<?php // #################### THIS MOD WAS OPTIONAL! ###################### ?>

<?php // End - CREDIT CLASS Gift Voucher Contribution ?>

 

<?php

}

?>

 

<h2><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></h2>

 

<div class="contentText">

<div class="ui-widget infoBoxContainer" style="float: right;">

<div class="ui-widget-header infoBoxHeading"><?php echo TITLE_BILLING_ADDRESS; ?></div>

 

<div class="ui-widget-content infoBoxContents">

<?php echo tep_address_label($customer_id, $billto, true, ' ', '<br />'); ?>

</div>

</div>

 

<?php echo TEXT_SELECTED_BILLING_DESTINATION; ?><br /><br /><?php echo tep_draw_button(IMAGE_BUTTON_CHANGE_ADDRESS, 'home', tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL')); ?>

</div>

 

<div style="clear: both;"></div>

 

<h2><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></h2>

 

<?php

// Start - CREDIT CLASS Gift Voucher Contribution

echo $order_total_modules->credit_selection();

// End - CREDIT CLASS Gift Voucher Contribution ?>

<?php // Start - CREDIT CLASS Gift Voucher Contribution ?>

<?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"'); ?>

<?php // End - CREDIT CLASS Gift Voucher Contribution ?>

 

 

<?php

$selection = $payment_modules->selection();

 

if (sizeof($selection) > 1) {

?>

 

<div class="contentText">

<div style="float: right;">

<?php echo '<strong>' . TITLE_PLEASE_SELECT . '</strong>'; ?>

</div>

 

<?php echo TEXT_SELECT_PAYMENT_METHOD; ?>

</div>

 

<?php

} elseif ($free_shipping == false) {

?>

 

<div class="contentText">

<?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?>

</div>

 

<?php

}

?>

 

<div class="contentText">

 

<?php

$radio_buttons = 0;

for ($i=0, $n=sizeof($selection); $i<$n; $i++) {

?>

 

<table border="0" width="100%" cellspacing="0" cellpadding="2">

 

<?php

if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) {

echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

} else {

echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

}

?>

 

<td><strong><?php echo $selection[$i]['module']; ?></strong></td>

<td align="right">

 

<?php

if (sizeof($selection) > 1) {

echo tep_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $payment));

} else {

echo tep_draw_hidden_field('payment', $selection[$i]['id']);

}

?>

 

</td>

</tr>

 

<?php

if (isset($selection[$i]['error'])) {

?>

 

<tr>

<td colspan="2"><?php echo $selection[$i]['error']; ?></td>

</tr>

 

<?php

} elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {

?>

 

<tr>

<td colspan="2"><table border="0" cellspacing="0" cellpadding="2">

 

<?php

for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {

?>

 

<tr>

<td><?php echo $selection[$i]['fields'][$j]['title']; ?></td>

<td><?php echo $selection[$i]['fields'][$j]['field']; ?></td>

</tr>

 

<?php

}

?>

 

</table></td>

</tr>

 

<?php

}

?>

 

</table>

 

<?php

$radio_buttons++;

}

 

 

 

// Start - CREDIT CLASS Gift Voucher Contribution

if (tep_session_is_registered('customer_id')) {

if ($gv_result['amount']>0){

echo ' <tr><td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td><td colspan=2>' . "\n" .

' <table border="0" cellpadding="2" cellspacing="0" width="100%"><tr class="moduleRow" onmouseover="rowOverEffect(this)" onclick="clearRadeos()" onmouseout="rowOutEffect(this)" >' . "\n" .

' <td width="10">' . tep_draw_separator('pixel_trans.gif', '10', '1') .'</td><td class="main">' . $gv_result['text'];

 

echo $order_total_modules->sub_credit_selection();

}

}

// End - CREDIT CLASS Gift Voucher Contribution

?>

</div>

 

<h2><?php echo TABLE_HEADING_COMMENTS; ?></h2>

 

<div class="contentText">

<?php echo tep_draw_textarea_field('comments', 'soft', '60', '5', $comments); ?>

</div>

 

<div class="contentText">

<div style="float: left; width: 60%; padding-top: 5px; padding-left: 15%;">

<div id="coProgressBar" style="height: 5px;"></div>

 

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td align="center" width="33%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>

<td align="center" width="33%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>

<td align="center" width="33%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>

</tr>

</table>

</div>

 

<div style="float: right;"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary'); ?></div>

</div>

</div>

 

<script type="text/javascript">

$('#coProgressBar').progressbar({

value: 66

});

</script>

 

</form>

 

<?php

require(DIR_WS_INCLUDES . 'template_bottom.php');

require(DIR_WS_INCLUDES . 'application_bottom.php');

?>
Link to comment
Share on other sites

Ok, I got everything working on the admin side (I think) but I cannot get the coupon field to display on the payment page. I have checked the addon for an example includes/languages/english/checkout_payment.php page but it isn't included to use as a reference. If anyone has a working copy of the page that actually displays the english checkout_payment where the voucher or coupon field is suppose to go, could you post it for me? I need to make sure everything works.

 

Thanks!

 

Around your line #209, you wrote: function clearRadios()

Should be: function clearRadeos()

Link to comment
Share on other sites

Around your line #209, you wrote: function clearRadios()

Should be: function clearRadeos()

 

I removed everything and just now reinstalled. I did check both of these files for that mis-spelling and it must have been an error on my part that transcribed to the post.

 

After reinstalling, dropping all the files on top of my store since none of my modifications affected these files, I now get this error on compatibility when I try to proceed to the checkout_payment.php. I have started a new URL to test out all these addons before I bring it live.

 

Fatal error
: Cannot redeclare do_magic_quotes_gpc() (previously declared in /home/aquarian/public_html/shop/includes/functions/compatibility.php:18) in
/home/aquarian/public_html/shop/includes/functions/compatibility.php
on line
30

 

I have run the SQL query successfully I think since I can create coupons.

Link to comment
Share on other sites

Ok, I guess I spoke too soon. Everything SEEMS to be working. The admin side lists and allows me to release and send purchased GV however when I test the redemption area, I keep getting redirected to the payment section to select a payment method, even though the GV I used would have left me with a credit balance. There is nothing I can do to try and get around this. When I select "cash on delivery" as my test payment method, I get the same thing, a notice asking me to select a payment method.

 

The url is www.aquarian-artisan-bath-body.com/shop for anyone who can help me figure this out. From what I have seen, there are very few people who have gotten this installed properly. Here is my checkout_payment.php page. I think this may have something to do with the code that applies the GV credit through the check box or in the order_totals_module? I am unsure.

 

I really like the versatility of this module and want it to work for me but I am kinda lost when it comes to PHP. Any assistance would be appreciated

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

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

}

 

// if there is nothing in the customers cart, redirect them to the shopping cart page

if ($cart->count_contents() < 1) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

}

 

// if no shipping method has been selected, redirect the customer to the shipping method selection page

if (!tep_session_is_registered('shipping')) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

}

 

// avoid hack attempts during the checkout procedure by checking the internal cartID

if (isset($cart->cartID) && tep_session_is_registered('cartID')) {

if ($cart->cartID != $cartID) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

}

}

 

// Stock Check

if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {

$products = $cart->get_products();

for ($i=0, $n=sizeof($products); $i<$n; $i++) {

if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));

break;

}

}

}

 

// if no billing destination address was selected, use the customers own address as default

if (!tep_session_is_registered('billto')) {

tep_session_register('billto');

$billto = $customer_default_address_id;

} else {

// verify the selected billing address

if ( (is_array($billto) && empty($billto)) || is_numeric($billto) ) {

$check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'");

$check_address = tep_db_fetch_array($check_address_query);

 

if ($check_address['total'] != '1') {

$billto = $customer_default_address_id;

if (tep_session_is_registered('payment')) tep_session_unregister('payment');

}

}

}

 

require(DIR_WS_CLASSES . 'order.php');

$order = new order;

 

require(DIR_WS_CLASSES . 'order_total.php'); // CCGV

$order_total_modules = new order_total; // CCGV

 

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

if (isset($HTTP_POST_VARS['comments']) && tep_not_null($HTTP_POST_VARS['comments'])) {

$comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);

}

 

$total_weight = $cart->show_weight();

$total_count = $cart->count_contents();

$total_count = $cart->count_contents_virtual(); // CCGV

 

// load all enabled payment modules

require(DIR_WS_CLASSES . 'payment.php');

$payment_modules = new payment;

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PAYMENT);

 

$breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

$breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

 

require(DIR_WS_INCLUDES . 'template_top.php');

?>

 

<script type="text/javascript"><!--

var selected;

<?php /* following jscript function ADDED FOR CCGV */ ?>

var submitter = null;

function submitFunction() {

submitter = 1;

}

<?php /* END OF ADDED FOR CCGV */ ?>

 

function selectRowEffect(object, buttonselect) {

if (!selected) {

if (document.getElementById) {

selected = document.getElementById('defaultSelected');

} else {

selected = document.all['defaultSelected'];

}

}

 

if (selected) selected.className = 'moduleRow';

object.className = 'moduleRowSelected';

selected = object;

 

// one button is not an array

if (document.checkout_payment.payment[0]) {

document.checkout_payment.payment[buttonselect].checked=true;

} else {

document.checkout_payment.payment.checked=true;

}

}

 

function rowOverEffect(object) {

if (object.className == 'moduleRow') object.className = 'moduleRowOver';

}

 

function rowOutEffect(object) {

if (object.className == 'moduleRowOver') object.className = 'moduleRow';

}

//--></script>

<?php echo $payment_modules->javascript_validation(); ?>

 

<h1><?php echo HEADING_TITLE; ?></h1>

 

<?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"', true); ?>

 

<div class="contentContainer">

 

<?php

if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {

?>

 

<div class="contentText">

<?php echo '<strong>' . tep_output_string_protected($error['title']) . '</strong>'; ?>

 

<p class="messageStackError"><?php echo tep_output_string_protected($error['error']); ?></p>

</div>

 

<?php

}

?>

 

<h2><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></h2>

 

<div class="contentText">

<div class="ui-widget infoBoxContainer" style="float: right;">

<div class="ui-widget-header infoBoxHeading"><?php echo TITLE_BILLING_ADDRESS; ?></div>

 

<div class="ui-widget-content infoBoxContents">

<?php echo tep_address_label($customer_id, $billto, true, ' ', '<br />'); ?>

</div>

</div>

 

<?php echo TEXT_SELECTED_BILLING_DESTINATION; ?><br /><br /><?php echo tep_draw_button(IMAGE_BUTTON_CHANGE_ADDRESS, 'home', tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL')); ?>

</div>

 

<div style="clear: both;"></div>

 

<h2><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></h2>

 

<?php

$selection = $payment_modules->selection();

 

if (sizeof($selection) > 1) {

?>

 

<div class="contentText">

<div style="float: right;">

<?php echo '<strong>' . TITLE_PLEASE_SELECT . '</strong>'; ?>

</div>

 

<?php echo TEXT_SELECT_PAYMENT_METHOD; ?>

</div>

 

<?php

} elseif ($free_shipping == false) {

?>

 

<div class="contentText">

<?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?>

</div>

 

<?php

}

?>

 

<div class="contentText">

 

<?php

$radio_buttons = 0;

for ($i=0, $n=sizeof($selection); $i<$n; $i++) {

?>

 

<table border="0" width="100%" cellspacing="0" cellpadding="2">

 

<?php

if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) {

echo ' <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

} else {

echo ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";

}

?>

 

<td><strong><?php echo $selection[$i]['module']; ?></strong></td>

<td align="right">

 

<?php

if (sizeof($selection) > 1) {

echo tep_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $payment));

} else {

echo tep_draw_hidden_field('payment', $selection[$i]['id']);

}

?>

 

</td>

</tr>

 

<?php

if (isset($selection[$i]['error'])) {

?>

 

<tr>

<td colspan="2"><?php echo $selection[$i]['error']; ?></td>

</tr>

 

<?php

} elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {

?>

 

<tr>

<td colspan="2"><table border="0" cellspacing="0" cellpadding="2">

 

<?php

for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {

?>

 

<tr>

<td><?php echo $selection[$i]['fields'][$j]['title']; ?></td>

<td><?php echo $selection[$i]['fields'][$j]['field']; ?></td>

</tr>

 

<?php

}

?>

 

</table></td>

</tr>

 

<?php

}

?>

 

</table>

 

<?php

$radio_buttons++;

}

?>

 

<?php

echo $order_total_modules->credit_selection(); // CCGV

?>

</div>

 

<h2><?php echo TABLE_HEADING_COMMENTS; ?></h2>

 

<div class="contentText">

<?php echo tep_draw_textarea_field('comments', 'soft', '60', '5', $comments); ?>

</div>

 

<div class="contentText">

<div style="float: left; width: 60%; padding-top: 5px; padding-left: 15%;">

<div id="coProgressBar" style="height: 5px;"></div>

 

<table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td align="center" width="33%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td>

<td align="center" width="33%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>

<td align="center" width="33%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>

</tr>

</table>

</div>

 

<div style="float: right;"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', null, 'primary'); ?></div>

</div>

</div>

 

<script type="text/javascript">

$('#coProgressBar').progressbar({

value: 66

});

</script>

 

</form>

 

<?php

require(DIR_WS_INCLUDES . 'template_bottom.php');

require(DIR_WS_INCLUDES . 'application_bottom.php');

?>
Link to comment
Share on other sites

So I think I figured out the problem. There's another typo in this add-on. For anyone installing this add-on, go to includes/modules/order_total/ot_coupon.php and:

 

FIND:

 

$god_amout=0;

 

REPLACE WITH:

 

$god_amount=0;

 

There's also some rounding issues you might get when applying coupons or claiming balances. I might attempt to clean up this module when I have time in the summer.

Link to comment
Share on other sites

Ok, now we can actually get past the payment page which is great! Thanks for that coding fix. The next issue I am seeing is with the email that contains the link to redeem the GV. When you click on the link, it takes you to a page that says the gv# is invalid. Is this simply a text message which I need to change? Also, I do not see anywhere in the admin/configuration area a link to send new customers a GV as a welcome as per the use instructions.

 

I tried to contact the original writer of this module however the website contact form is not working. I did send a message through the forums here but don't really hold out much hope of a reply. Your's was the first working fix I have found for this issue. Thank you so much! I can live with the other issues for now but do look forward to your contribution to this addon later this year. I would actually be willing to throw a few bucks your way to have a fully functioning module.

Link to comment
Share on other sites

Ok, to think of this logically, the email gives the url of

http://aquarian-artisan-bath-body.com/shop/gv_redeem.php?gv_no=eca8d9cfb393

 

and the catalog/gv_redeem.php shows this (I have redded the code I think is the culprit however I guess it could be anywhere in this or another file.

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

 

Copyright © 2010 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

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

}

 

// check for a voucher number in the url

if (isset($HTTP_GET_VARS['gv_no'])) {

$error = true;

$gv_query = tep_db_query("select c.coupon_id, c.coupon_amount from " . TABLE_COUPONS . " c, " . TABLE_COUPON_EMAIL_TRACK . " et where coupon_code = '" . $HTTP_GET_VARS['gv_no'] . "' and c.coupon_id = et.coupon_id");

if (tep_db_num_rows($gv_query) >0) {

$coupon = tep_db_fetch_array($gv_query);

$redeem_query = tep_db_query("select coupon_id from ". TABLE_COUPON_REDEEM_TRACK . " where coupon_id = '" . $coupon['coupon_id'] . "'");

if (tep_db_num_rows($redeem_query) == 0 ) {

// check for required session variables

if (!tep_session_is_registered('gv_id')) {

tep_session_register('gv_id');

}

$gv_id = $coupon['coupon_id'];

$error = false;

} else {

$error = true;

}

}

} else {

tep_redirect(FILENAME_DEFAULT);

}

if ((!$error) && (tep_session_is_registered('customer_id'))) {

// Update redeem status

$gv_query = tep_db_query("insert into " . TABLE_COUPON_REDEEM_TRACK . " (coupon_id, customer_id, redeem_date, redeem_ip) values ('" . $coupon['coupon_id'] . "', '" . $customer_id . "', now(),'" . $REMOTE_ADDR . "')");

$gv_update = tep_db_query("update " . TABLE_COUPONS . " set coupon_active = 'N' where coupon_id = '" . $coupon['coupon_id'] . "'");

tep_gv_account_update($customer_id, $gv_id);

tep_session_unregister('gv_id');

}

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_GV_REDEEM);

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_GV_REDEEM));

 

require(DIR_WS_INCLUDES . 'template_top.php');

?>

 

<h1><?php echo HEADING_TITLE; ?></h1>

 

<div class="contentContainer">

<div class="contentText">

<?php echo TEXT_INFORMATION; ?>

</div>

 

<?php

// if we get here then either the url gv_no was not set or it was invalid

// so output a message.

$message = sprintf(TEXT_VALID_GV, $currencies->format($coupon['coupon_amount']));

if ($error) {

$message = TEXT_INVALID_GV;

}

?>

 

<div class="contentText">

<p class="main"><?php echo $message; ?></p>

</div>

 

 

 

<div class="buttonSet">

<span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?></span>

</div>

</div>

 

<?php

require(DIR_WS_INCLUDES . 'template_bottom.php');

require(DIR_WS_INCLUDES . 'application_bottom.php');

?>

What do you think, Kevin?

Edited by L. Haase
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...