Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
P3t3r66608yIt's basically the same thing. If you look it up you'll find tons of info about it. Then you just have to find out which are the ones WooCommerce let's you use.
If I'm not mistaken, all you have to do is:
- Create a function that does what you want;
- (Optional) Remove the default hooks behavior with the function remove_action();
- Call the function add_action('hook_name', 'your_function_name');
This is usually done in functions.php
I'll paste an example. -
P3t3r66608yThis snippet removes the deafult product title in the loop and replaces it a <a> tag with the class .title
remove_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10);
function custom_template_loop_product_title(){
?><a href="" class="title"><?php echo get_the_title(); ?></a><?php
}
add_action('woocommerce_shop_loop_item_title', 'custom_template_loop_product_title', 10); -
P3t3r66608y@pretz No, but it is okay to try to help a fellow dev... Moreover it's not like he's asking about a bug or something...
-
abr4xas12118yHey guys relax, thanks for the info... searching in Google found some info how to handle this hooks, basically, I need run a task to synchronize the stock from the web with a local server. if I'm not wrong, all I need to do is check the HTTP request body and then, run my task.
Related Rants
Hey, anyone here knows how to work with woocommerce webhooks? I need help with that 😀😀
undefined
help
wordpress
woocommerce