• Resolved Jason

    (@galapogos01)


    Hi there,

    I use the WooCommerce ?add-to-cart action to add items to the cart for the customer. How can I pass a pre-defined value for a mandatory product field?

    Cheers,
    Jason

Viewing 4 replies - 1 through 4 (of 4 total)
  • Sorry, it is not currently supported. But I think that it is a great idea and I will our team know that it could be useful for our clients.

    Thread Starter Jason

    (@galapogos01)

    Can you please provide a little more guidance as to how this could be done with a little coding?

    This is not currently possible, sorry. This is an additional feature and it needs to be introduced by our developers team.

    Thread Starter Jason

    (@galapogos01)

    I will be rating the plugin according to the support given in this thread…

    For anyone that finds this thread:

    /flexible-product-fields/classes/fpf-cart.php line 170
    if ( $value == null && $field[‘required’] == ‘1’ && strpos($_SERVER[‘SERVER_NAME’].$_SER VER[‘REQUEST_URI’],’/cart/’) === false ) {

    /flexible-product-fields/classes/fpf-product.php line 90
    if ( isset( $field[‘required’] ) && $field[‘required’] == ‘1’ && strpos($_SERVER[‘SERVER _NAME’].$_SERVER[‘REQUEST_URI’],’/cart/’) === false && ( empty( $value ) || $value == ” ) ) {

    This skips the mandatory field validation for pages containing /cart/

    Jason

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add to cart action with mandatory product fields’ is closed to new replies.