Strider Posted January 24, 2004 Author Share Posted January 24, 2004 jamoor: on line 52 of table.php in includes/modules/shipping change $order_total = $cart->show_total();to $order_total = $cart->show_total_virtual(); //changed for ccgv you know people I don't mind finding bugs but I am getting tired of answering questions to people that don't know how to debug code or follow directions. If you don't know how to debug or follow directions hire someone that can. Quote (my knowledge is so small you would think that an ant was a genius in comparison) Link to comment Share on other sites More sharing options...
Airwalk Posted January 24, 2004 Share Posted January 24, 2004 anyone got the TAX problem solved? I'm working on it since ages :( To describe the problem again: ==================== I want to use the discount coupon feature. Price is reduced right - also total is reduced the right way ... BUT tax value is not reduced (but i need this also!). e.g.: Price: 100 EUR Coupon: - 10 EUR Tax: 12.41 EUR (included in the total 90 EUR) Total: 90 EUR But CC & GV says: Price: 100 EUR Coupon: - 10 EUR Tax: 13.79 EUR (included in the OLD total 100 EUR) Total: 90 EUR I think it would help if someone can tell me how to change the TAX at ot_coupon.php ... i wanted to reduce the 'total tax' with the tax from the discount (that should be the fastest way) ... but i can't the right code ... i've tried everything ... :unsure: Can anyone help out? I would be happy! :D Quote Link to comment Share on other sites More sharing options...
DesertDogs Posted January 25, 2004 Share Posted January 25, 2004 DesertDogs: you probably want to use the 5.3 version of ccgv for ms1. If I remember right there was a stack of changes that needed to be done to make it work with 2.2.2 I'm pretty much ready to give up on getting the latest version of the credit class to work with MS1. The writing to the database seems to be inconsistent. When I email a coupon, no entry is made in the coupon_email_track table, and other inconsistencies. I think it may have something to do with the messagestack, whatever that is used for. I think it's something new for MS2 -- I can't find any release documentation for MS2 describing the changes in detail, just a PR puff piece and a bunch of accolades. I'm willing to try an older version of the CCGV (for MS1), but I don't see version 5.3 in the contribution list at http://www.oscommerce.com/community/contributions,282 Did you mean 5.03? None of the contributions say what milestone they apply to. (!) Thanks, -Matt Quote Link to comment Share on other sites More sharing options...
onnig Posted January 25, 2004 Share Posted January 25, 2004 Hi All, Great mod, lovin' it. Two problems though, the popup coupon window is giving errors: Errors:Object Expected If I copy the shortcut to the address bar without the java section the page appears. I verified the shopping_cart.php section and all the necessary edits are there. Also, I have PayPal as my payment option. If someone uses a gift voucher that is more then the purchase amount, a payment option, in this case paypal, is still required. Can that be bypassed? Quote Onnig Link to comment Share on other sites More sharing options...
scole Posted January 26, 2004 Share Posted January 26, 2004 I installed the credit class contribution (zip:ccgv-510b) and everything went well. No errors or anything, however did discover a problem. The Shipping Page (checkout_shipping.php) no longer loads. When accessed, it automatically forwards me to the Payment Page (checkout_payment.php). I've tried to debug the problem and can't seem to resolve it. I believe I have narrowed it down to the following code: // if the order contains only virtual products, forward the customer to the billing page as // a shipping address is not needed // ICW CREDIT CLASS GV AMENDE LINE BELOW //if ($order->content_type == 'virtual') { if (($order->content_type == 'virtual') || ($order->content_type == 'virtual_weight') ) { if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); $shipping = false; $sendto = false; tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } If I comment out the tep_redirect line it no longer automatically forwards me to the payment page (blank page displays). If I comment out the entire section the shipping works fine again. Suspect there's a problem with the content_type. I backup my system prior to any contribution install. I checked the backup prior to installing this contrib and it works fine. I have no idea why this is happening. I suspect that the problem actually lies within another file before it reaches this script, however I cannot find it. Any Ideas? Thanks, S. Cole ps. sorry for the double posting, I meant to post the last one here! :) Quote Link to comment Share on other sites More sharing options...
Strider Posted January 26, 2004 Author Share Posted January 26, 2004 scole : place a weight in your products unless they are virtual DesertDogs: yes it is 5.03 Quote (my knowledge is so small you would think that an ant was a genius in comparison) Link to comment Share on other sites More sharing options...
scole Posted January 26, 2004 Share Posted January 26, 2004 Strider.... That worked!! Thanks! S. Cole Quote Link to comment Share on other sites More sharing options...
onnig Posted January 27, 2004 Share Posted January 27, 2004 Can someone assist me with my question on page 83 at the bottom? Thanks. Quote Onnig Link to comment Share on other sites More sharing options...
onnig Posted January 27, 2004 Share Posted January 27, 2004 Well I thought I had found the answer to the problem where a payment method (page 33) is still required even though a gift voucher pays for the total. I set my sort order total like this: discount coupon 5 gift vouchers 740 total 10 and here is my checkout_confirmatin.php code: <?php/* $Id: checkout_confirmation.php,v 1.139 2003/06/11 17:34:53 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 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(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); 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)); } // 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')); } } // 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')); } if (!tep_session_is_registered('payment')) tep_session_register('payment'); if (isset($HTTP_POST_VARS['payment'])) $payment = $HTTP_POST_VARS['payment']; if (!tep_session_is_registered('comments')) tep_session_register('comments'); if (tep_not_null($HTTP_POST_VARS['comments'])) { $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); } // load the selected payment module require(DIR_WS_CLASSES . 'payment.php'); if ($credit_covers) $payment=''; //ICW added for CREDIT CLASS $payment_modules = new payment($payment); //ICW ADDED FOR CREDIT CLASS SYSTEM require(DIR_WS_CLASSES . 'order_total.php'); require(DIR_WS_CLASSES . 'order.php'); $order = new order; $payment_modules->update_status(); //ICW ADDED FOR CREDIT CLASS SYSTEM $order_total_modules = new order_total; //ICW ADDED FOR CREDIT CLASS SYSTEM $order_total_modules->collect_posts(); //ICW ADDED FOR CREDIT CLASS SYSTEM $order_total_modules->pre_confirmation_check(); // ICW CREDIT CLASS Amended Line // if ( ( is_array($payment_modules->modules) && (sizeof($payment_modules->modules) > 1) && !is_object($$payment) ) || (is_object($$payment) && ($$payment->enabled == false)) ) { if ( (is_array($payment_modules->modules)) && (sizeof($payment_modules->modules) > 1) && (!is_object($$payment)) && (!$credit_covers) ) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_NO_PAYMENT_MODULE_SELECTED), 'SSL')); } if (is_array($payment_modules->modules)) { $payment_modules->pre_confirmation_check(); } // load the selected shipping module require(DIR_WS_CLASSES . 'shipping.php'); $shipping_modules = new shipping($shipping); //ICW Credit class amendment Lines below repositioned // require(DIR_WS_CLASSES . 'order_total.php'); // $order_total_modules = new order_total; // load the selcted giftwrap module require(DIR_WS_CLASSES . "gift.php"); $giftwrap_modules = new gift($giftwrap); // Stock Check $any_out_of_stock = false; if (STOCK_CHECK == 'true') { for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { if (tep_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) { $any_out_of_stock = true; } } // Out of Stock if ( (STOCK_ALLOW_CHECKOUT != 'true') && ($any_out_of_stock == true) ) { tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); } } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_CONFIRMATION); $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <!-- coolMenu //--> <?php if (DISPLAY_DHTML_MENU == 'CoolMenu') { echo '<script LANGUAGE="JavaScript1.2" SRC="includes/coolMenu.js"></SCRIPT>'; } ?> <!-- coolMenu_eof //--> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> <?php include ('includes/ssl_protected.js.php'); ?> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- coolMenu //--> <?php if (DISPLAY_DHTML_MENU == 'CoolMenu') { require(DIR_WS_INCLUDES . 'coolmenu.php'); } ?> <!-- coolMenu_eof //--> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="3" cellpadding="3"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_confirmation.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <?php if ($sendto != false) { ?> <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><?php echo '<b>' . HEADING_DELIVERY_ADDRESS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td> </tr> <tr> <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>'); ?></td> </tr> <?php if ($order->info['shipping_method']) { ?> <tr> <td class="main"><?php echo '<b>' . HEADING_SHIPPING_METHOD . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td> </tr> <tr> <td class="main"><?php echo $order->info['shipping_method']; ?></td> </tr> <?php } ?> <?php if ($order->info['giftwrap_method']) { ?> <tr> <td class="main"><b><?php echo HEADING_GIFTWRAP_METHOD; ?></b></td> </tr> <tr> <td class="main"><?php echo $order->info['giftwrap_method']; ?></td> </tr> <?php } ?> </table></td> <?php } ?> <td width="<?php echo (($sendto != false) ? '70%' : '100%'); ?>" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php if (sizeof($order->info['tax_groups']) > 1) { ?> <tr> <td class="main" colspan="2"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td> <td class="smallText" align="right"><b><?php echo HEADING_TAX; ?></b></td> <td class="smallText" align="right"><b><?php echo HEADING_TOTAL; ?></b></td> </tr> <?php } else { ?> <tr> <td class="main" colspan="3"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td> </tr> <?php } for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { echo ' <tr>' . "\n" . ' <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" . ' <td 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 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"; } ?> </table></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><b><?php echo HEADING_BILLING_INFORMATION; ?></b></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><?php echo '<b>' . HEADING_BILLING_ADDRESS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td> </tr> <tr> <td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>'); ?></td> </tr> <tr> <td class="main"><?php echo '<b>' . HEADING_PAYMENT_METHOD . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td> </tr> <tr> <td class="main"><?php echo $order->info['payment_method']; ?></td> </tr> </table></td> <td width="70%" valign="top" align="right"><table border="0" cellspacing="0" cellpadding="2"> <?php if (MODULE_ORDER_TOTAL_INSTALLED) { $order_total_modules->process(); echo $order_total_modules->output(); } ?> </table></td> </tr> </table></td> </tr> <?php if (is_array($payment_modules->modules)) { if ($confirmation = $payment_modules->confirmation()) { ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><b><?php echo HEADING_PAYMENT_INFORMATION; ?></b></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" colspan="4"><?php echo $confirmation['title']; ?></td> </tr> <?php for ($i=0, $n=sizeof($confirmation['fields']); $i<$n; $i++) { ?> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo $confirmation['fields'][$i]['title']; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td class="main"><?php echo $confirmation['fields'][$i]['field']; ?></td> </tr> <?php } ?> </table></td> </tr> </table></td> </tr> <?php } } ?> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php if (tep_not_null($order->info['comments'])) { ?> <tr> <td class="main"><?php echo '<b>' . HEADING_ORDER_COMMENTS . '</b> <a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></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"> <tr> <td class="main"><?php echo nl2br(tep_output_string_protected($order->info['comments'])) . tep_draw_hidden_field('comments', $order->info['comments']); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <?php } ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="right" class="main"> <?php if (isset($$payment->form_action_url)) { $form_action_url = $$payment->form_action_url; } else { $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); } echo tep_draw_form('checkout_confirmation', $form_action_url, 'post'); if (is_array($payment_modules->modules)) { echo $payment_modules->process_button(); } echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "\n"; ?> </td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td> <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> </tr> </table></td> <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> <td><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td> <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> </tr> </table></td> <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td> <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td> </tr> </table></td> </tr> <tr> <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_DELIVERY . '</a>'; ?></td> <td align="center" width="25%" class="checkoutBarFrom"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL') . '" class="checkoutBarFrom">' . CHECKOUT_BAR_PAYMENT . '</a>'; ?></td> <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td> <td align="center" width="25%" class="checkoutBarTo"><?php echo CHECKOUT_BAR_FINISHED; ?></td> </tr> </table></td> </tr> </table></td> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> One more thing, where is the page were I can change the link of the gift voucher that I mail out from Admin? The link that it is sending is incorrect. Quote Onnig Link to comment Share on other sites More sharing options...
Strider Posted January 27, 2004 Author Share Posted January 27, 2004 onnig: if you are running 510b the link for the welcome gift voucher is in the admin->configuration->mystore ..... it is the price that you put in. the welcome discount is the coupon code that is generated or you supply. The checkout_process is the file used for the checkout determination and your sort order needs to have total as the highest number. Quote (my knowledge is so small you would think that an ant was a genius in comparison) Link to comment Share on other sites More sharing options...
swrecruiter Posted January 27, 2004 Share Posted January 27, 2004 Has anyone implemented this contrib with the BTS (Basic Templating System) contrib as of yet? Most cool contribs, such as this one, have not been built with BTS. Any FYI would be useful. Matthew@no_spam_please_verticalmove.com Quote Link to comment Share on other sites More sharing options...
Strider Posted January 27, 2004 Author Share Posted January 27, 2004 swrecruiter: Yes I have the ccgv working with the bts. In fact I have it working in quite a few stores actually. Works fine. TO ANYONE THAT READS THIS LIST: I will not be accepting anymore emails from anyone without first asking me through a pm. This latest round of email games cost me 12 hours... sorry ... and I will not be accepting anymore attachments of screen shots et al... Quote (my knowledge is so small you would think that an ant was a genius in comparison) Link to comment Share on other sites More sharing options...
onnig Posted January 27, 2004 Share Posted January 27, 2004 Hi Strider, Thanks for the answer but I was asking about when the voucher pays for the entire order but still requires a payment option. I don't have a problem with welcome gift voucher creation but thanks I did not know that was there. So I changed the order total as the highest sort order being 741, one above gift voucher, the total then becomes zero after the voucher is deducted but confirming the order still sends me to paypal. Once again thanks for all your help. Quote Onnig Link to comment Share on other sites More sharing options...
onnig Posted January 27, 2004 Share Posted January 27, 2004 (edited) Oh and I am using version 510b 2.2 MS2, I also have PAYPAL IPN, with gift wrap mod and two forms of shipping , ups and usps. I set download to true and I enjoy long walks on the beach, thanks. Edited January 27, 2004 by onnig Quote Onnig Link to comment Share on other sites More sharing options...
kinetek Posted January 29, 2004 Share Posted January 29, 2004 (edited) My sales tax seems to be 3-4 cents off when using a fixed amount for the discount coupon. Any idea how to fix this? Everything else works fine. here is my sort order: sub-total - 1 shipping - 2 discount coupons - 760 tax - 800 total - 900 here is my configuration: Display Total true Sort Order 760 Include Shipping false Include Tax false Re-calculate Tax Standard Tax Class --none-- I also noticed that when the coupon amount exceeds the sub-total (so only shipping is charged to the total) the total is a $0.01 off (i.e.: $4.94 when it should be $4.95). My guess for both of these problems is a rounding error somewhere. Edited January 29, 2004 by kinetek Quote Link to comment Share on other sites More sharing options...
kinetek Posted January 29, 2004 Share Posted January 29, 2004 I should also mention that the total being off only happens when the items are taxable. Quote Link to comment Share on other sites More sharing options...
Strider Posted January 29, 2004 Author Share Posted January 29, 2004 then it might be that your sort order is off. or you could find out where it is happening and we could put it in as a bug ... I actually will not even have a breath of time to look at it for about 3 to 4 weeks. Quote (my knowledge is so small you would think that an ant was a genius in comparison) Link to comment Share on other sites More sharing options...
kinetek Posted January 29, 2004 Share Posted January 29, 2004 thanks for the quick reply and a great contribution. i'm using the sort order suggested in the install.html file included in the contribution. i'll try and see if i can fix it. anyone else having the same problem? Quote Link to comment Share on other sites More sharing options...
tradertt Posted January 29, 2004 Share Posted January 29, 2004 Hi Strider, I have a problem. I will love to install your contribution however I just installed a CGDISCOUNT contribution by HOZONE. I understand that since it is not a new MS2 installation, I cannot just copy and paste over and I will have to edit the files manually. However, how will I know which lines to add in and where to add it in... I tried searching for ICW as you mentioned in the installation guide but the ICW starts at funny places and it may be in the middle of a sentence ... How will I add it in and which part of the PHP file .. Anyone can help on this? Quote Link to comment Share on other sites More sharing options...
tradertt Posted January 29, 2004 Share Posted January 29, 2004 Anyone can help? Quote Link to comment Share on other sites More sharing options...
GD Posted January 29, 2004 Share Posted January 29, 2004 Hi tradertt, However, how will I know which lines to add in and where to add it in... The easiest way I have found to find the changes between osCommerce code and the code from a mod is to use this FREE PC software. B) ExamDiff - Visual File Comparison Tool: http://www.prestosoft.com/ Good luck! Quote Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet! Link to comment Share on other sites More sharing options...
kinetek Posted January 29, 2004 Share Posted January 29, 2004 can anyone tell me the block of code that executes in includes/modules/ot_coupon.php when the coupon is a fixed amount and there is a tax rate to be recalculated? Quote Link to comment Share on other sites More sharing options...
kinetek Posted January 29, 2004 Share Posted January 29, 2004 Okay, I figured it out. This bug only manifests itself if you have recalculate tax on, your products are taxable and the discount coupon is a fixed amount. I don't know if I'm the only one to come across the bug but I'm sure others have but just didn't notice the 3-4 cents off. It all depends on the tax rate and the price of each item because if the discounted tax amount for each item is less x.xx5 (i.e. 0.023 would be 0.02) then the calculations will be correct but if it is greater (i.e. 0.026 would be 0.02 but should be 0.03), the trailing digits would just be cut off and there will be no rounding up (which should happen or a banking error occurs). Well, here is the simple fix: on line 314, change this: $ratio1 = $od_amount/($amount-$order->info['tax_groups'][$key]); ////debug to this: $ratio1 = round($od_amount/($amount-$order->info['tax_groups'][$key])); ////debug It looks like someone knew this line was causing problems because there's a "debug" in the comments. I hope this fixes it. It did for me. Quote Link to comment Share on other sites More sharing options...
kinetek Posted January 29, 2004 Share Posted January 29, 2004 please disregard that last post from me. any introduction of the round function into that block of code causes that whole block to be ignored in the total tax (so tax is calculated off of the original sub-total). Quote Link to comment Share on other sites More sharing options...
kinetek Posted January 29, 2004 Share Posted January 29, 2004 (edited) okay i think i got it this time. i don't see a need for the ratio so i just got rid of it. at the same line 341: replace: $ratio1 = $od_amount/($amount - $order->info['tax_groups'][$key]); ////debug $tax_rate = tep_get_tax_rate_from_desc($key); $net = $tax_rate * $order->info['tax_groups'][$key]; ?if ($value!=0) { ? ?$god_amount = $order->info['tax_groups'][$key] * $ratio1;; with //$ratio1 = $od_amount/($amount - $order->info['tax_groups'][$key]); ////debug $tax_rate = tep_get_tax_rate_from_desc($key); //$net = $tax_rate * $order->info['tax_groups'][$key]; ?if ($value!=0) { ? ?//$god_amount = $order->info['tax_groups'][$key] * $ratio1; ? ?$god_amount = ($tax_rate/100)*$od_amount; not sure if anyone else has this problem so if you don't, you don't need to apply the fix above. Edited January 29, 2004 by kinetek Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.