• Hi !
    I recently bought the force sells plugin and I would like to add only one force-sold item by product, and add it at a certain priced (free in my case).

    I used this code for the first part, it works great but for personal needs, I sometimes add meta-data to a product and the plugin considers the product to be different from the one without meta-data, is that normal ?

    
    // only add one force sell item per product no matter how many of the original product are added
    function my_wc_force_sell_add_to_cart_product( $product ){
    	$product['quantity'] = 1;
    	return $product;
    }
    add_filter( 'wc_force_sell_add_to_cart_product', 'my_wc_force_sell_add_to_cart_product' );
    
    // when a synced force sell product is updated always set it to 1
    function my_wc_force_sell_update_quantity( $quantity, $product ){
    	return 1;
    }
    add_filter( 'wc_force_sell_update_quantity', 'my_wc_force_sell_update_quantity' );

    Is there a special hook to set the price I want for an item added by the plugin ?

    Thank you for your help !

    • This topic was modified 3 years, 1 month ago by yorleen.
    • This topic was modified 3 years, 1 month ago by yorleen.
    • This topic was modified 3 years, 1 month ago by yorleen.
Viewing 1 replies (of 1 total)
  • Hi @yorleen,

    If you are using Premium plugin and need support, pls kindly submit a ticket to our support page because this forum mainly support for free version of our plugin.
    Our support team will support you as soon as possible.

    Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Add a linked item for free’ is closed to new replies.