Dot All Lisbon – the official Craft CMS conference – is happening September 23 - 25.

Template Hooks

Commerce adds its own template hooks in addition to Craft’s. Some hooks are not suitable for injecting HTML, but can still be used to modify data available to the rest of the template.

Discounts

cp.commerce.discount.edit
After discount detail view’s “Enabled” field. store-management/discounts/_edit.twig
cp.commerce.discounts.edit.content
After discount detail view’s main content. store-management/discounts/_edit.twig
cp.commerce.discounts.edit.details
After discount detail view’s existing right sidebar details column. store-management/discounts/_edit.twig
cp.commerce.discounts.edit
Before discount detail view’s template blocks. HTML not allowed. store-management/discounts/_edit.twig
cp.commerce.discounts.index
After discounts index view’s main content. store-management/discounts/index.twig

Orders

cp.commerce.order.edit
Before order edit view’s template blocks. HTML not allowed. orders/_edit.twig
cp.commerce.order.edit.details
After existing order edit view’s right sidebar details. orders/_edit.twig
cp.commerce.order.edit.main-pane
After existing content within order edit view’s “Order Details” tab. orders/_edit.twig
cp.commerce.order.edit.order-actions
Inject additional controls just before the primary order form actions in the page toolbar. orders/_edit.twig
cp.commerce.order.edit.order-secondary-actions
Inject additional controls just before the secondary order form actions in the page toolbar. orders/_edit.twig

Sales

Note that sales are a legacy feature and may not be available to all Commerce users.

cp.commerce.sales.edit.content
After sale detail view’s main content. promotions/sales/_edit.twig
cp.commerce.sales.edit.details
After sale detail view’s existing right sidebar details column. promotions/sales/_edit.twig
cp.commerce.sales.edit
Before sale detail view’s template blocks. HTML not allowed. promotions/sales/_edit.twig
cp.commerce.sales.index
After sales index view’s main content. promotions/sales/index.twig

Subscriptions

cp.commerce.subscriptions.edit.content
After the last .pane in subscription detail view’s content block. subscriptions/_edit.twig
cp.commerce.subscriptions.edit.meta
After the right sidebar details on subscription elements’ edit screen. subscriptions/_edit.twig

Inventory + Locations

cp.commerce.inventory.index
After the table containing inventory levels for a specific inventory location. inventory/levels/_index.twig
cp.commerce.inventoryLocation.edit
After address fields in the inventory location edit screen. inventory-locations/_edit.twig

Pricing Catalog

cp.commerce.catalogPricingRules.index
After the table containing a store’s pricing rules. store-management/pricing-rules/index.twig
cp.commerce.catalogPricingRules.edit.content
After the tabbed pricing rule configuration UI. Content injected here will always be visible, regardless of the selected tab. store-management/pricing-rules/_edit.twig

Shipping

cp.commerce.shippingMethods.edit.content
After the shipping rule form. store-management/shipping/shipping-methods/_edit.twig