Jump to content
Latest News: (loading..)

gem

Members
  • Content count

    10
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Kjetil Horneland
  1. gem

    Official PayPal IPN Support Thread

    Hi everybody I've got the account balance v3 installed, and it has been running fine on my site for years. But now I've installed paypal with norwegian currency, which has tested fine, but I need some help on how to mod paypal_ipn.php with the code from my checkout_process file: My modifications in checkout_process looks like this: after $payment_modules->before_process(); // account balance modif $begin_account_balance_query = tep_db_query("select customers_account_balance from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); $begin_account_balance_result = tep_db_fetch_array($begin_account_balance_query); $begin_account_balance = tep_round($begin_account_balance_result['customers_account_balance'],2); //end account balance modif before // lets start with the email confirmation // account balance modif $order_total_query = tep_db_query("SELECT value FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '" . (int)$insert_id . "' AND class = 'ot_total'"); $order_total = tep_db_fetch_array($order_total_query); $account_balance_query = tep_db_query("SELECT value FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '" . (int)$insert_id . "' AND class = 'ot_account_balance'"); $account_balance = tep_db_fetch_array($account_balance_query); $ot = tep_round(($order_total['value'] + $account_balance['value']), 2); // echo $ot; //if balance is larger than 0, check if balance is more or less than total if ($begin_account_balance > 0) { //ab = start balance $ab = $begin_account_balance; // + tep_calculate_tax($begin_account_balance, $tax); //if order total is greater than balance, set balance to zero if ($ot > $ab) { $account_balance = 0; } //if balance is greater than the total, subtract from total and leave the rest if ($ot < $ab) { $account_balance = $begin_account_balance - $ot; //+ tep_calculate_tax($begin_account_balance, $tax) } //if total is the same as balance, set balance to zero if ($ot == $ab) { $account_balance = 0; } //when done update the database $ending_account_balance = tep_round($account_balance,2); $ending_account_balance_query = tep_db_query("UPDATE " . TABLE_CUSTOMERS . " SET customers_account_balance = '" . $ending_account_balance . "' WHERE customers_id = '" . (int)$customer_id . "'"); //echo $ending_account_balance_query; } // end account balance modif Any help with this would be greatly appreciated! Or if you could point me in the right direction that would be great too :)
  2. Hi everybody Has anyone got an idea of how to update this mod for Paypal IPN v.1.3? I've had Account balance v3 running on a site for years, but when I check out using the paypal IPN v.1.3 payment module the account balance is not modified. Calculations and the amount passed to Paypal is allright though. In the Paypal mod help files it says that this mod mirrors the checkout_process file. So any changes made to checkout_process also needs to be made to paypal_ipn.php My modifications in checkout_process looks like this: after $payment_modules->before_process(); // account balance modif $begin_account_balance_query = tep_db_query("select customers_account_balance from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'"); $begin_account_balance_result = tep_db_fetch_array($begin_account_balance_query); $begin_account_balance = tep_round($begin_account_balance_result['customers_account_balance'],2); //end account balance modif before // lets start with the email confirmation // account balance modif $order_total_query = tep_db_query("SELECT value FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '" . (int)$insert_id . "' AND class = 'ot_total'"); $order_total = tep_db_fetch_array($order_total_query); $account_balance_query = tep_db_query("SELECT value FROM " . TABLE_ORDERS_TOTAL . " WHERE orders_id = '" . (int)$insert_id . "' AND class = 'ot_account_balance'"); $account_balance = tep_db_fetch_array($account_balance_query); $ot = tep_round(($order_total['value'] + $account_balance['value']), 2); // echo $ot; //if balance is larger than 0, check if balance is more or less than total if ($begin_account_balance > 0) { //ab = start balance $ab = $begin_account_balance; // + tep_calculate_tax($begin_account_balance, $tax); //if order total is greater than balance, set balance to zero if ($ot > $ab) { $account_balance = 0; } //if balance is greater than the total, subtract from total and leave the rest if ($ot < $ab) { $account_balance = $begin_account_balance - $ot; //+ tep_calculate_tax($begin_account_balance, $tax) } //if total is the same as balance, set balance to zero if ($ot == $ab) { $account_balance = 0; } //when done update the database $ending_account_balance = tep_round($account_balance,2); $ending_account_balance_query = tep_db_query("UPDATE " . TABLE_CUSTOMERS . " SET customers_account_balance = '" . $ending_account_balance . "' WHERE customers_id = '" . (int)$customer_id . "'"); //echo $ending_account_balance_query; } // end account balance modif So I guess this code should be modified or inserted in paypal_ipn.php I've tried to put it in the similar places, but it doesn't work. Any help in this would be greatly appreciated!
  3. gem

    [Contribution] Extra Fields

    Hi everybody, First off - thanks for a great mod. I have a question about duplicating/linking products. Product extra fields are not copied when I duplicate a product. This is something i really need. Is there a solution for this anywhere? I've searched the forum with no luck... :) I'm using v 2.0b
×