Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.


  • Content count

  • Joined

  • Last visited

  1. In the case where "something is not working" it would be best not to ask others to dig out their crystal ball but to ask yourself what - you could have done wrong during the installation - which code fragments you might not have put in the right place (especially if other add-ons are at work) - which part of your config differs from a vanilla setup. [Might be helpful to pin those instructions.]
  2. As i suspected here, the problem in this case seems to be that the subtotal doesn't change in my case when the discount is applied. so we need to check $order->info['total'] and not $order->info['subtotal'] in includes/modules/shipping/zones.php around line 140. The shipping charges are then recalculated correctly according to the new order total (not subtotal). Tax calculation seems to be correct and I will need to see if payment modules will complain ;) Also if you'd like zone based shpping based on price (instead of weight), just change includes/modules/shipping/zones.php around line 40: if ($shipping_weight <= $zones_table[$i]) { becomes if ($order->info['total'] <= $zones_table[$i]) { of course you will also need to check in is_recalc_shipping() of discount_coupons.php and add the block //JM: check if zone rate shipping has changed if( strtolower(MODULE_SHIPPING_ZONES_STATUS) == 'true' ) { include( DIR_WS_LANGUAGES.$language.'/modules/shipping/zone.php' ); // from zone shipping quote() for ($i=1; $i<=6; $i++) { // HARDCODING ]:-> $countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i); $country_zones = split(",", $countries_table); if (in_array($order->delivery['country']['iso_code_2'], $country_zone\ s)) { $dest_zone = $i; break; } } if ($dest_zone == 0) { DIE('error determining shipping zone for coupon calc'); } else { $shipping = -1; $zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone); $zones_table = split("[:,]" , $zones_cost); for ($i=0; $i<sizeof($zones_table); $i+=2) { if ($order->info['total'] <= $zones_table[$i]) { $shipping = $zones_table[$i+1]; break; } } if( $order->info['shipping_cost'] != $shipping ) { //if the discount \ changes the total (implicitly the total must been lowered by DISCOUNT coupons, \ therefore we just check the change) return true; } } } (as I said before, make just to adjust for subtotal/total check, depending on your config) have fun.
  3. I asked about the same thing a while ago. Nobody answered. Apparently this isn't a support forum after all.
  4. Oh and BTW I'm having/want Order Totals Modules in this order: - Subtotal (without Discount) - Shipping - Discount Coupons Maybe the culprit's in there somewhere too, or a combination thereof.
  5. I have a problem: 'Your calculated shipping charges have changed.' Background: My order is $53. The coupon is $10 for any order. The table rate is set to - $5 shipping below $50, and - $0 (free) shipping above $50. What I do and what happens: checkout_payment.php: I enter the coupon code. It sends me back to: checkout_shipping.php: 'Your calculated shipping charges have changed.' Yet, the table rate still shows $0 shipping, so I am back at the beginning. Obviously, the coupon does not get remembered back on the shipping page, therefore the total is still the old and the shipping module does not recalc the shipping fee. The total still is $53 and the shipping shows $0. I should have Amount $53 - Discount $10 = Subtotal $43+ shipping $5 = Total $47. Should I configure something differently or is this a (known) bug? I have version 3.33 installed.
  6. jmroth

    Updated shipping address during order not saved

    I think I have solved most of these problems, although I cannot provide you with a contribution since I have too many other contributions installed. I can however provide an overview: checkout_process.php contains mostly three/four parts: - initialization - insertion of order into database tables (starting with function confirmation() { global $cartID, $cart_PayPal_Standard_ID, $customer_id, $languages_id, $order, $order_total_modules; global $cart; // JM /* * check if the order_id AND cart_id matches our session */ if (tep_session_is_registered('cartID')) { $insert_order = false; $update_order = false; //JM if (tep_session_is_registered('cart_PayPal_Standard_ID')) { $order_id = substr($cart_PayPal_Standard_ID, strpos($cart_PayPal_Standard_ID, '-')+1); $curr_check = tep_db_query("select currency from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); $curr = tep_db_fetch_array($curr_check); if ( ($curr['currency'] != $order->info['currency']) || ($cartID != substr($cart_PayPal_Standard_ID, 0, strlen($cartID))) ) { $check_query = tep_db_query('select orders_id from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '" limit 1'); if (tep_db_num_rows($check_query) < 1) { tep_db_query('delete from ' . TABLE_ORDERS . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_TOTAL . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_STATUS_HISTORY . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . ' where orders_id = "' . (int)$order_id . '"'); tep_db_query('delete from ' . TABLE_ORDERS_PRODUCTS_DOWNLOAD . ' where orders_id = "' . (int)$order_id . '"'); } $insert_order = true; } else { $update_order = true; //JM } } else { $insert_order = true; } $order_totals = array(); if (is_array($order_total_modules->modules)) { reset($order_total_modules->modules); while (list(, $value) = each($order_total_modules->modules)) { $class = substr($value, 0, strrpos($value, '.')); if ($GLOBALS[$class]->enabled) { for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) { if (tep_not_null($GLOBALS[$class]->output[$i]['title']) && tep_not_null($GLOBALS[$class]->output[$i]['text'])) { $order_totals[] = array('code' => $GLOBALS[$class]->code, 'title' => $GLOBALS[$class]->output[$i]['title'], 'text' => $GLOBALS[$class]->output[$i]['text'], 'value' => $GLOBALS[$class]->output[$i]['value'], 'sort_order' => $GLOBALS[$class]->sort_order); } } } } } // need to insert order before actual processing since IPN looks it up :-) // however must not update stock until payment -> IPN if ($insert_order == true) { echo " <!--@@INSERT--> " ; require('inc/insertorder.php'); $cart_PayPal_Standard_ID = $cartID . '-' . $insert_id; tep_session_register('cart_PayPal_Standard_ID'); } if ($update_order === true) { echo " <!--@@UPDATE--> " ; require('inc/updateorder.php'); } // JM - log the confirmation page if (isset($order_id) || isset($insert_id)) { if (isset($order_id)) $id = $order_id; if (isset($insert_id)) $id = $insert_id; $sql_data_array = array('orders_id' => $id, 'orders_status_id' => MODULE_PAYMENT_PAYPAL_STANDARD_PREPARE_ORDER_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => '0', 'comments' => 'paypal->confirmation()'); //tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); $cart->order_id = $id; } } return false; } where update_order.php mainly contains the same thing than insert_order.php (that is the part of the code from checkout_process.php mentioned at the top), where the insert statements have been replaced by updates, so part of it would i.e. look like tep_db_query("DELETE FROM ".TABLE_ORDERS_TOTAL." WHERE orders_id='". (int)$order_id ."'"); for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $sql_data_array = array('orders_id' => (int)$order_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); } $customer_notification = (SEND_EMAILS == 'true') ? '1' : '0'; $sql_data_array = array('orders_id' => (int)$order_id, 'orders_status_id' => $order->info['order_status'], 'date_added' => 'now()', 'customer_notified' => $customer_notification, 'comments' => $order->info['comments']); tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array, 'update', 'orders_id='.(int)$order_id); //kgt - discount coupons if( tep_session_is_registered( 'coupon' ) && is_object( $order->coupon ) ) { $sql_data_array = array( 'coupons_id' => $order->coupon->coupon['coupons_id'], 'orders_id' => (int)$order_id ); $check_query = tep_db_query("select orders_id from " . TABLE_DISCOUNT_COUPONS_TO_ORDERS . " where orders_id = '" . (int)$order_id . "'"); if (tep_db_num_rows($check_query)) { tep_db_perform( TABLE_DISCOUNT_COUPONS_TO_ORDERS, $sql_data_array, 'update', 'orders_id='.(int)$order_id);//update } else { tep_db_perform( TABLE_DISCOUNT_COUPONS_TO_ORDERS, $sql_data_array); //insert } } //end kgt - discount coupons Maybe in the future one could provide this modular structure directly... or maybe this is already the case for osC3 , dunno...
  7. jmroth

    standard_ipn.php fails with mysql 2013 error

    Well in that case the problem probably isnt with osC but with some other part of your setup/server.
  8. jmroth

    Paypal IPN v2.1.0.0 Email Confirmation

    $email_order is just the body of the email. With just this modification the delivery will not be changed. So we still do not know what exactly you are doing. And BTW: tep_address_format($order->billing['format_id'], $order->billing, 0, '', "\n") . "\n";. is not correct. If at all you probably mean tep_address_format($order->billing['format_id'], $order->billing, 0, '', "\n") . "\n". here (note the semicolon that is too much)
  9. jmroth

    Paypal IPN v2.1.0.0 Email Confirmation

    it is not clear what you mean checkout_process.php (as well as paypal_standard.php) contain tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_addr\ ess'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); // send emails to other people if (SEND_EXTRA_ORDER_EMAILS_TO != '') { tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMA\ IL_ADDRESS); } what did you modify? and why? Usually your customer gets a mail and if you have set SEND_EXTRA_ORDER_EMAILS_TO then you might get a mail too
  10. jmroth

    standard_ipn.php fails with mysql 2013 error

    maybe your tables are corrupt, check + repair using phpmyadmin for example?
  11. jmroth

    PayPal Problem

    in admin in the payment modules section set to live instead of sandbox
  12. If I make my order up to the checkout_confirmation page and then go back (via the links provided at the bottom of the checkout pages) to the shipping page and change my address, the new address is correctly used for the paypal transaction and also for the confirmation mail, but the info in the orders table in the database is not updated. Therefore, looking at the order with the admin tool does not reflect the correct order. Also, one should not use the orders table for further processing (i.e. generating shipment info), since that data can be wrong. The problem is that the paypal payment module confirmation() function does not account for that situation... (The same goes for the billing address of course)
  13. jmroth

    PayPal IPN vs PayPal Website Payments Standard

    I guess you should go with the standard paypal module that comes with 2.2a and which includes IPN. Of course you should develop some form of payment verification, as the standard module contains none! If you use IPN that should be relatively simple to do.
  14. jmroth

    Paypal IPN module removed from osC2.2 rc2 ?

    Hi there, to be completely sure I have installed a vanilla RC2a: Once at checkout_confirmation.php one can simply call checkout_process.php, which will then redirect to checkout_success.php and set the new status (MODULE_PAYMENT_PAYPAL_STANDARD_ORDER_STATUS_ID). I am however only relying on PayPal Instant Payment Notification to tell me whether the payment was _really_ made or not, so like that one can circumvent that. My fix is documented at: http://www.oscommerce.com/forums/index.php?showtopic=291119 Regards, Marc
  15. jmroth

    Multi_Vendor_Shipping new thread

    Well say there is a file checkout.php with osC, there will also be a file checkout.php with MVS if there are changes necessary to it to make MVS work. You use Winmerge to look at the differences in both files while at the same time you can merge missing/additional sections from the MVS file to the osC file. Sometimes however just accepting all merges is not the brightest idea, you have to look at the code if it makes sense and maybe adjust it by hand. Good luck :)