M
M
Muvka2018-08-13 15:33:22
WooCommerce
Muvka, 2018-08-13 15:33:22

Where can you see the markup?

As much as I love Wordpress, I hate Woocommerce just as much. People, tell me where can I see the markup that outputs, say, "woocommerce_before_shop_loop_item_title"? I need to change it a little and I don't understand how.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maksym Davydchuk, 2018-08-13
@maksym1991

There are several functions attached to this hook. For example:

/**
   * Hook: woocommerce_before_shop_loop_item_title.
   *
   * @hooked woocommerce_show_product_loop_sale_flash - 10
   * @hooked woocommerce_template_loop_product_thumbnail - 10
   */
  do_action( 'woocommerce_before_shop_loop_item_title' );

Search for these features with the global project search. For example woocommerce_show_product_loop_sale_flash is located in \wp-content\plugins\woocommerce\includes\wc-template-functions.php
if ( ! function_exists( 'woocommerce_show_product_loop_sale_flash' ) ) {

  /**
   * Get the sale flash for the loop.
   */
  function woocommerce_show_product_loop_sale_flash() {
    wc_get_template( 'loop/sale-flash.php' );
  }
}

Since the function is wrapped in if ( ! function_exists( 'function' ) ) {} you can override it in your theme

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question