Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

bensbrain

Archived
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Real Name
    Ben Weinberg

bensbrain's Achievements

  1. According to the values you posted last time, the tax wasn't being added to the total at all. That seems to be more of a problem. Anyway, unless the laws in europe are different than here, your customers need to be paying tax on the original total anyway. That is, unless they paid tax on the gift certificate. This function seems to be calculating th enew total with tax: 'value' => tep_add_tax($account_balance, $tax)); Look around there to see if you can move it to a place after the balance has been removed.
  2. I'm not sure why your tax is not being added. My elseifs are only involved in removing the account balance from the total. The total should already include tax by that point in the script. I'm not sure what's wrong. Try to find the part of the code that adds the tax and make sure that function is being called correctly, being passed the right arguments, returning the correct value, updating the total, etc... Incidentally, I've gone to a different product (zencart --> zencart.com) which is a pre-modded and very complete and functional modern version of oscommerce made by some of oscommerce's original designers and coders and very well maintained and updated. I don't know if it supports German by default, but check their website for German language add-ons. It has built in coupons, gift ceritficates, virtual products, templating, html editors for text boxes, actual working HTML email support, multiple images per product, etc. built in. I worked on OScommerce for 2 weeks and got fed up because I was still barely halfway done with the features I needed. I've only been working on Zencart for 2 days and expect my store to go live in 2-3 more days. Ben
  3. Account balance V3 -- latest download available -- installed on heavily modded 2.2ms2. Sorry, I mentioned the wrong file name. Correct file is catalog/includes/modules/order_total/ot_account_balance.php for the changes I mentioned. I'm sorry about that. Of course there's no hint in the install.text. The problem I fixed was a typo. if he knew about the typo, he would have fixed it himself rather than instructing you to do so. But the problem with the if( if( if( instead of elseifs was just bad programming. Not that I haven't done it before, but it is bad programming. The first if statement changes the variable that triggers it, potentially causing the second or third if statement to trigger, creating a mess. Also, if you ever can't find some code snippet in the future, try a text search of all the php files in the site. Any decent HTML editor like Homesite has that function. even windows can do it in a pinch. Also. This is not directed toward you, but toward some of the others on this message board: modding PHP is not for newbies. Any decent shopping cart will require multiple mods (more than 10, at least) and you can only really do the first one safely if you're not a programmer (because you can just replace the files -- once you've done it once, you can't do it again). Sorry to burst any bubbles, but it's true. I'm a pro PHP programmer and I've been modding oscomerce for over a week straight now (40+ hours) and it's still barely functional for my needs. I won;t even launch in to the crappiness of the email functions provided and their utter lack of HTML friendliness. I've decided to try elsewhere for a shopping cart. I'd be happy to send anyone copies of any files I have modded so far for you to look at if it'll help. Ben
  4. I had problems, too and finally tracked down the culprit. There's a typo (and some strange definitions) in one file that I was able to fix, some missing definitions, and some potential glitches with the paypal module that I've found so far. In includes/modules/order_total.php: replace 'value' => $account_balance, $tax); with 'value' => tep_add_tax($account_balance, $tax)); and replace if ($ot > $ab) { $ot -= $ab; // + tep_calculate_tax($begin_account_balance, $tax); $account_balance = 0; } if ($ot < $ab) { // $account_balance = $begin_account_balance - $ot; // + tep_calculate_tax($begin_account_balance, $tax) - $order->info['total']; $account_balance = $ot; // + tep_calculate_tax($begin_account_balance, $tax) - $order->info['total']; $ot = 0; } if ($ot == $ab) { $ot = 0; $account_balance = 0; } with if ($ot > $ab) { $ot -= $ab; // + tep_calculate_tax($begin_account_balance, $tax); $account_balance = $ab; } elseif ($ot < $ab) { // $account_balance = $begin_account_balance - $ot; // + tep_calculate_tax($begin_account_balance, $tax) - $order->info['total']; $account_balance = $ot; // + tep_calculate_tax($begin_account_balance, $tax) - $order->info['total']; $ot = 0; } elseif ($ot == $ab) { $ot = 0; $account_balance = $ab; } The latter fix makes the account balance on the order preview page display the amount that was actually subtracted from the total, rather than what's left in the account, which doesn't make sense to me as a line item on an invoice and causes the total to be wrong anyway. Also the lack of elseifs was less than well thought out. ALSO There were several missing definitions in admin/includes/languages/english/customers.php: here are some suggestions: define('CATEGORY_ACCOUNT_BALANCE','Account Balance'); define('TABLE_HEADING_ACCOUNT_BALANCE', 'Account Balance'); define('ENTRY_ACCOUNT_BALANCE_OLD','Current Balance'); define('ENTRY_ACCOUNT_BALANCE','Add (or subtract) Balance'); define('ENTRY_ACCOUNT_BALANCE_DESC','Description'); AND this module totally screws with paypal if the total ends up being less than the usual shipping cost, so this fix has to be made: You'll see where this goes, in includes/modules/shipping/PayPal.php: I commented out the existing code below and wrote my mods underneath // fixed for my use with gift certificates - Ben // tep_draw_hidden_field('amount', number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) . tep_draw_hidden_field('amount', number_format($order->info['total'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) . // and this, to fix shipping - Ben // tep_draw_hidden_field('shipping', number_format($order->info['shipping_cost'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) . tep_draw_hidden_field('shipping', number_format(0 * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) . I'm still working on this stuff myself, so let me know if this helps. You owe me $200! ;-) Ben
×
×
  • Create New...