• Resolved lucapizzonia

    (@lucapizzonia)


    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:
    here

    but 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)
  • Plugin Support Hannah S.L.

    (@fernashes)

    Automattic Happiness Engineer

    As no-one has responded to you on this, I’m going to mark this as resolved to help keep the forums healthy. If you have any further questions, you can start a new thread.

    If you’d like to pursue this further, then I highly recommend contacting one of the services on our customizations page: https://woocommerce.com/customizations/

Viewing 1 replies (of 1 total)
  • The topic ‘button to increase stock amount WC’ is closed to new replies.