https://docs.woocommerce.com/document/storefront-hooks-actions-filters/ https://docs.woocommerce.com/document/storefront-actions-example-adding-content-featured-product-title/?_ga=2.228976472.512620558.1559092445-1265476472.1558825874
Storefront Hooks: Actions and filters
Note: This is a Developer level doc. If you are unfamiliar with code/templates and resolving potential conflicts, select a for assistance. We are unable to provide support for customizations under our .
This document lists the Actions and Filters which are available within the Storefront theme.
For a full list of template actions which add the default content in Storefront, you can find a comprehensive list of these within the file/storefront/inc/storefront-template-hooks.php
inside the theme folder.
Examples ↑ Back to top
To get familiar with the Storefront hooks it might be good to have a look at some tutorials:Actions reference guide ↑ Back to top
All availableadd_action()
functions used on the Storefront theme are listed below. To add content before an existing action, you can adjust the ordering position by decreasing the actions priority numerically. To add content after and existing action, you would then increase the action priority.
You can read more about add_action()
and what parameters can be used on the WordPress Developer Resources site here.
General ↑ Back to top
storefront_before_site
– Executed after opening<body>
tagstorefront_before_content
– Executed before opening<div id="content">
tagstorefront_content_top
– Executed after opening<div id="content">
tag
Header ↑ Back to top
storefront_before_header
– Executed after<div id="page">
tagstorefront_header
– Executed inside<div class="col-full">
of the<header id="masthead">
tag
Homepage ↑ Back to top
storefront_homepage
– Executed inside<div class="col-full">
of the homepage content section
Product categories
storefront_homepage_before_product_categories
– Executed before the<section class="storefront-product-categories">
homepage sectionstorefront_homepage_after_product_categories_title`
– Executed after the<h2 class="section-title">
product categories section titlestorefront_homepage_after_product_categories
– Executed after the<section class="storefront-product-categories">
homepage section
Recent products
storefront_homepage_before_recent_products
– Executed before the<section class="storefront-recent-products">
homepage sectionstorefront_homepage_after_recent_products_title
– Executed after the<h2 class="section-title">
recent products section titlestorefront_homepage_after_recent_products
– Executed after the<section class="storefront-recent-products">
homepage section
Featured products
storefront_homepage_before_featured_products
– Executed before the<section class="storefront-featured-products">
homepage sectionstorefront_homepage_after_featured_products_title
– Executed after the<h2 class="section-title">
featured products section titlestorefront_homepage_after_featured_products
– Executed after the<section class="storefront-featured-products">
homepage section
Popular products
storefront_homepage_before_popular_products
– Executed before the<section class="storefront-popular-products">
homepage sectionstorefront_homepage_after_popular_products_title
– Executed after the<h2 class="section-title">
popular products section titlestorefront_homepage_after_popular_products
– Executed after the<section class="storefront-popular-products">
homepage section
On sale products
storefront_homepage_before_on_sale_products
– Executed before the<section class="storefront-on-sale-products">
homepage sectionstorefront_homepage_after_on_sale_products_title
– Executed after the<h2 class="section-title">
on-sale products section titlestorefront_homepage_after_on_sale_products
– Executed after the<section class="storefront-on-sale-products">
homepage section
Best-selling products
storefront_homepage_before_best_selling_products
– Executed before the<section class="storefront-best-selling-products">
homepage sectionstorefront_homepage_after_best_selling_products_title
– Executed after the<h2 class="section-title">
best-selling products section titlestorefront_homepage_after_best_selling_products
– Executed after the<section class="storefront-best-selling-products">
homepage section
Blog archive page ↑ Back to top
storefront_loop_before
– Executed before all posts on blog archivestorefront_loop_post
– Executed before each post on blog archivestorefront_post_content_before
– Executed before the content of each post on blog archivestorefront_post_content_after
– Executed after the content of each post on blog archive
General page ↑ Back to top
storefront_page_before
– Executed after the `<main id=”main”>` tag on single pagesstorefront_page
– Executed after the opening `<div id=”post-…”>` tag on single pagesstorefront_page_after
– Executed at the end of the `<div id=”post-…”>` tag on single pages
Single post ↑ Back to top
storefront_single_post_before
– Executed after the opening<main id="main">
tag on single blog postsstorefront_single_post_top
– Executed after the opening<div id="post-...">
tag on single postsstorefront_single_post
– Executed immediately afterstorefront_single_post_top
hook to show post contentstorefront_single_post_bottom
– Executed before the closing<div id="post-...">
tag on single postsstorefront_single_post_after
– Executed before the closing<main id="main">
tag on single blog posts
Sidebar ↑ Back to top
storefront_sidebar
– Executed on all pages containing a sidebar, provided widgets are present
Footer ↑ Back to top
storefront_before_footer
– Executed before<footer id="colophon">
tagstorefront_footer
– Executed before closing<footer id="colophon">
tagstorefront_after_footer
– Executed after closing<footer id="colophon">
tag
Filters reference guide ↑ Back to top
This document lists some of the most commonly used filters which are available within the Storefront theme. You can read more aboutadd_filter()
and what parameters can be used on the WordPress Developer Resources site here
Comments ↑ Back to top
File:comments.php
storefront_comment_form_args
– filter the comment reply title HTML before and after
Storefront template functions ↑ Back to top
File:/inc/storefront-template-functions.php
Navigation menu
storefront_menu_toggle_text
– filter the responsive menu toggle text
Homepage
Product categoriesstorefront_product_categories_args
– filter the homepage product category argumentsstorefront_product_categories_shortcode_args
– filter the homepage product category shortcode arguments
storefront_recent_products_args
– filter the homepage recent products argumentsstorefront_recent_products_shortcode_args
– filter the homepage recent products shortcode arguments
storefront_featured_products_args
– filter the homepage featured products arguments.storefront_featured_products_shortcode_args
– filter the homepage featured products shortcode arguments.
storefront_popular_products_args
– filter the homepage popular products arguments.storefront_popular_products_shortcode_args
– filter the homepage popular products shortcode arguments.
storefront_on_sale_products_args
– filter the homepage on sale products arguments.storefront_on_sale_products_shortcode_args
– filter the homepage on sale products shortcode arguments
storefront_best_selling_products_args
– filter the homepage best selling products argumentsstorefront_best_selling_products_shortcode_args
– filter the homepage best selling products shortcode arguments
Single post
storefront_single_post_posted_on_html
– filter the single posted on details
Footer
storefront_footer_widget_rows
– filter number of footer widget rows (default: 1)storefront_footer_widget_columns
– filter number of footer widget columns (default: 4)storefront_copyright_text
– filter the footer copyright textstorefront_credit_link
– filter the footer credit link
Storefront functions ↑ Back to top
File:/inc/storefront-functions.php
storefront_header_styles
– filter the header stylesstorefront_homepage_content_styles
– filter the homepage content styles
Storefront classes ↑ Back to top
File:/inc/class-storefront.php
storefront_custom_background_args
– filter the default background argumentsstorefront_default_background_color
– filter the default site background colorstorefront_sidebar_args
– filter the default sidebar argumentsstorefront_google_font_families
– filter default Google Font familiesstorefront_navigation_markup_template
– filter the output markup of the navigation.
WooCommerce template functions ↑ Back to top
File:/woocommerce/storefront-woocommerce-template-functions.php
storefront_upsells_columns
– filter the upsell columns (default: 3)storefront_loop_columns
– filter the default product loop display (default: 3)storefront_handheld_footer_bar_links
– filter handheld footer bar links
WooCommerce classes ↑ Back to top
File:/woocommerce/class-storefront-woocommerce.php
storefront_related_products_args
– filter related products argumentsstorefront_product_thumbnail_columns
– filter product thumbnail columns (default: 4)storefront_products_per_page
– filter products per page on product categories.
Additional resources ↑ Back to top
For additional resources on Storefront development, please refer to the following:- WordPress.org Codex – An introduction to hooks, filters and functions in WordPress
- Storefront Github Repository – The official code repository for all code
- Hookr.io Plugin – A plugin for easily finding a reference guide for all hooks & filters
</div>
<div class="related-docs docs-listing single"><h2>Relevant Links</h2><ul class="recommended-docs"><li><h4><a href="http://docs.woothemes.com/document/installing-a-woo-theme/">Installing Your Theme</a></h4></li><li><h4><a href="http://support.woothemes.com/entries/23060481-How-to-update-theme-to-new-version">How to Update Your Theme</a></h4></li><li><h4><a href="http://www.woothemes.com/theme-demo-content/">Download Theme Demo Content</a></h4></li><li><h4><a href="http://docs.woothemes.com/document/docs-theme-options/">Theme Options</a></h4></li><li><h4><a href="http://docs.woothemes.com/document/shortcodes/">Shortcodes</a></h4></li><li><h4><a href="http://docs.woothemes.com/document/docs-menus/">Menus</a></h4></li><li><h4><a href="http://docs.woothemes.com/document/adding-widgets/">Adding Widgets</a></h4></li><li><h4><a href="http://docs.woothemes.com/document/page-templates/">Page Templates</a></h4></li><li><h4><a href="http://docs.woothemes.com/document/features-plugin/">Features Plugin</a></h4></li><li><h4><a href="http://docs.woothemes.com/document/testimonials-plugin/">Testimonials Plugin</a></h4></li><li><h4><a href="http://docs.woothemes.com/document/featured-images/">Featured Images</a></h4></li><li><h4><a href="https://support.woothemes.com/hc/en-us/articles/203106397-How-to-remove-Designed-by-WooThemes-from-footer">Remove WooThemes Footer Credit</a></h4></li><li><h4><a href="https://support.woothemes.com/hc/en-us/articles/203105957-Customizing-your-theme-with-Firebug">Edit Theme CSS with Firebug</a></h4></li><li><h4><a href="http://woothemes.zendesk.com/entries/22521633-How-to-translate-a-theme-or-plugin">Translate your theme</a></h4></li><li><h4><a href="https://support.woothemes.com/hc/en-us/articles/202881643-Using-WooThemes-Support-Resources">Using WooThemes Support Resources</a></h4></li></ul></div>
Product Bunddles
https://docs.woocommerce.com/document/bundles/?_ga=2.57066222.512620558.1559092445-1265476472.1558825874
Product Bundles
Product Bundles allows you to group existing simple, variable, and subscription products — and sell them together.
Overview ↑ Back to top
The Bundle type is a powerful alternative to the Grouped Product type. With Product Bundles, you can:- Set a predetermined quantity range for each bundled product.
- Add variable products to bundles and enable only specific variations if needed.
- Bundle multiple instances of the same product.
- Boost your up-selling performance by offering kit versions of popular products paired with one or more related items.
- Offer bulk discounts.
If the Product Kit you are building consists of configurable components with multiple product options, consider using Composite Products.
Important: Product Bundles requires WooCommerce 3.1.0+.
Documentation Contents ↑ Back to top
Store Owner’s Guide
- Installation
- Getting Started
- Pricing
- Shipping
- Bundled Product Settings
- Layout
- Item Grouping
- Cart Editing
- Bundle-Sells
- Managing Inventory
- Examples
Use Cases
Customizations
Developer Resources
- Data Structures & Storage
- Functions Reference
- Filters Reference
- Actions Reference
- REST API Reference
FAQ & Feedback
Want to customize Product Bundles? Find a growing collection of plugins and snippets in Tips, Tricks & Snippets.
Troubleshooting & Support ↑ Back to top
Purchased Product Bundles and need assistance? If you’ve found an issue:- Ensure you have the latest versions of all extensions and themes. Go to WooCommerce > System Status to check for plugin updates and other important information that may require your attention.
- Rule out a plugin conflict: Turn off all plugins except WooCommerce and WooCommerce Product Bundles. If the issue is resolved, find the plugin that triggers it by re-activating plugins one by one.
- Rule out a theme conflict. Activate Storefront, or a default WordPress theme such as Twenty Fourteen and check if the issue still occurs. If it doesn’t, please contact your theme author(s).
- Read the most Frequently Asked Questions for possible solutions.
- Use the WooCommerce Self Service Guide.
Managing Subscriptions
https://docs.woocommerce.com/document/managing-woocommerce-com-subscriptions/?_ga=2.57664366.512620558.1559092445-1265476472.1558825874#i-have-not-used-the-woocommerce-helper-before