longhorn1999, on 18 January 2010, 04:06, said:
Actually I spent today having my hosting service restore my backup to right before I ever messed with discount coupons and one page checkout. Then I installed one page checkout again and of course when a returning customer logs in and tries to check out:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where customer_id = '3'' at line 1
select amount from where customer_id = '3'
Maybe it's some conflict with purchase without account but nothing I change in the admin will set things right. I'd uninstall purchase without account but that was 12 add-ons ago and I foolishly used the package with an autoinstaller, making it even harder to take out. Any ideas before I finally have to throw in the towel? Maybe some simple database modification I'm missing?
Thanks,
Nick
Hi Nick
find following in checkout.php and remove it
//BOF KGT
if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
if(isset($_POST['code']))
{
if(!tep_session_is_registered('coupon'))
tep_session_register('coupon');
$coupon = $_POST['code'];
}
}
//EOF KGT
and
//BOF KGT
onePage.kgtInstalled = <?php echo (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' ? 'true' : 'false');?>;
//EOF KGT
and
//BOF KGT
if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
echo '<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="main"><b>Have A Coupon?</b></td>
</tr>
<tr>
<td class="main">' . tep_draw_input_field('coupon', 'coupon code') . '</td>
<td class="main">' . tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeemCoupon"') . '</td>
</tr>
</table>';
}
//EOF KGT
includes/classes/onepage_checkout.php
find and remove it
//BOF KGT
if(MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS=='true')
{
//kgt - discount coupons
if (tep_not_null($onepage['info']['coupon'])) {
//this needs to be set before the order object is created, but we must process it after
if (!tep_session_is_registered('coupon')) tep_session_register('coupon');
$order->info['coupon'] = $onepage['info']['coupon'];
//$order->info['applied_discount'] = $onepage['info']['applied_discount'];
//$order->info['subtotal'] = $onepage['info']['subtotal'];
}
//end kgt - discount coupons
}
//EOF KGT
and
//BOF KGT
if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
$valid_products_count = 0;
$order->coupon->applied_discount = array();
}
//EOF KGT
and
//BOF KGT
if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' && is_object( $order->coupon )){
//kgt - discount coupons
$applied_discount = 0;
$discount = $order->coupon->calculate_discount( $order->products[$i], $valid_products_count );
if( $discount['applied_discount'] > 0 ) $valid_products_count++;
$shown_price = $order->coupon->calculate_shown_price( $discount, $order->products[$i] );
//var_dump($shown_price);
$shown_price = $shown_price['actual_shown_price'];
} else {
$shown_price = tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'];
}
$order->info['subtotal'] += $shown_price;
/**************
$shown_price = tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'];
$order->info['subtotal'] += $shown_price;
**************/
//end kgt - discount coupons
//EOF KGT
and
//kgt - discount coupon
if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' && is_object( $order->coupon ) )
{
//$order->coupon->applied_discount = $applied_discount;
$order->info['total'] = $order->coupon->finalize_discount( $order->info );
$onepage['coupon'] = $order->coupon;
}
//end kgt - discount coupon
and
//BOF KGT
if(MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS=='true')
{
$onepage['info']['coupon'] = $order->info['coupon'];
//$onepage['info']['applied_discount'] = $order->info['applied_discount'];
//$onepage['info']['subtotal'] = $order->info['subtotal'];
//end kgt - discount coupons
}
//EOF KGT
that should do it
Steve