cartOrderTransform

Use transform methods to return Cart and Order calculated values: count, subTotal, shipping, taxes, total. Use these methods on Cart and Orders in templates, {{cart.getCount}} and in code, Cart.findOne().getTotal(). These use Meteor Collection transforms.

Source:

Methods

(inner) getCount() → {Number}

Return the total quantity on the order

Source:
Example
{cart ? cart.getCount() : 0}
Returns:

Total quantity of items on the order

Type
Number

(inner) getDiscounts() → {Number}

Discount for cart/order.

Source:

Grabs discounts from the invoice records if they exist, otherwise from this.discounts

Example
const cartDiscounts = cart.getDiscounts();
Returns:

Total value of discounts

Type
Number

(inner) getShippingTotal() → {Number}

Return the total price of shipping/handling on the order

Source:
Returns:

Total price of shipping/handling on the order

Type
Number

(inner) getShippingTotalByShop() → {Object}

Get the total price of shipping, broken down by shop

Source:
Returns:
  • Total price of shipping, broken down by shop
Type
Object

(inner) getShopSummary() → {Object}

Create an object that contains a summary for each shop

Source:
Returns:

An object with a key for each shopId, and name + summary data for each

Type
Object

(inner) getSubTotal() → {Number}

Return the total price of goods on an order

Source:
Returns:

Total price of goods for the order

Type
Number

(inner) getSubtotalByShop() → {object}

Aggregates the subtotals by shopId

Source:
Returns:

Object with a key for each shopId in the cart/order where the value is the subtotal for that shop

Type
object

(inner) getTaxTotal() → {Number}

Total taxes for order

Source:
Returns:

Total price of taxes for an order

Type
Number

(inner) getTotal() → {Number}

Total for Order

Source:
Returns:

Total for order

Type
Number

(inner) getUniquePaymentMethods() → {object}

Return an array of payment methods for display removing duplicates

Source:
Returns:
  • An object containing the payment methods used on this order excluding duplicates
Type
object