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.
cp.commerce.discounts.edit.content
After discount detail view’s main content.
cp.commerce.discounts.edit.details
After discount detail view’s existing right sidebar details column.
cp.commerce.discounts.edit
Before discount detail view’s template blocks. HTML not allowed.
cp.commerce.discounts.index
After discounts index view’s main content.
# Orders
cp.commerce.order.edit
Before order edit view’s template blocks. HTML not allowed.
cp.commerce.order.edit.details
After existing order edit view’s right sidebar details.
cp.commerce.order.edit.main-pane
After existing content within order edit view’s “Order Details” tab.
cp.commerce.order.edit.order-actions
Inject additional controls just before the primary order form actions in the page toolbar.
cp.commerce.order.edit.order-secondary-actions
Inject additional controls just before the secondary order form actions in the page toolbar.
# 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.
cp.commerce.sales.edit.details
After sale detail view’s existing right sidebar details column.
cp.commerce.sales.edit
Before sale detail view’s template blocks. HTML not allowed.
cp.commerce.sales.index
After sales index view’s main content.
# Subscriptions
cp.commerce.subscriptions.edit.content
After the last
.pane
in subscription detail view’s content block.cp.commerce.subscriptions.edit.meta
After the right sidebar details on subscription elements’ edit screen.
# Inventory + Locations
cp.commerce.inventory.index
After the table containing inventory levels for a specific inventory location.
cp.commerce.inventoryLocation.edit
After address fields in the inventory location edit screen.
# Pricing Catalog
cp.commerce.catalogPricingRules.index
After the table containing a store’s pricing rules.
store-management/pricing-rules/index.twig (opens new window)
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 (opens new window)
# Shipping
cp.commerce.shippingMethods.edit.content
After the shipping rule form.
store-management/shipping/shipping-methods/_edit.twig (opens new window)