Function __global->derive_cart_amounts

Definitions

sources/shopping.php

  • Find costings for items in the cart / an order.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$shopping_cart_rows array No No required parameter N/A N/A List of cart/order items
$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.

Returns

  • A tuple: total price, total tax derivation, total tax, total tax tracking ID, total shipping cost, total shipping tax, total shipping weight, total shipping length, total shipping width, total shipping height
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Find costings for items in the cart / an order.
 *
 * @param  array $shopping_cart_rows List of cart/order items
 * @param  string $field_name_prefix Field name prefix. Pass as blank for cart items or 'p_' for order items.
 * @return array A tuple: total price, total tax derivation, total tax, total tax tracking ID, total shipping cost, total shipping tax, total shipping weight, total shipping length, total shipping width, total shipping height
 */

function derive_cart_amounts(array $shopping_cart_rows, string $field_name_prefix = '') : array