Advanced Guides

Overriding Components

Most of Conduit's components are designed to be easily overridden. This means that you can create your own styling and functionality without having to modify the core package files. This is especially useful when you want to maintain the core package and still have the ability to customize the look and feel of your application.

Overriding the Cart

You will need to create a new Cart blade file in /resources/views/components/conduit/cart.blade.php.

You will have access to the the following variables:

  • $cart = an instance of a Cart, that are not Subscriptions, i.e. one-time purchases and not recurring.
  • $items = a Collection of all the Cart Items, with references to the associated Product and Price.
  • $total = the total amount of the Cart.
  • $subtotal = the subtotal amount of the Cart, before taxes and shipping.
  • $tax = the tax amount of the Cart, if any.
  • $shipping = the total amount of the shipping for the Cart, if any.
  • $paymentProvider = which payment provider is being used for the Cart, i.e. Stripe or Paddle.

Overriding the Product Card

You will need to create a new Cart blade file in /resources/views/components/conduit/product-card.blade.php.

You will have access to the $product variable, which contains all the Product details, including all of it's Prices.

Overriding the Product Listing

You will need to create a new Cart blade file in /resources/views/components/conduit/products.blade.php.

You will have access to the $products Collection variable, which has all the Products that are not Subscriptions, i.e. one-time purchases and not recurring.

Overriding the Subscription Prices Listing

You will need to create a new Cart blade file in /resources/views/components/conduit/subscription-prices.blade.php.

You will have access to the $prices nested array variable, which has all the recurring Prices that are grouped by their recurring type, i.e. monthly, yearly, etc.

Code highlighting provided by Torchlight