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