Skip to content

Latest commit

 

History

History
94 lines (76 loc) · 4.75 KB

RESOURCES.md

File metadata and controls

94 lines (76 loc) · 4.75 KB

WooCommerce Resources Library

Notes

WooCommerce Customization

Do not edit Woo Pages directly (to avoid deleting Woo shortcodes), use hooks instead.

  • If I see do_action() it means that I can run my custom function there, in that specific postition, WITHOUT a need of overriding a WooCommerce template.
  • Full list of shortcodes available in includes/class-wc-shortcodes.php file.
  • I can include full product page on my custom page with a shortcode [product_page id="1"].
  • If WP/Woo privdes me with a hook do_action() it means that I can run a custom function then/there.
do_action( 'hook_name', 'function_name', 10, 1 );
  • The code above goes into the functions.php flile of the child theme.
  • It has the same name as per do_action().
  • Priority = 10 by default, if omitted.
  • Aarguments = 1 by default, if omitted.
function function_name() { }
  • Hooked function (name as per add_action()).

  • $arguments as per do_action().

  • Wordpress Filter Hooks allow me to edit / filter content just before it is given back to WordPress.

  • If WP/Woo provides me with a apply_filters( 'hook_name' ) I can edit that content before it is processed.

  • ... add more content here ...

  • Add content child theme related from my screenshots.

  • check and validate child theme styles with a different name/folder

  • CSS

  • cascading - explain which one will win and why

  • explain css syntax for novice users

  • add inspecting explaination

  • CSS hierarchy, add precision in location (why one should never use 1 & 2)

  • explain woocommerce CSS structure

  • WooCommerce CSS Structure

Examples

do_action( 'save_post_product', 'my_custom_function' );

function my_custom_function() {
  // do something when a product (post) is saved
}
do_action( 'woocommerce_before_cart', 'my_above_cart_banner_function' );

function my_above_cart_banner_function() {
  // do something before the Cart table
}

Resources

Useful resources:

Other resources:

Explore later

Useful plugins