Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

stephvand

Archived
  • Posts

    45
  • Joined

  • Last visited

About stephvand

  • Birthday 04/27/1978

Profile Information

stephvand's Achievements

  1. I'm curious about how the calculations are done. In my shop we sell items in USD and CAD - are the totals being calculated by just adding up total sales regardless of the currency, or are they converted into the store's default currency when/before they get tallied? Thanks.
  2. Has anyone attempted to use this contrib with the Canadian version of Quickbooks Premier Edition 2006?
  3. stephvand

    Paypal scam???

    I ran into this too, testing the Paypal redirect that returns users to my site after a payment is made. If you go through the checkout and place an order, log in to PayPal as though you're going to pay and then manually enter the URL that PayPal redirects your shoppers to after payment is complete, then you get this result. It's entirely possible that someone's figured this out and is setting themselves up with a paper trail for a payment they didn't actually make. The only solution is vigilance...or maybe a redirect URL generated specifically for each order with the next release of OSCommerce Edited for typo.
  4. Hi gang. I've just installed the First Item, Plus Additional Items Shipping Module from here: http://www.oscommerce.com/community/contributions,1852 . I'm running 2.2. I needed to add the ability to select a tax class for this shipping module so GST could be applied to Canadian orders. It worked for me, and here's the code in case anyone wants to use it: (bear in mind that I'm a semi-n00b to PHP and MySQL so I make no guarantees here. BACK UP!!!! If anyone notices anything stupid that I did wrong, I have thick skin. Point it out please. <?php /* $Id: firstitemplus.php,v 1.0x 2004/02/06 by MF, modeled after: $Id: table.php,v 1.26x 2003/01/31 $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce * Modifications by Christian Lescuyer <[email protected]> * Copyright (c) 2003 Go?lette http://www.goelette.net Released under the GNU General Public License */ class firstitemplus { var $code, $title, $description, $icon, $enabled; // class constructor function firstitemplus() { global $order; $this->code = 'firstitemplus'; $this->title = MODULE_SHIPPING_FIRSTITEMPLUS_TEXT_TITLE; $this->description = MODULE_SHIPPING_FIRSTITEMPLUS_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_FIRSTITEMPLUS_SORT_ORDER; $this->icon = ''; $this->tax_class = MODULE_SHIPPING_FIRSTITEMPLUS_TAX_CLASS; $this->enabled = ((MODULE_SHIPPING_FIRSTITEMPLUS_STATUS == 'True') ? true : false); if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FIRSTITEMPLUS_ZONE > 0) ) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FIRSTITEMPLUS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); while ($check = tep_db_fetch_array($check_query)) { if ($check['zone_id'] < 1) { $check_flag = true; break; } elseif ($check['zone_id'] == $order->delivery['zone_id']) { $check_flag = true; break; } } if ($check_flag == false) { $this->enabled = false; } } } // class methods function quote($method = '') { global $cart, $shipping_weight, $shipping_num_boxes; $order_total = $cart->count_contents(); $table_cost_first = MODULE_SHIPPING_FIRSTITEMPLUS_FIRST; $table_cost_additional = MODULE_SHIPPING_FIRSTITEMPLUS_ADDITIONAL; $shipping = ($order_total < 2) ? $table_cost_first : ($table_cost_first + (($order_total - 1) * $table_cost_additional)); $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FIRSTITEMPLUS_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => sprintf(MODULE_SHIPPING_FIRSTITEMPLUS_TEXT_WAY,$table_cost_first,$table_cost_additional), 'cost' => $shipping + MODULE_SHIPPING_FIRSTITEMPLUS_HANDLING))); if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); return $this->quotes; } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FIRSTITEMPLUS_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable First Item Plus Additional Method', 'MODULE_SHIPPING_FIRSTITEMPLUS_STATUS', 'True', 'Do you want to offer \"First item $X, additional items $X\" shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost for First Item', 'MODULE_SHIPPING_FIRSTITEMPLUS_FIRST', '6.00', 'The shipping cost is calculated using a cost for the the first item, then another cost for each additional item. Enter the cost of the first item (without dollar sign):', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost for Additional Items', 'MODULE_SHIPPING_FIRSTITEMPLUS_ADDITIONAL', '1.00', 'Cost per additional item (without dollar sign):', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_FIRSTITEMPLUS_HANDLING', '0', 'Additional handling fee for this shipping method.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_FIRSTITEMPLUS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_FIRSTITEMPLUS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_SHIPPING_FIRSTITEMPLUS_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_SHIPPING_FIRSTITEMPLUS_STATUS', 'MODULE_SHIPPING_FIRSTITEMPLUS_FIRST', 'MODULE_SHIPPING_FIRSTITEMPLUS_ADDITIONAL', 'MODULE_SHIPPING_FIRSTITEMPLUS_HANDLING', 'MODULE_SHIPPING_FIRSTITEMPLUS_ZONE', 'MODULE_SHIPPING_FIRSTITEMPLUS_TAX_CLASS', 'MODULE_SHIPPING_FIRSTITEMPLUS_SORT_ORDER'); } } ?>
  5. Hope this is useful for someone else...if you're opening a Canadian store, make sure CAD is your default currency and try not to alter this more often than you need to. Peter Mosier (lost the link, but a search will turn up the thread) posted a great article on Ontarian sales tax setups for stores operating from ON. I followed that to the letter (omitting HST requirements) and I've managed to get taxes working as follows: Books - GST is charged Canada-wide with GST on shipping Canada-wide. Non-book items: PST and GST charged if shipping within Ontario, GST only if outside Ontario, GST on shipping Canada-wide. No taxes outside Canada. I'd be happy to offer help to any other Canucks looking for this kind of setup. The tax and currency decimals were both set to 2 places in my shop, and this time there were no rounding or decimal issues. WHEW!
  6. I ended up starting over with a clean installation yesterday because there were too many factors that could have been affecting the order totals - couldn't sort them all out. Haven't attempted the taxes again yet, but yes the documentation was helpful and there was a great thread by Peter Mosier in here about Ontario tax setups which was exactly right. Currency and tax decimal settings are both at 2 decimal places, and the hope is that having started fresh with CAD as the default currency right away (think that switching back and forth so often before we decided to go CAD fux0red a few things up) I won't experience the same issues again. Also I suspect that if the decimal points weren't causing problems, the sort order of the order total module may have been wrong. In a nutshell, back to the drawing board and I'll let every one know what I did if it works. Thanks!
  7. Also, I just noticed that on each item page the prices are coming up with four decimal places: $16.9900 and on my Currencies page, should there be 8 decimal places?: Decimal Point: . Thousands Point: , Decimal Places: 2 Last Updated: 10/27/2004 Value: 1.00000000
  8. Nick...if you have an osCommerce installation already you can look at Payment Modules under your Admin area to find out what automated processing options are built in. If you pick one of these for your client later on, it'll be simple enough to set up. Research any or all of those and let your client choose the best one for their business. The default ones are as follows: Authorize.net Credit Card Cash on Delivery iPayment Check/Money Order NOCHEX PayPal 2CheckOut PSiGate SECPay Your client / you will get emailed copies of each order and if you configure the software to collect credit card numbers your client can print and manually process each order. This is far harder than it needs to be, though.
  9. I've been poking through the rounding / tax problem threads and can't seem to find one that matches my weird issue. Truth is, I'm not sure if I'm having a rounding problem or a tax problem since some of my orders are closer to accuracy than others. Can any of you point out any obvious mistakes if you spot them? It's a Canadian store. The default currency has been switched back and forth from CAD to USD a couple times, which I understand could be causing database issues that relate to rounding and decimal places. The store will end up using CAD as the default currency. I have the "decimal places" set to 2 under both tax and currency in Admin. Is there something I should be checking in the database itself as well, to make sure these values "took" when we changed back and forth between default currencies a bunch of times? I noticed mention of checking the database on a few threads but failed to get the gist of what we need to look for. Now the problem itself: GST calculations are inaccurate at the checkout page. I don't have the taxes included on the item pages. The label "GST on books" in the below example is insignificant... books have their own tax class separate from my other store items and this example order was for a book. This problem is happening store-wide though and not just with this type of item. Sub-Total: $17.07(CAD) Flat Rate (Best Way): $6.10(CAD) GST on books + GST on shipping: $2.39(CAD) Total: $25.56(CAD) The correct GST amount should be 7% of $23.17 (item plus shipping), and comes to $1.6219 (I'm assuming that this rounds to $1.62). I don't know where the $2.39 GST amount is coming from. Does this look like a rounding error to the more experienced folks, or is this something to do with decimal places in the database and my repeated messing with the default currency? Any guesses?
×
×
  • Create New...