Function Hook_ecommerce_tax_core->get_tax_using_tax_codes

Definitions

sources/hooks/systems/ecommerce_tax/core.php

  • Find the tax for a number of items being sold together.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
&$item_details array Yes No required parameter N/A N/A A list of pairs: shopping-cart/order style row (with at least 'quantity'), product details (with at least 'tax_code' and 'price'). This is returned by reference as a list of tuples, (tax, tax_derivation, tax_tracking) gets appended.
$products array No No required parameter N/A N/A The products to process with this tax service
$field_name_prefix string No No required parameter N/A N/A Field name prefix
$shipping_cost REAL No No required parameter N/A N/A The shipping cost
$member_id MEMBER No No required parameter N/A N/A The member this is for
$street_address SHORT_TEXT No No required parameter N/A N/A The street address of the member
$city ID_TEXT No No required parameter N/A N/A The city of the member
$state ID_TEXT No No required parameter N/A N/A The state of the member
$country ID_TEXT No No required parameter N/A N/A The country code of the member
$post_code ID_TEXT No No required parameter N/A N/A The postal code of the member

Returns

  • A tuple: The shipping tax derivation (null is do not change), shipping tax due (including shipping tax) (null means do not change), shipping tax tracking ID (null means do not change), and any items that should instead be processed as free items (null: this tax service does not support the items or address requested)
  • Type: ?array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find the tax for a number of items being sold together.
 *
 * @param  array $item_details A list of pairs: shopping-cart/order style row (with at least 'quantity'), product details (with at least 'tax_code' and 'price'). This is returned by reference as a list of tuples, (tax, tax_derivation, tax_tracking) gets appended.
 * @param  array $products The products to process with this tax service
 * @param  string $field_name_prefix Field name prefix
 * @param  REAL $shipping_cost The shipping cost
 * @param  MEMBER $member_id The member this is for
 * @param  SHORT_TEXT $street_address The street address of the member
 * @param  ID_TEXT $city The city of the member
 * @param  ID_TEXT $state The state of the member
 * @param  ID_TEXT $country The country code of the member
 * @param  ID_TEXT $post_code The postal code of the member
 * @return ?array A tuple: The shipping tax derivation (null is do not change), shipping tax due (including shipping tax) (null means do not change), shipping tax tracking ID (null means do not change), and any items that should instead be processed as free items (null: this tax service does not support the items or address requested)
 */

public function get_tax_using_tax_codes(array &$item_details, array $products, string $field_name_prefix, float $shipping_cost, int $member_id, string $street_address, string $city, string $state, string $country, string $post_code) : ?array