Jump to content

bastille

Members
  • Content count

    27
  • Joined

  • Last visited

Profile Information

  • Real Name
    webmaster
  1. anyone? :'( // Begin Free Gift Modification $freegift_query = tep_db_query("SELECT products_description.products_name, products.products_model FROM products_description Inner Join products ON products.products_id = products_description.products_id WHERE products.products_id = '" . $cart->get_freegift() . "'"); $freegift = tep_db_fetch_array($freegift_query); if ($cart->get_freegift() != 0) { $sql_data_array = array('orders_id' => $insert_id, 'products_id' => $cart->get_freegift(), 'products_model' => $freegift['products_model'], 'products_name' => $freegift['products_name']); //my mod INSERT INTO `orders_products` ( `orders_products_id` , `orders_id` , `products_id` , `products_model` , `products_name` , `products_price` , `final_price` , `products_tax` , `products_quantity` ) VALUES ( '', $insert_id, $cart->get_freegift(), NULL , $freegift['products_name'], '0.0000', '0.0000', '0.0000', '1'); // end my mod } else { $sql_data_array = array('orders_id' => $insert_id, 'products_id' => $cart->get_freegift(), 'products_model' => 'NA', 'products_name' => 'No Free Gift'); } tep_db_perform('orders_freegift', $sql_data_array); // End Free Gift Modification I have added this part will that work??
  2. in a pinch i could just auto insert a specific item into the order on check out process, since it the item is free and doesn't effect ship weight, but i guess I don't know how to create a simple insertion that would be something like :: insert into orders_products and would include the order number of the the order being processed, if that makes any sense....
  3. hi, I have installed this contribution: http://addons.oscommerce.com/info/5352 which adds a choice of a free gift from a drop down box in shopping cart. It works well and is easy to install BUT when checking out, it add the free item info to a seprate table, orders_freegift... I would like to add the free gift to the actual orders_products table so that it appears as a line item in the order. Any Idea how I might do this? This, I assume, is the code that adds the info to orders_freegift: // Begin Free Gift Modification $freegift_query = tep_db_query("SELECT products_description.products_name, products.products_model FROM products_description Inner Join products ON products.products_id = products_description.products_id WHERE products.products_id = '" . $cart->get_freegift() . "'"); $freegift = tep_db_fetch_array($freegift_query); if ($cart->get_freegift() != 0) { $sql_data_array = array('orders_id' => $insert_id, 'products_id' => $cart->get_freegift(), 'products_model' => $freegift['products_model'], 'products_name' => $freegift['products_name']); } else { $sql_data_array = array('orders_id' => $insert_id, 'products_id' => $cart->get_freegift(), 'products_model' => 'NA', 'products_name' => 'No Free Gift'); } tep_db_perform('orders_freegift', $sql_data_array); // End Free Gift Modification But i am at a loss how to insert the same info into the orders_products. Any help would be greatly appreciated, thank you.
  4. hello With the help of some very kind oscommerce posters I have been able to put together a modfication that will charge a special tax rate based on New York Zip codes (in New York different counties charge different tax rates, yes its a nightmare!) It works for taxable goods but not for shipping. And yes I did make the shipping a taxable item. What the mod does is add a county supplmental tax on top of the state rate (ny is 4.00 and the avereage county levy is 4.25 of so). It does it for goods but won't add the county levy. I'm stumped. Any ideas?? Here is the tax mod..... //// // Returns the tax rate for a zone / class // TABLES: tax_rates, zones_to_geo_zones function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1, $tax_zip_code ="") { global $customer_zone_id, $customer_country_id; if ( ($country_id == -1) && ($zone_id == -1) ) { if (!tep_session_is_registered('customer_id')) { $country_id = STORE_COUNTRY; $zone_id = STORE_ZONE; } else { $country_id = $customer_country_id; $zone_id = $customer_zone_id; } } $county_taxquery = tep_db_query("select zip_tax_rate from " . TABLE_ZIPTAX . " where zip_code = '" . $tax_zip_code . "'"); if (tep_db_num_rows($county_taxquery)) { $county_tax_query = tep_db_fetch_array($county_taxquery); $county_taxrate = $county_tax_query['zip_tax_rate']; } else { $county_taxrate = ""; } $tax_query = tep_db_query("select sum(tax_rate) as tax_rate from " . TABLE_TAX_RATES . " tr left join " . TABLE_ZONES_TO_GEO_ZONES . " za on (tr.tax_zone_id = za.geo_zone_id) left join " . TABLE_GEO_ZONES . " tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '" . (int)$country_id . "') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '" . (int)$zone_id . "') and tr.tax_class_id = '" . (int)$class_id . "' group by tr.tax_priority"); if (tep_db_num_rows($tax_query)) { $tax_multiplier = 0.0; while ($tax = tep_db_fetch_array($tax_query)) { $tax_multiplier += $tax['tax_rate']; } if ($county_taxrate != "") { $tax_multiplier += $county_taxrate; } return $tax_multiplier; } else { return 0; } } //// any ideas :'(
  5. bastille

    Zip based taxes Myql Query help?

    Hello with the help of some very kind OScommerce posters I have been putting something together as still have a couple of problems as soon as they are fixed I will post here or as a contribution. For now, I just have the counties as states (awkward but it works :) )
  6. bastille

    NY State Sales Tax- Help Please!

    The quote is from the state of ny. not me :) So for example, you have an item 90.00, and its 10.00 to ship total= 100. That amount is taxed not the 90.00
  7. bastille

    NY State Sales Tax- Help Please!

    I have checked this over with an accountant and she assures me that if you have a business presence in New York state, you must charge tax on shipping to New York state shipping addresses in addition to collecting tax for the county it is shipped to. So if the base ny tax is 4.25, and you ship to say, albany county, you must add the additional 4.0 cty levy to the subtotal PLUS shipping http://nystax.custhelp.com/cgi-bin/nystax....wYWdlPTE*&p_li= If you charge your customer for shipping or delivery on the sale of tangible personal property or tangible personal property on which a taxable service has been performed, the amount on which the sales tax is to be computed includes your charges for shipping or delivery. However, if the customer arranges delivery by a third person and pays this person directly, the third person?s delivery charge is not taxable http://nystax.custhelp.com/cgi-bin/nystax....hZ2U9MQ**&p_li=
  8. bastille

    NY State Sales Tax- Help Please!

    Same nightmare here! on top of that NY charges for shipping where other states don't (my store requires charing for NJ as well) I have spent hours on, tried several contribs, nothing has worked thus far. Temporarily i am putting in the state as counties :: NY_ALBANY, NY_ALLEGHANY, etc, but its not an optimal long term solution.
  9. bastille

    LinksPointCentral Problem

    in linkpoint make sure you have the check box for 'page is a cgi set up and the return page should be 'checkout_process.php':
  10. bastille

    Zip based taxes Myql Query help?

    I tried switching it to that query method an still getting that error :'( $tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id, ab.entry_postcode from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . (int)$customer_id . "' and ab.address_book_id = '" . (int)($this->content_type == 'virtual' ? $billto :$sendto) . "'"); $tax_address = tep_db_fetch_array($tax_address_query); $ny_county_1 = array('10011', '36551', '36555', '36559'); $ny_county_2 = array('36561', '36562', '36564', '36567'); $ny_county_3 = array('36577', '36580', '36526', '36532'); $cust_zip_code = $tax_address['entry_postcode']; if (in_array( $cust_zip_code, $ny_county_1) && ($tax_address['entry_zone_id'] == '43')) { return 10.0000; } elseif (in_array( $cust_zip_code, $ny_county_2) && ($tax_address['entry_zone_id'] == '43')) { return 10.5000; } elseif (in_array( $cust_zip_code, $ny_county_3) && ($tax_address['entry_zone_id'] == '43')) { return 8.5200; } elseif (($zip_in_county == 'false') && ($address_query['entry_zone_id'] == '43')) { return 0; } elseif ( ($country_id == -1) && ($zone_id == -1) ) { if (!tep_session_is_registered('customer_id')) { $country_id = STORE_COUNTRY; $zone_id = STORE_ZONE; } else { $country_id = $customer_country_id; $zone_id = $customer_zone_id; } } Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in I assume this query isn't working because I put the zip code of the test user (10011) in it. I am baffled. I believe i have the tax address query correct- i copied out of orders....
  11. bastille

    Zip based taxes Myql Query help?

    hi, thanks for responding. yeah i do get that error if the zip isn't there, or if the state is not ny. my thinking runs along these lines : its easier to manage the zips and tax rates in a mysql table as opposed to hard coded since new york is forvere changing and raising taxes (several counties are set to increase in less than a month's time. it looks like your solution would definately work however - but i think the original contrib that i am modifiying goes off the customer's default zip (post) code as opposed to the shipping - which is what should be used to calc. taxes. but i can't seem to pin down what field that is...
  12. bastille

    Zip based taxes Myql Query help?

    ......so when i change the user's default address to NOT be ny, i get this message: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/www/***********/catalog/includes/functions/database.php on line 10 on this page: /catalog/checkout_confirmation.php? ....any ideas??
  13. bastille

    Zip based taxes Myql Query help?

    Ok i got this to work But its getting the zip informatoin from the customer's default address rather than the shipping address (which is what i need to calcualte tax) does anyone have any idea which field i would use in a query for that??
  14. Hi all I am trying to alter a modifcation so that it returns a tax rate based on zip code. (new york state has different rates based on counties) I have created a table, ziptax, and in it have a column with the zip and the corresponding tax rate. I want to modify this contribution that returns a hard -coded rate to return a rate based on matching the customer's zip with the table above.. thus, I modified the code to this:: but its coming up empty :( Any ideas?
  15. bastille

    The Final Hurdle: Linkpoint connect CC error

    Hi, have you gotten this resovled yet? I am having the same probelm with Linkpointconnect
×