Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Credit Class/Gift Vouchers/Discount Coupons 5.10


Strider

Recommended Posts

has anyone mastered the way to put the pop up in the header.... for those who have header in cart?

 

any advice would be appreciated

 

you should be able to place the eniter shopping_cart.php box code within the header.php file. Have you tried that and didn't work?

Link to comment
Share on other sites

  • Replies 4.8k
  • Created
  • Last Reply

Top Posters In This Topic

Having a problem with duplication in email sent out in the gift voucher to a friend. The duplication is below:

 

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

Congratulations, You have received a Gift Certificate worth $0.10

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

This Gift Certificate has been sent to you by someone With a message saying Hi Drew,

 

blah

 

To redeem this Gift Certificate, please click on the link below. Your redemption code is 4f3783f04e.

 

 

 

To redeem please click link

 

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

Congratulations, You have received a Gift Certificate worth $0.10

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

This Gift Certificate has been sent to you by Andrew Fu With a message saying Hi Drew,

blah

 

To redeem this Gift Certificate, please click on the link below. Your redemption code is 4f3783f04e.

 

 

 

If you are having problems redeeming the Gift Certificate using the automated link above, you can also enter the Gift Certificate code during the checkout process at our store.

This problem seems to originate from the sprintf in gv_send.php. Only the lines of code which use sprintf show the duplication. Could someone with a working version please paste me the code for this file? In my file, the line numbers run from 68 to 88 on the following lines that affect the printout:

 

$gv_email = STORE_NAME . "\n" .

EMAIL_SEPARATOR . "\n" .

sprintf(EMAIL_GV_TEXT_HEADER, $currencies->format($HTTP_POST_VARS['amount'])) . "\n" .

EMAIL_SEPARATOR . "\n" .

sprintf(EMAIL_GV_FROM, stripslashes($HTTP_POST_VARS['send_name'])) . "\n";

if (isset($HTTP_POST_VARS['message'])) {

$gv_email .= EMAIL_GV_MESSAGE . "\n";

if (isset($HTTP_POST_VARS['to_name'])) {

$gv_email .= sprintf(EMAIL_GV_SEND_TO, stripslashes($HTTP_POST_VARS['to_name'])) . "\n\n";

}

$gv_email .= stripslashes($HTTP_POST_VARS['message']) . "\n\n";

}

$gv_email .= sprintf(EMAIL_GV_REDEEM, $id1) . "\n\n";

$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 .= "\n\n";

$gv_email .= EMAIL_GV_FIXED_FOOTER . "\n\n";

$gv_email .= EMAIL_GV_SHOP_FOOTER . "\n\n";;

$gv_email_subject = sprintf(EMAIL_GV_TEXT_SUBJECT, stripslashes($HTTP_POST_VARS['send_name']));

tep_mail('', $HTTP_POST_VARS['email'], $gv_email_subject, nl2br($gv_email), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');

 

 

Thanks!

Link to comment
Share on other sites

Having a problem with duplication in email sent out in the gift voucher to a friend. The duplication is below:

This problem seems to originate from the sprintf in gv_send.php. Only the lines of code which use sprintf show the duplication. Could someone with a working version please paste me the code for this file? In my file, the line numbers run from 68 to 88 on the following lines that affect the printout:

Thanks!

 

My lines are the same as yours and I only receive the one lot of info.

 

Maybe check out your catalog\includes\languages\english\gv_send.php file Mine is as below:

 

<?php

/*

$Id: gv_send.php,v 1.1.2.1 2003/04/18 17:25:44 wilt Exp $

 

The Exchange Project - Community Made Shopping!

http://www.theexchangeproject.org

 

Gift Voucher System v1.0

Copyright © 2001,2002 Ian C Wilson

http://www.phesis.org

 

Released under the GNU General Public License

 

Text modified by Coopco Jan 2006

*/

 

define('HEADING_TITLE', 'Send Gift Voucher');

define('NAVBAR_TITLE', 'Send Gift Voucher');

define('EMAIL_SUBJECT', 'Enquiry from ' . STORE_NAME);

define('HEADING_TEXT','<br>Please enter below the details of the Gift Voucher you wish to send. For more information, please see our <a href="' . tep_href_link(FILENAME_GV_FAQ,'','NONSSL').'">'.GV_FAQ.'.</a><br>');

define('ENTRY_NAME', 'Recipient\'s Name:');

define('ENTRY_EMAIL', 'Recipient\'s E-Mail Address:');

define('ENTRY_MESSAGE', 'Message to Recipient:');

define('ENTRY_AMOUNT', 'Amount of Gift Voucher (example 20.00):');

define('ERROR_ENTRY_AMOUNT_CHECK', '  <span class="errorText">Invalid Amount (example 20.00)</span>');

define('ERROR_ENTRY_EMAIL_ADDRESS_CHECK', '  <span class="errorText">Invalid Email Address</span>');

define('MAIN_MESSAGE', 'You have decided to post a Gift Voucher worth %s to %s who\'s email address is %s<br><br>The text accompanying the email will read<br><br>Dear %s<br><br>

You have been sent a Gift Voucher worth %s by %s');

 

define('PERSONAL_MESSAGE', '%s says');

define('TEXT_SUCCESS', 'Congratulations, your Gift Voucher has successfully been sent');

 

 

define('EMAIL_SEPARATOR', '----------------------------------------------------------------------------------------');

define('EMAIL_GV_TEXT_HEADER', 'Congratulations, You have received a Gift Voucher worth %s');

define('EMAIL_GV_TEXT_SUBJECT', 'A gift from %s');

define('EMAIL_GV_FROM', 'This Gift Voucher has been sent to you by %s');

define('EMAIL_GV_MESSAGE', 'With a message saying ');

define('EMAIL_GV_SEND_TO', 'Hi, %s');

define('EMAIL_GV_REDEEM', 'To redeem this Gift Voucher, please click on the link below. Please also write down the redemption code which is %s. In case you have problems.');

define('EMAIL_GV_LINK', 'To redeem the Gift Voucher, please click ');

define('EMAIL_GV_VISIT', ' or visit ');

define('EMAIL_GV_ENTER', ' and enter the Redeem Code. ');

define('EMAIL_GV_FIXED_FOOTER', 'If you are have problems redeeming the Gift Voucher by using the automated link above.' . "\n" .

'You may enter the Gift Voucher Redeem Code on the Payment Information page during the checkout process at our store.' . "\n\n");

define('EMAIL_GV_SHOP_FOOTER', '');

?>

Link to comment
Share on other sites

Where are the intructions for Ver 5.16 for anyone who would like to make the changes manuely Because All that comes with it is if you have a untouched new store. But I already have other Contribs installed and Want to make the Changes one by one. Anyone? Thanks

Link to comment
Share on other sites

you should be able to place the eniter shopping_cart.php box code within the header.php file. Have you tried that and didn't work?

No unforunately it doesn't work in the header it does however work properly in the column right/shopping car box...

 

here's the text for the shopping cart:

 

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

 

<?php

/*

$Id: shopping_cart.php,v 1.2.2.9 2003/05/13 22:49:08 wilt Exp $

orig : shopping_cart.php,v 1.18 2003/02/10 22:31:06 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

?>

<!-- shopping_cart //-->

<tr>

<td>

 

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => BOX_HEADING_SHOPPING_CART);

 

new infoBoxHeading($info_box_contents, false, true, tep_href_link(FILENAME_SHOPPING_CART));

// ############ Added CCGV Contribution ##########

// CREDIT CLASS script moved by Rigadin in v5.13 for compatibility with STS

$cart_contents_string ="

<script language=\"javascript\">

function couponpopupWindow(url) {

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re

sizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,l

eft=150')

}

//--></script>";

 

// $cart_contents_string = '';

// ############ End Added CCGV Contribution ##########

if ($cart->count_contents() > 0) {

// ############ Added CCGV Contribution ##########

$cart_contents_string .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">';

$cart_contents_string .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">'; // Modified in v5.13 by Rigadin for STS compatibility

// ############ End Added CCGV Contribution ##########

$products = $cart->get_products();

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

$cart_contents_string .= '<tr><td align="right" valign="top" class="infoBoxContents">';

 

if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {

$cart_contents_string .= '<span class="newItemInCart">';

} else {

$cart_contents_string .= '<span class="infoBoxContents">';

}

 

$cart_contents_string .= $products[$i]['quantity'] . ' x </span></td><td valign="top" class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products[$i]['id']) . '">';

 

if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {

$cart_contents_string .= '<span class="newItemInCart">';

} else {

$cart_contents_string .= '<span class="infoBoxContents">';

}

 

$cart_contents_string .= $products[$i]['name'] . '</span></a></td></tr>';

 

if ((tep_session_is_registered('new_products_id_in_cart')) && ($new_products_id_in_cart == $products[$i]['id'])) {

tep_session_unregister('new_products_id_in_cart');

}

}

$cart_contents_string .= '</table>';

} else {

$cart_contents_string .= BOX_SHOPPING_CART_EMPTY;

}

 

$info_box_contents = array();

$info_box_contents[] = array('text' => $cart_contents_string);

 

if ($cart->count_contents() > 0) {

$info_box_contents[] = array('text' => tep_draw_separator());

$info_box_contents[] = array('align' => 'right',

'text' => $currencies->format($cart->show_total()));

}

#### Points/Rewards Module V1.60 BOF ####

if (tep_session_is_registered('customer_id')) {

$shopping_points = tep_get_shopping_points($customer_id);

if ($shopping_points > 0) {

$info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());

$info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td align="left" class="smalltext"><b><a href="' . tep_href_link(FILENAME_MY_POINTS) . '">'. TEXT_POINTS_BALANCE . '</a></b></tr></td><tr><td class="smalltext" align="left" valign="bottom">' . TEXT_POINTS .' '. number_format($shopping_points,2) .'</tr></td><tr><td class="smalltext" align="left" valign="bottom">' . TEXT_VALUE . $currencies->format(tep_calc_shopping_pvalue($shopping_points)) . '</td></tr></table>');

}

}

#### Points/Rewards Module V1.60 EOF ####

// ############ Added CCGV Contribution ##########

if (tep_session_is_registered('customer_id')) {

$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'] > 0 ) {

$info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());

$info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_BALANCE . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($gv_result['amount']) . '</td></tr></table>');

$info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext"><a href="'. tep_href_link(FILENAME_GV_SEND) . '">' . BOX_SEND_TO_FRIEND . '</a></td></tr></table>');

}

}

if (tep_session_is_registered('gv_id')) {

$gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");

$coupon = tep_db_fetch_array($gv_query);

$info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());

$info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>');

 

}

if (tep_session_is_registered('cc_id') && $cc_id) {

$info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());

$info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . CART_COUPON . '</td><td class="smalltext" align="right" valign="bottom">' . '<a href="java script:couponpopupWindow(\'' . tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' . CART_COUPON_INFO . '</a>' . '</td></tr></table>');

 

}

 

// ############ End Added CCGV Contribution ##########

 

// view cart mod start

 

if ($cart->count_contents() > 0)

{

if (preg_match("/checkout/", $PHP_SELF))

{$info_box_contents[] = array('align' => 'left','text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><u>View Basket</u></a>');}

else

{$info_box_contents[] = array('align' => 'left','text' => '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><u>View Basket</u></a><br><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '"><u>Go Checkout</u></a>');}

}

else

{$info_box_contents[] = array('align' => 'left','text' => '<u>Your Basket Is Empty</u>');}

// view cart mod end

 

 

new infoBox($info_box_contents);

?>

</td>

</tr>

<!-- shopping_cart_eof //-->

 

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

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

 

 

 

Here's what I have in the header (just the pop up part):

 

 

 

 

<tr>

<?php

if (tep_session_is_registered('customer_id')) {

$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'] > 0 ) {

?>

<td width="245"

colspan="2" valign="top" height="1"><img src="images/pixel_silver.gif" width="100%" height="1"></td>

<td></td>

</tr>

<tr>

<td class="headerCart" align="left"><?php echo VOUCHER_BALANCE .':<b> ' ?><?php echo $currencies->format($gv_result['amount']).'  </b>' ?><?php echo '<a href="'. tep_href_link(FILENAME_GV_SEND) . '" class="headerCart">' . BOX_SEND_TO_FRIEND . '</a>'; ?></td>

</tr>

 

<td width="245"

colspan="2" valign="top" height="1"><img src="images/pixel_silver.gif" width="100%" height="1"></td>

<td></td>

<tr>

<td align="left" valign="bottom" class="headerCart"><?php if (tep_session_is_registered('cc_id') && $cc_id) {

?>

 

<tr>

<td align="left" valign="bottom" class="headerCart"><?php echo CART_COUPON .' ' ?><?php echo '<a href="java script:couponpopupWindow(\'' .tep_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $cc_id) . '\')">' .CART_COUPON_INFO . '</a>'; ?></td>

</tr>

<?php

}

 

 

 

 

if (tep_session_is_registered('gv_id')) {

$gv_query = tep_db_query("select coupon_amount from " . TABLE_COUPONS . " where coupon_id = '" . $gv_id . "'");

$coupon = tep_db_fetch_array($gv_query);

 

$info_box_contents[] = array('align' => 'left','text' => tep_draw_separator());

$info_box_contents[] = array('align' => 'left','text' => '<table cellpadding="0" width="100%" cellspacing="0" border="0"><tr><td class="smalltext">' . VOUCHER_REDEEMED . '</td><td class="smalltext" align="right" valign="bottom">' . $currencies->format($coupon['coupon_amount']) . '</td></tr></table>');

 

}

?>

<tr></tr>

 

 

<?php

}

}

?>

 

 

 

<tr>

<td colspan="4" height="5"></td>

</tr>

</table>

<?php // Shopping Cart Display ADDED END ?>

 

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

 

the coupon info only appears if a coupon is applied but when I click it - it says error!!

 

i cant see what i am supposed to insert in the header.

 

if i dont change the text in the header and keeps it as it is, and then add the shopping cart to the column right then the header pop up link DOES work...

 

Can anyone please see where I have gone wrong.. many many thanks for this :-)

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

you take the shopping_cart.php, the entire box code not just a part of it, and you instert it into the includes\header.php. (you may have to rearrange the starting <tr><td> a bit). But that will indicate if the code works or not.

 

Afterwards you can start optimizing and removing unwanted parts of the box code and format it. But if it doesn't work just by dropping it in, then there must be another variable that's initialized in between the header/body of the html section

Edited by enigma1
Link to comment
Share on other sites

you take the shopping_cart.php, the entire box code not just a part of it, and you instert it into the includes\header.php. (you may have to rearrange the starting <tr><td> a bit). But that will indicate if the code works or not.

 

Afterwards you can start optimizing and removing unwanted parts of the box code and format it. But if it doesn't work just by dropping it in, then there must be another variable that's initialized in between the header/body of the html section

when you put it like that it seems sooo simple... why didnt i think of it?

 

i have added the whole of it in and even though everything is out of place BIGTIME (tr/td stff) - the pop up DOES work!

 

I will play around with it for a bit and see what happens...

 

Thanks enigma1

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

My CCVG seems work most of the time except when the user account balace is enough to cover the total of an order. Then what they need to pay is $0. But once they click on check out, it gives a fatal error:

 

<server path>\includes\modules\payment\paypal\catalog\checkout_process.inc.php on line 173

 

I use Paypal only.

 

I saw some posts with same issues, but didn't find the solution.

 

Anybody knows which particular patch is for this? Is it a Paypal IPN issue or CCGV one? I checked both but didnt see anything specific. I'd rather to fix certain code than replace the whole contribution. Please help!

 

Thank you!

Link to comment
Share on other sites

post your checkout_process.inc.php so someone might be able to see what's going on.

 

here it is...

 

<?php
/*
 $Id: checkout_process.inc.php,v 2.8 2004/09/11 devosc Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 DevosC, Developing open source Code
 http://www.devosc.com

 Copyright (c) 2003 osCommerce
 Copyright (c) 2004 DevosC.com

 Released under the GNU General Public License
*/

 global $payment_modules, $shipping_modules, $order, $currencies, $cart, $PayPal_osC, $customer_id,
	 $sendto, $billto, $shipping, $payment, $language, $currency, $languages_id, $order_totals;

 require_once(DIR_WS_INCLUDES . 'modules/payment/paypal/database_tables.inc.php');

 if(!class_exists('order_total')) {
include_once(DIR_WS_CLASSES . 'order_total.php');
$order_total_modules = new order_total;
$order_totals = $order_total_modules->process();
 }

 $sql_data_array = array('customers_id' => $customer_id,
					  'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'],
					  'customers_company' => $order->customer['company'],
					  'customers_street_address' => $order->customer['street_address'],
					  'customers_suburb' => $order->customer['suburb'],
					  'customers_city' => $order->customer['city'],
					  'customers_postcode' => $order->customer['postcode'],
					  'customers_state' => $order->customer['state'],
					  'customers_country' => $order->customer['country']['title'],
					  'customers_telephone' => $order->customer['telephone'],
					  'customers_email_address' => $order->customer['email_address'],
					  'customers_address_format_id' => $order->customer['format_id'],
					  'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'],
					  'delivery_company' => $order->delivery['company'],
					  'delivery_street_address' => $order->delivery['street_address'],
					  'delivery_suburb' => $order->delivery['suburb'],
					  'delivery_city' => $order->delivery['city'],
					  'delivery_postcode' => $order->delivery['postcode'],
					  'delivery_state' => $order->delivery['state'],
					  'delivery_country' => $order->delivery['country']['title'],
					  'delivery_address_format_id' => $order->delivery['format_id'],
					  'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'],
					  'billing_company' => $order->billing['company'],
					  'billing_street_address' => $order->billing['street_address'],
					  'billing_suburb' => $order->billing['suburb'],
					  'billing_city' => $order->billing['city'],
					  'billing_postcode' => $order->billing['postcode'],
					  'billing_state' => $order->billing['state'],
					  'billing_country' => $order->billing['country']['title'],
					  'billing_address_format_id' => $order->billing['format_id'],
					  'payment_method' => $this->codeTitle,
					  'cc_type' => $order->info['cc_type'],
					  'cc_owner' => $order->info['cc_owner'],
					  'cc_number' => $order->info['cc_number'],
					  'cc_expires' => $order->info['cc_expires'],
					  'orders_status' => MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID,
					  'last_modified' => 'now()',
					  'currency' => $order->info['currency'],
					  'currency_value' => $order->info['currency_value']);
  $session_exists = false;
  if(tep_session_is_registered('PayPal_osC')) {
 $orders_session_query = tep_db_query("select osi.orders_id, o.payment_id from " . TABLE_ORDERS_SESSION_INFO . " osi left join " . TABLE_ORDERS . " o on osi.orders_id = o.orders_id where osi.txn_signature ='" . tep_db_input($PayPal_osC->txn_signature) . "'");
 $orders_check = tep_db_fetch_array($orders_session_query);
 //Now check to see whether order session info exists AND that this order
 //does not currently have an IPN.
 if ($orders_check['orders_id'] > 0 &&  $orders_check['payment_id'] == '0' ) {
   $session_exists = true;
   $this->orders_id = $orders_check['orders_id'];
 }
  }

  if($session_exists) {
tep_db_perform(TABLE_ORDERS, $sql_data_array, 'update', "orders_id = '" . (int)$this->orders_id . "'");
  } else {
$sql_data_array['date_purchased'] = 'now()';
tep_db_perform(TABLE_ORDERS, $sql_data_array);
$this->orders_id = tep_db_insert_id();
  }

if($session_exists) {
tep_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$this->orders_id . "'");
 }
 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
$sql_data_array = array('orders_id' => (int)$this->orders_id,
						'title' => $order_totals[$i]['title'],
						'text' => $order_totals[$i]['text'],
						'value' => $order_totals[$i]['value'],
						'class' => $order_totals[$i]['code'],
						'sort_order' => $order_totals[$i]['sort_order']);
tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array);
 }

 $sql_data_array = array('orders_status_id' => MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID,
					  'date_added' => 'now()',
					  'customer_notified' => 0,
					  'comments' => $order->info['comments']);

 if($session_exists) {
tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array, 'update', "orders_id = '" . (int)$this->orders_id . "'");

tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$this->orders_id . "'");
tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$this->orders_id . "'");
 } else {
$sql_data_array['orders_id'] = $this->orders_id;
tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
 }

 for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
$sql_data_array = array('orders_id' => (int)$this->orders_id,
						'products_id' => tep_get_prid($order->products[$i]['id']),
						'products_model' => $order->products[$i]['model'],
						'products_name' => $order->products[$i]['name'],
						'products_price' => $order->products[$i]['price'],
						'final_price' => $order->products[$i]['final_price'],
						'products_tax' => $order->products[$i]['tax'],
						'products_quantity' => $order->products[$i]['qty']);

tep_db_perform(TABLE_ORDERS_PRODUCTS, $sql_data_array);

$order_products_id = tep_db_insert_id();

//------insert customer choosen option to order--------
$attributes_exist = '0';
if (isset($order->products[$i]['attributes'])) {
  $attributes_exist = '1';
  for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
	if (DOWNLOAD_ENABLED == 'true') {
	  $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename
						   from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa
						   left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
							on pa.products_attributes_id=pad.products_attributes_id
						   where pa.products_id = '" . $order->products[$i]['id'] . "'
							and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "'
							and pa.options_id = popt.products_options_id
							and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "'
							and pa.options_values_id = poval.products_options_values_id
							and popt.language_id = '" . $languages_id . "'
							and poval.language_id = '" . $languages_id . "'";
	  $attributes = tep_db_query($attributes_query);
	} else {
	  $attributes = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'");
	}
	$attributes_values = tep_db_fetch_array($attributes);

	$sql_data_array = array('orders_id' => (int)$this->orders_id,
							'orders_products_id' => $order_products_id,
							'products_options_id' => $order->products[$i]['attributes'][$j]['option_id'],
							'products_options' => $attributes_values['products_options_name'],
							'products_options_values_id' => $order->products[$i]['attributes'][$j]['value_id'],
							'products_options_values' => $attributes_values['products_options_values_name'],
							'options_values_price' => $attributes_values['options_values_price'],
							'price_prefix' => $attributes_values['price_prefix']);

	tep_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $sql_data_array);
  }
}
 }

// store the session info for notification update - gsb
 $sql_data_array = array('sendto' => $sendto,
					  'billto' => $billto,
					  'firstname' => $order->billing['firstname'],
					  'lastname' =>  $order->billing['lastname'],
					  'payment' => $payment,
					  'payment_title' => $this->codeTitle,
					  'payment_amount' => $this->grossPaymentAmount($this->currency()),
					  'payment_currency' => $this->currency(),
					  'payment_currency_val' => $currencies->get_value($this->currency()),
					  'language' => $language,
					  'language_id' => $languages_id,
					  'currency' => $currency,
					  'currency_value' => $currencies->get_value($currency),
					  'content_type' => $order->content_type,
					  'txn_signature' => $this->setTransactionID());

 if($session_exists) {
tep_db_perform(TABLE_ORDERS_SESSION_INFO, $sql_data_array, 'update', "orders_id = '" . (int)$this->orders_id . "'");
$PayPal_osC->txn_signature = $this->digest;
 } else {
$sql_data_array['orders_id'] = (int)$this->orders_id;
tep_db_perform(TABLE_ORDERS_SESSION_INFO, $sql_data_array);
$PayPal_osC = new PayPal_osC($this->orders_id,$this->digest);
tep_session_register('PayPal_osC');
 }
 require(DIR_WS_INCLUDES . 'modules/payment/paypal/catalog/checkout_splash.inc.php');
?>

Link to comment
Share on other sites

I see, did you update the catalog\includes\payment\paypal.php ? Maybe you have the default one or you did override the one of the ipn contribution with the default one.

 

Open that file see if you have this function defined

grossPaymentAmount

 

if not install it from the ipn contribution and then check if the error is still there. Backup your files before doing updates.

Link to comment
Share on other sites

I see, did you update the catalog\includes\payment\paypal.php ? Maybe you have the default one or you did override the one of the ipn contribution with the default one.

 

Open that file see if you have this function defined

grossPaymentAmount

 

if not install it from the ipn contribution and then check if the error is still there. Backup your files before doing updates.

 

Thank you enigma1. Yes I checked the paypal.php file and the function for grossPaymentAmount is defined:

function grossPaymentAmount($my_currency) {
  global $order, $currencies;
  return number_format(($order->info['total']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
}

 

Even if I replaced this file with the newest one, the same error still occurs, as long as the total amount is $0. If not $0, everything is fine. :(

Link to comment
Share on other sites

Where are the intructions for Ver 5.16 for anyone who would like to make the changes manuely Because All that comes with it is if you have a untouched new store. But I already have other Contribs installed and Want to make the Changes one by one. Anyone? Thanks

 

Anyone

Link to comment
Share on other sites

Thank you enigma1. Yes I checked the paypal.php file and the function for grossPaymentAmount is defined:

function grossPaymentAmount($my_currency) {
  global $order, $currencies;
  return number_format(($order->info['total']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
}

 

Even if I replaced this file with the newest one, the same error still occurs, as long as the total amount is $0. If not $0, everything is fine. :(

so from your code this is the line that causes the error when the price is 0.

 

'payment_amount' => $this->grossPaymentAmount($this->currency()),

are you using usd? You can also hard-code a 0 there and see if it still gives the error just in case something else is going on.

Link to comment
Share on other sites

Hi All,

 

I have a heavily modified site and need to install a credit voucher and discount contribution. I attempted to install the latest CCGV to my OSC 2.2 however failed miserably and had to back out. So I've decided to get it working on a clean install prior to trying to merge it with my site.

 

I have a COMPLETELY FRESH installation of 2.2 without a single modification and wish to install CCGV.

I have made an attempt with v5.16 however am coming up with multiple problems in multiple areas.

 

Can someone please advise a WORKING version of CCGV which I can simply dump the files direct into a clean install of OSC2.2 that will just work. (From here I will be able to apply extra features etc and merge with existing site).

 

Rapid responses appreciated.

Link to comment
Share on other sites

Here is a working copy of CCGV 5.16 you also need the fixes from 10FEB06 to 22MAR06 I have the CCGV installed in my store and have not had a problem with it at all.

 

The paypal ipn module includes I did not istall therefore I do not have the issues that everyone else is having. I simply just use regular paypal.

 

http://www.oscommerce.com/community/contri.../download,12114

Edited by matrix2223
Link to comment
Share on other sites

Just compare your files with the ones in the contrib and make the necessary changes.

 

Is there a somewhat easy way to do this, other than by eye? Meaning, it would be rather time consuming to look at one file and compare it with another (by eye). There's probably a simple solution, I'm just not that technically inclined to figure it out, yet.

 

Thanks in advance.

JHouse

Link to comment
Share on other sites

Is there a somewhat easy way to do this, other than by eye? Meaning, it would be rather time consuming to look at one file and compare it with another (by eye). There's probably a simple solution, I'm just not that technically inclined to figure it out, yet.

 

Thanks in advance.

Use a text editor that compares files and tells you the differences.

 

But, there is more............

 

The contributions are marked so that you can easily see where the edits start and end. All you have to do is locate where the edits should go in your files.

Link to comment
Share on other sites

Use a text editor that compares files and tells you the differences.

 

But, there is more............

 

The contributions are marked so that you can easily see where the edits start and end. All you have to do is locate where the edits should go in your files.

 

Or you can use a merge program. I'm using WinMerge, I downloaded it from tucows.com, it's free software and I haven't had any problems, I think it's great.

 

You open up both your original file and the file you want to change to, and the program shows both simultaneously, and highlights any differences between the two files.

 

~Barbara~

Link to comment
Share on other sites

Hi,

 

Does anyone have CCGV and OscAffiliate running side by side?

 

Im trying to get affiliate commission payment to show MINUS the gift voucher and coupons discounts... can anyone help me on this please?

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

Hello,

 

I have a curious problem that is proving difficult for me to figure out. I have the latest version of CCGV installed along with the Authorize.net AIM module for payment. Payment module works with authorize.net just fine. CCGV works fine in terms of correctly calculating the totals, etc. Here is the strange part: The amount passed to authorize.net is the total order without the coupon applied. So the order shows up correctly in the order confirmation page, in the email receipt, and in the order logged into the admin area. But the charge that shows up in the authorize.net interface shows the full amount not the discounted amount. Any ideas? Thanks for the help and a great module!

Link to comment
Share on other sites

Ok, I cant find the edit button, so I have to reply to my own post:

 

Seems like the problem is with the linkpointconnect 1.1 module. This is the original line in the CCGV checkout_payment.php page:

 

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

 

And this is what the readme.txt file from the linkpoint module tells me what the line should read:

 

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

 

Seems like the additional "false" after 'SSL' triggers the error (and prevents the discount module to appear ).

 

Anyone know how to fix this?

 

Warning: Missing argument 1 for javascript_validation() in /home/chcgift/public_html/shop/includes/classes/payment.php on line 109

 

 

I seem to have the same problem with linkpoint. Has anyone figured this one out????

Link to comment
Share on other sites

Hi All,

 

Just a quick question..

 

I have installed this Contrib and it seems to be working fine but I have tried to impliment a coupon

that is valid when a certain product is being purchased. It seems to work fine if only that

product is purchased but as soon as I add another product the coupon will not work.

 

 

Restricting the coupon to certain products is exactly what I want it to do but I need to still allow the customer to purchase additional products as well if they whant to.

 

Sorry if this has been bought up before but this is one lengthy thread..

 

 

Cheers!!

Link to comment
Share on other sites

Hello

 

I installed the coupon roll up 3 additon to the CCGV and thought it was brilliant because of the status green/red buttons.... it still is brilliant :-)

 

however today i noticed that whenever I edit an existing coupon or create a new one, whatever amount i put in for the COUPON AMOUNT, just doesnt show up in preview and doesn't get applied.....

 

whether i put 10% or 10, it allows me to type it in and lets me click preview - BUT on the preview all the information is there but the COUPON AMOUNT is blank.... and when I press confirm it remains blank and when applied in the cart, the 10% or 10 doesn't show.

 

also, when adding the TREEVIEW upgrade to the COUPON ROLL UP coupon admin.php, it doesnt come up either... the pop up shpows the open and close links but when clicked, the main ie page shows a yellow javascript error in the bottom left corner...

 

I gone back to the original coupon_admin page for the time being but hope to find a solution soon

 

...... any advice please?

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

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