perch_shop_cart()

Display the shopping cart with the perch_shop_cart() function.

Requires

Parameters

Type Description
Array Options array, see table below
Boolean Set to true to have the value returned instead of echoed.

Options array

Name Value
template The name of a template to use to display the content.
skip-template True or false. Bypass template processing and return the content in an associative array.
return-html True or false. For use with skip-template. Adds the HTML onto the end of the returned array with key html.
raw True or false. Returns unprocessed content, for use alongside skip-template.

Usage examples

Display the cart with the default template shop/cart/cart.html.

perch_shop_cart();

This function accepts an array of options to control what is returned. It can be used as follows.

perch_shop_cart([
    'template' => 'my-template.html'
]);