Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to apply taxes with Extraship?


Guest

Recommended Posts

  • 2 weeks later...
Hi!

 

I want to apply a tax at the shipping cost, but I don't know how to do that with the "Extraship" contribution. Someone can help me?

 

Thanks!  :thumbsup:

 

 

The Extraship contrib isw not set up to have tax added to it. I came across the same problem with TNT Express contrib.

 

Basically you need to add a field to the configuration table to chose the tax id. And then add references to shipping module to write the correct information.

 

Add line to configuration table by going into phpmyadmin and chosing the configuration table and chosing the insert tab.

 

enter into the following fields:

 

configuration_id : leave blank this will autofill

configuration_title : Tax Class

configuration_key : MODULE_SHIPPING_EXTRASHIP_TAX_CLASS

configuration_value : 1

configuration_description : Use the following tax class on the shipping fee.

configuration_group_id : 6

sort_order : 0

last_modified :

date_added :

use_function : tep_get_tax_class_title

set_function : tep_cfg_pull_down_tax_classes(

 

 

now you just have to call that tax class in the module itself.

 

in:
   function extraship() {

add:

     $this->tax_class = MODULE_SHIPPING_EXTRASHIP_TAX_CLASS;    
     


in:
   function install() {

add:    
     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_EXTRASHIP_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())");


in:
   function keys() {

add:
'MODULE_SHIPPING_EXTRASHIP_TAX_CLASS',

 

 

 

Now go into admin and set the tax rate and do a test order.

 

**** I haven't tested this with the extra ship module however this is how I inserted it into the TNT Express Shipping Module and it works perfectly.

 

 

 

Hope this works for you.

Scott

Link to comment
Share on other sites

  • 1 month later...

hello

 

i need to set an addidional tax to the TNT shipping method (IVA). i use the class from the "contributions" section. i've added the whole code to my tntexpress.php, excepting the part in the function "extraship()" (i cant find such a function).

 

however, he still does not add the "IVA" to the order total, if the tnt shipping module is activated :(

 

maybe someone can help me, i'm running out of ideas :(

 

by the way, here's my tntexpress.php:

<?php
/*
tntexpress.php - v.1.1 07/09/2003

Realizzato da: Massimiliano Pepe
			http://www.southmodel.it

Modificando il flat.php di
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

Rilasciata sotto GNU General Public License
*/

 class tntexpress {
var $code, $title, $description, $icon, $enabled;

// class constructor
function tntexpress() {
  $this->code = 'tntexpress';
  $this->title = MODULE_SHIPPING_TNT_TEXT_TITLE;
  $this->description = MODULE_SHIPPING_TNT_TEXT_DESCRIPTION;
  $this->icon = '';
  $this->enabled = MODULE_SHIPPING_TNT_STATUS;
}

// class methods
function quote($method = '') {
  $this->quotes = array('id' => $this->code,
						'module' => MODULE_SHIPPING_TNT_TEXT_TITLE,
						'methods' => array(array('id' => $this->code,
												 'title' => MODULE_SHIPPING_TNT_TEXT_WAY,
												 'cost' => SHIPPING_HANDLING + MODULE_SHIPPING_TNT_COST)));

  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_TNT_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, date_added) values ('Activate TNT', 'MODULE_SHIPPING_TNT_STATUS', '1', 'Use TNT Express shipping method?', '6', '5', now())");
  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Cost of TNT', 'MODULE_SHIPPING_TNT_COST', '20.00', 'Cost?', '6', '6', 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_EXTRASHIP_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())");
}

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() {	
  return array('MODULE_SHIPPING_TNT_STATUS', 'MODULE_SHIPPING_TNT_COST','MODULE_SHIPPING_EXTRASHIP_TAX_CLASS');
}
 }
?>

Edited by xeron
Link to comment
Share on other sites

i figured out, that the tax i want to add, should already be included in the total sum. there is an option "Use the following tax class on the shipping fee." in the module configuration, and i've selected "IVA".

however he still wont add the IVA to the whole sum.

 

Sub-Totale: 15,60€

Corriere TNT (Tempo consegna 24 ore (48 ore per localita' minori)): 12,00€

IVA 20%: 2,60€

Totale: 27,60€

Link to comment
Share on other sites

i figured out, that the tax i want to add, should already be included in the total sum. there is an option "Use the following tax class on the shipping fee." in the module configuration, and i've selected "IVA".

however he still wont add the IVA to the whole sum.

 

 

excepting the part in the function "extraship()" (i cant find such a function).

 

In this module you will need to add:

 

$this->tax_class = MODULE_SHIPPING_EXTRASHIP_TAX_CLASS;

 

to:

 

function tntexpress() {

 

 

although I would rename all of the EXTRASHIP references (including in the DB) to something like:

 

MODULE_SHIPPING_TNT_TAX_CLASS

 

just to retain a bit of conformity to the rest of the code, and also incase you ever want to install the ExtraShip module.

 

Scott

Edited by c_scott666
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...