Jump to content

volumax

Members
  • Content count

    111
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Andrew McDonald
  • Location
    Hull
  • Website
  1. volumax

    Courier Shipping by postcode

    Below is the shipping file <?php /* Released under the GNU General Public License Based on TNT Australia Shipping based on postcode V2 By Jay Bonaretti Version 3.0 23 March 2006 by Brent Wesley */ class clzipzones { var $code, $title, $description, $enabled, $num_zones; // class constructor:w function clzipzones() { $this->code = 'clzipzones'; $this->title = MODULE_SHIPPING_CLZIPZONES_TEXT_TITLE; $this->description = MODULE_SHIPPING_CLZIPZONES_TEXT_DESCRIPTION; $this->icon = DIR_WS_ICONS . ''; $this->tax_class = MODULE_SHIPPING_CLZIPZONES_TAX_CLASS; $this->sort_order = MODULE_SHIPPING_CLZIPZONES_SORT_ORDER; $this->enabled = ((MODULE_SHIPPING_CLZIPZONES_STATUS == 'True') ? true : false); // Customize this setting for the number of zones needed (no change required by default) $this->num_zones = 1; //More options can be added later for Express, Overnight etc when someone codes it. $this->types = array('Toll Off-Peak' => 'std'); } // class methods function quote($method = '') { global $order, $shipping_weight, $shipping_num_boxes; //First split the destination postcode and check the db for matching delivery zone $postcode = $order->delivery['postcode']; list($c_postcode, $local) = split('[/ -]', $postcode); if ( $c_postcode == '' ){ // Something is wrong, no matching area code $this->quotes['error'] = MODULE_SHIPPING_CLZIPZONES_NO_POSTCODE; return $this->quotes; } $sql = "SELECT * FROM cl_zones WHERE c_postcode = '$c_postcode'"; $qResult = tep_db_query($sql); // run the query $rec = tep_db_fetch_array($qResult); // get the first row of the result $zone_id = $rec['c_zone']; if ( $zone_id == '' ){ // Something is wrong, we didn't find any zone $this->quotes['error'] = MODULE_SHIPPING_CLZIPZONES_NO_ZONE_FOUND; return $this->quotes; } // Consignment Rate insertion start $sql = "SELECT c_rate FROM cl_rates WHERE c_zone_id = '$zone_id'"; $qResult = tep_db_query($sql); while ($rec = tep_db_fetch_array($qResult)) {$retArr[] = $rec;} foreach($retArr as $aquote){ $cost = $aquote['c_rate']; } // Consignment Rate insertion end // Consignment charge insertion start $sql = "SELECT c_ccharge FROM cl_rates WHERE c_zone_id = '$zone_id'"; $qResult = tep_db_query($sql); while ($rec = tep_db_fetch_array($qResult)) {$retArr[] = $rec;} foreach($retArr as $aquote){ $ccharge = $aquote['c_ccharge']; } // Consignment charge insertion end //calculate the freight charge taking in the min consignment charge $tmp_charge = (($cost * $shipping_weight + $ccharge) * MODULE_SHIPPING_CLZIPZONES_FUEL); if ($tmp_charge <= $ccharge) { $freight_charge = $ccharge; } else { $freight_charge = $tmp_charge;} $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_CLZIPZONES_TEXT_TITLE, 'methods' => array(array('id' => $this_code, 'title' => MODULE_SHIPPING_CLZIPZONES_TEXT_DESCRIPTION, 'cost' => $freight_charge + MODULE_SHIPPING_CLZIPZONES_HANDLING))); if ($this->tax_class > 0) { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_CLZIPZONES_INVALID_ZONE; 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_CLZIPZONES_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 UK City Link delivery', 'MODULE_SHIPPING_CLZIPZONES_STATUS', 'True', 'Offer UK carrier shipping by Postcode?', '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 ('Handling Fee', 'MODULE_SHIPPING_CLZIPZONES_HANDLING', '0', '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, date_added) values ('Fuel Levey', 'MODULE_SHIPPING_CLZIPZONES_FUEL', '0', 'Fuel Levey', '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 ('Tax Class', 'MODULE_SHIPPING_CLZIPZONES_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', 'MODULE_SHIPPING_CLZIPZONES_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); } function remove() { $keys = ''; $keys_array = $this->keys(); for ($i=0; $i<sizeof($keys_array); $i++) { $keys .= "'" . $keys_array[$i] . "',"; } $keys = substr($keys, 0, -1); tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")"); } function keys() { $keys = array( 'MODULE_SHIPPING_CLZIPZONES_STATUS', 'MODULE_SHIPPING_CLZIPZONES_HANDLING', 'MODULE_SHIPPING_CLZIPZONES_FUEL', 'MODULE_SHIPPING_CLZIPZONES_TAX_CLASS', 'MODULE_SHIPPING_CLZIPZONES_SORT_ORDER' ); return $keys; } } ?>
  2. Hi All, Need a some help here, I have been looking at this shipping module (needed for a UK shop). Toll Ipec Shipping by postcode and it fits the bill for whats needed, one draw back though, I am not able to get it working, I created the toll_rates and Toll_zone files for the UK. any one got a UK version. I have seen the other uk postcode courier contribs but the shop owner wants this one, easier to change the rates sql. All its doing at the moment its giving a shipping total but its always the same. regards Andy
  3. volumax

    HSBC secure-epayment module

    Hi Kev, One way is to have a look at this on page 18 by Neil Westlake, (it may start earlier but cant remember), its been that long. http://forums.oscommerce.com/index.php?sho...c=76967&st=340# I used the same code and some alterations to the following /catalog/checkout_process.php /catalog/includes/modules/payment/hsbc.php /catalog/includes/functions/general.php regards Andy
  4. Hi all, An update to our problem, If a category has or has had a product in the Specials category ALL other products that ARE NOT on Special offer in that category do not have the discount applied, even when the item has been removed from the specials section. Any ideas anyone, some one did post something to do with specials but cannot find it now. Thanks Andy
  5. Hi all, I need urgent help on this, we have a problem with percentage disount coupons. I am running an altered 5.10b version of CCGV with the fix for double discount added, every thing was working great until today, when a custome tried to apply his 20% discount. The value of the discount should be ?14.60 +- 1penny and the total for the order should be ?61.39, but as you can see below its completely wrong, does anyone have a fix for this, as I have not found one yet looking through these pages. But we do not seem to have this problem when we send a ?5, ?10..... voucher to anyone? Here is what he saw:-
  6. Hi all, I need urgent help on this. I am running an altered 5.10b version of CCGV with the fix for double discount added, every thing was working great until today, when a custome tried to apply his 20% discount. The value of the discount should be ?14.60 +- 1penny and the total for the order should be ?61.39, but as you can see below its completely wrong, does anyone have a fix for this, as I have not found one yet looking through these pages. But we do not seem to have this problem when we send a ?5, ?10..... voucher to anyone? Here is what he saw:- Here is how i Have got module sort order set and discount coupon settings are Yhank in advance Andy
  7. volumax

    HSBC secure-epayment module

    Hi Neil, Vger The way that the module is written (if i have read correctly) passes 3 ISO codes, 1. Currency ISO 826 UK, with 2 and 3 the Billing and Shipping ISO codes USA customer 840. We cannot fix 2 and 3 to 826 as this would cause AVS failures on the rest of the address detail passed to HSBC. I can find my way arround php ok but this part of the code is throwing me a little:- //Currency code setup $currency_code = $currency; if (!in_array($currency_code, array('EUR', 'GBP', 'HKD', 'JPY', 'USD'))) { $currency_code = 'USD'; <<<<<<< } $curr=array('EUR'=>978,'HKD'=>344,'JPY'=>392,'GBP'=>826,'USD'=>840); $currency_code=$curr[$currency_code]; Does the line marked with force USD being sent for the currency if the IF stament tests true or is not working properly? If so this would explain a note I made while talking to hsbc that made no sense at the time, this was that even though the module was displaying GBP to me in the hidden fields as the currency thay said it was saying that it was trying to take payment USD, I thought they had assumed that one of the 840's was the currency code not shipping/billing ISO We only have GBP defined in the shops admin and we only ever take payment in GBP. All the best Andy
  8. volumax

    HSBC secure-epayment module

    Hi All, Has anyone heard of anyone getting this problem and if so how it was fixed? A customer in the UK creates an account and buys and pays for their order using HSBC Module (V2) NO PROBLEM. But, 2 customers 1 in USA and 1 in Spain do exactly the same thing, but HSBC reports Invalid input error so the sales remain in customer basket. HSBC Says that the HASH generated by our store for these 2 clients does not match the HASH generated by them??????? and that we have an error in the Module somewhere. I have checked the output of the module and everything is as HSBC dictates in their CPI Manual Specs. ISO country code are being passed OK and UK Currency ISO remains fixed at 826 and all field lengths are within 25 character limit. Surley if a UK client can place and pay for an order with no error, logic dictates that everyone can. This simple conclusion was beyond the HSBC e-payments experts comprehension at the technical support center, as they constantly blamed the payment module in oscommerce. I asked for the contents of the log to see what was allegedly the error, but never got it, I spent almost an hour trying to work this out with them but the language accent barrier proved to be the down fall, (yes all i could get thru to was the overseas service desk I was not able to talk to anyone in the UK despite trying). At the moment we are having to ask anyone who has this problem to let us know and we will take payment over the phone, (not very professional is it!). I throw this one open to all for any ideas on a solution. All the best to all Andrew
  9. volumax

    HSBC secure-epayment module

    Hi All, Strange things started happening, store and HSBC module running great for last 2 months, but yesterday something happened that was totally out of the blue. We had 2 clients create account and place items in their carts but they were unable to goto HSBC to input their card details. The only difference was they were from the USA so as you would expect the country iso codes changed to 840 as well as their states and postcodes. So I tried my test account put the same items as one client in my basket went to checkout (I had changed the hidden fields to input fields so i could see what was being generated. No problems at all, :) so I thought lets change the address details left every thing alone except for country and state, which is switched to USA and Arkansas and confirmed order and lo promptly dumped back to site with 'error invalid input data' :angry:. YET all was idetical except for country of origin. 840 not 826 and Arkansas not east yorkshire. :huh: Any ideas on this problem anyone? TIA Andy
  10. Hi all, Please disregard last post, realised we are doing the same thing but reversed, it's what you get when installing a contrib while you have a stinking headache :( Real: question now :) we have already created our geo zones, UK/EU and Rest of the world. created the sql table for 3 zone and 1 table per zone, UK, EU and Rest of the World. just noticed that our geo zone for rest of the world is also appearing in the selections boxes even though it is not preceeded by SHP: what code needs to be altered to stop this happening, if I don't correct it it will just confuse my boss when he decide to furtle with the admin without letting me know ;( Thanks Andy
  11. Hi All, Can someone let me know if it would be possible to change the logic behind the table rates, at the moment according to the instructions prices for the shipping as this We would prefer it to work as less than or equal to instead of greater than or equal to, this way we do not have to define a lower limit to the price, weight or package. At the moment we have the following in a table flat rate Thanks in advance Andy
  12. volumax

    HSBC secure-epayment module

    Hi Martin, Here are two possible explanations a while back an error was found in /catalog/admin/orders.php file which was a 'status' problem here's the link to the fix:- The second may be linked to the order number, if you are using a custom order number and have changed the data type for the order_id from an int(11) to varchar(64) for example, you have to change all occurences of (int)$order_id, (int)$Oid etc to $order_id, $oid etc in all files in the admin and catalog folders. If not order can seem to disappear because the files in admin or catalog will be trying to display or find a whole number (int) for the order number when it was changed to varchar(64) letters and numbers in the example above. Hope this is of help Andy
  13. Hi Simon, Thanks for the fast reply, will give what suggested a try on a backup duplicate of the store later tonite. Thanks again, andy
  14. Hi All, HHHeeelllpp!!! :( I am encountering a problem trying to allow customers to buy a gift voucher, everything is ok until we reach checkout_confirmation.php at this point i would assume that all relevant information is ready to pass to my payment module as it normally does for regular purchases. If it were a regular product purchase we have no problems the site transfers to HSBC and purchase complete. but if the product is either mixed or gift voucher only HSBC rejects the attempted transaction with the error 'Invalid Input received' and we are returned to checkout_payment.php So the error must be with ccgv code as there is no problems when gift vouchers are disabled. Can anyone provide any suggestions? All the best Andy
  15. volumax

    Fancier Invoice & Packingslip v1.0

    Hi All Has anyone been able to rectify the problem of the languge file contents not showing on the emailed invoices, on mine it only displays like INVOICE_TEXT_NO_COMMENT any ideas? Also where do i on the invoices remove 05- bit after invoice number, as we use random order id's generated with date we don't need it. its the only things stopping me sending this live. Thanks in advance Andy
×