Support » Plugin: YITH Pre-Order for WooCommerce » Save Product from the frontend with preorder status

  • Resolved cartaclaudio

    (@cartaclaudio)


    Hi,

    My products can be added by different vendors and therefore I have a frontend page which allows creation and editing of a product. No I have managed to get the right information to know if the checkbox has been selected or not for preorder, however, I would like to know what is the function to save the value to the product.

    Is there a function which saves the value according to product id that I can use?

    Regards,
    Claudio

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi Claudio,

    Maybe this code could help:

    $pre_order = new YITH_Pre_Order_Product( $product_id );
    $pre_order->set_pre_order_status( 'yes' );

    You need to provide the product ID to the YITH_Pre_Order_Product constructor.
    For the set_pre_order_status() function the valid values are ‘yes’ or ‘no’.

    cartaclaudio

    (@cartaclaudio)

    Thanks worked like a charm.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Save Product from the frontend with preorder status’ is closed to new replies.