Function __global->get_tax_using_tax_codes

Definitions

sources/ecommerce_tax.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.
$field_name_prefix string No No Blank (empty string) N/A N/A Field name prefix. Pass as blank for cart items or 'p_' for order items.
$shipping_cost REAL No No 0 N/A N/A The shipping cost
$member_id ?MEMBER No No Null N/A N/A The member this is for (null: current member)

Returns

  • A tuple: The shipping tax derivation, shipping tax due (including shipping tax), shipping tax tracking ID
  • 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  string $field_name_prefix Field name prefix. Pass as blank for cart items or 'p_' for order items.
 * @param  REAL $shipping_cost The shipping cost
 * @param  ?MEMBER $member_id The member this is for (null: current member)
 * @return array A tuple: The shipping tax derivation, shipping tax due (including shipping tax), shipping tax tracking ID
 */

function get_tax_using_tax_codes(array &$item_details, string $field_name_prefix = '', float $shipping_cost = 0, ?int $member_id = null) : array