button to increase stock amount WC
-
Hi,
I’m trying to experiment with woocommerce through a custom plugin.
what am I trying to do?
Insert a button on Woocommerce shop page to increase product quantity.Code button is this:
add_action( 'woocommerce_after_shop_loop_item', 'mycode_plus_buttons', 1 ); function mycode_plus_buttons() { add_action( 'woocommerce_after_shop_loop_item', 'mycode_plus_button' ); } function mycode_plus_button() { global $product; echo '<a href="' . get_permalink( $product->id ) . '" class="button add_to_cart_button product_type_external">+</a>'; }
Now, I found the command wc_update_product_stock () at this page:
herebut I don’t know how connect code of API to button on shop page.
can someone tell me some examples to study to solve my problem?
Thanks
Luca
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘button to increase stock amount WC’ is closed to new replies.