Home > @vsf-enterprise/sapcc > cartGetters

cartGetters variable

Returns agnostic cart values.

Signature:

cartGetters: ExtendedCartGetters<Cart, OrderEntry>

Example

Example of usage:

<script>
import { onSSR } from '@vue-storefront/core';
import { useCart } from '@vsf-enterprise/sapcc';

export default {
  setup () {
   const { cart, load } = useCart();

   const items = cartGetters.getItems(cart.value); // returns items from cart
   const discounts = cartGetters.getDiscounts(cart.value); // returns agnostic discounts

    onSSR(async () => {
      await load();
    })

    return {
      items,
      discounts
    };
  }
}
</script>