Woocommerce Product Default Description for All Products

怎甘沉沦 提交于 2019-12-24 21:39:58

问题


Is this possible to add Woocommerce Product Default Description for All Products page. That should be image or Note text. And I want It will be put in above or bottom of the description text.

Thanks in advance


回答1:


you can use hooks like

// define the woocommerce_single_product_summary callback function
function my_custom_action() { 
    echo '<p>This is my custom action function</p>';
};     
add_action( 'woocommerce_single_product_summary', 'my_custom_action', 15 );

or woocommerce_after_single_product_summary

// define the woocommerce_after_single_product_summary callback 
function action_woocommerce_after_single_product_summary( $evolve_woocommerce_after_single_product_summary, $int ) { 
    // make action magic happen here... 
}; 

// add the action 
add_action( 'woocommerce_after_single_product_summary', 'action_woocommerce_after_single_product_summary', 10, 2 );  

or woocommerce_before_single_product_summary

// define the woocommerce_before_single_product_summary callback 
function action_woocommerce_before_single_product_summary( $woocommerce_show_product_sale_flash, $int ) { 
    // make action magic happen here... 
}; 

// add the action 
add_action( 'woocommerce_before_single_product_summary', 'action_woocommerce_before_single_product_summary', 10, 2 );

or you may also change direct on woo-commerce files.



来源:https://stackoverflow.com/questions/50449109/woocommerce-product-default-description-for-all-products

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!