douji9518 2016-09-14 08:50
浏览 65

工作和编辑Woocommerce Hooks来改变功能

I'm working with WooCommerce and I'm changing some functionalities in my home page.

My theme uses "Woocommerce Hooks" but I only see where calls the function. What I need is to find that function and change it.

In my case I saw that the code I want to change is in "/plugin/component/wc_product.php" and there I see this piece of code:

<ul class="products">
    <?php while ( $products->have_posts() ) : $products->the_post(); ?>
        <?php if( "default" == $tpvc_wc_product_style ) : ?>
            <?php wc_get_template_part( 'content-product' ); ?>
        <?php else : ?>
            <?php wc_get_template_part( 'content-product', 'alt' ); ?>
        <?php endif; ?>
    <?php endwhile; // end of the loop. ?>
</ul>

But when I go to "/theme/woocommerce/content-product.php" I only see this code:

<li <?php post_class(); ?>>
    <div class="product-inner">
    <?php
    /**
     * woocommerce_before_shop_loop_item hook.
     *
     * @hooked woocommerce_template_loop_product_link_open - 10
     */
    do_action( 'woocommerce_before_shop_loop_item' );

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

    /**
     * woocommerce_shop_loop_item_title hook.
     *
     * @hooked woocommerce_template_loop_product_title - 10
     */
    do_action( 'woocommerce_shop_loop_item_title' );

    /**
     * woocommerce_after_shop_loop_item_title hook.
     *
     * @hooked woocommerce_template_loop_rating - 5
     * @hooked woocommerce_template_loop_price - 10
     */
    do_action( 'woocommerce_after_shop_loop_item_title' );

    /**
     * woocommerce_after_shop_loop_item hook.
     *
     * @hooked woocommerce_template_loop_product_link_close - 5
     * @hooked woocommerce_template_loop_add_to_cart - 10
     */
    do_action( 'woocommerce_after_shop_loop_item' );
    ?>
    </div>
</li>

Where are Woocommerce Hooks functions deployed? Where are that do_action() functions so I can edit them?

Thanks for your help!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀
    • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
    • ¥15 关于#hadoop#的问题
    • ¥15 (标签-Python|关键词-socket)
    • ¥15 keil里为什么main.c定义的函数在it.c调用不了