• Resolved ViktorWoWReklambyra

    (@viktorwowreklambyra)


    Hello! Thanks once again for a great plugin with fantastic support.

    So i’m looking to populate woocommerce quantity input with the value of one of my input fields.

    On the form that’s on the product in the linked page – the value of “fieldname5_1” should be the quantity value that woocommerce adds to the cart. Is there any way to define this like you defined the weight, height fields etc?

    I know i can use a field to define the price field for woocommerce but i’m having trouble figuring out how to make sure the quantity field also increases. Thanks in advance, and once again – thanks for a great plugin!

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @viktorwowreklambyra,

    The process is simple. Populate the quantity field with the value entered through the fieldname5 field each time the fieldname5 field change its value.

    – Insert a “HTML Content” field in the form with the following piece of code as its content:

    
    <script>jQuery(document).one('change','[id*="fieldname5_"]', function(){jQuery('[name="quantity"]').val(this.value)});</script>
    

    – Now, may want hide the common quantity field, enter the following style definition through the “Customize Form Design” attribute in the “Form Settings” tab (https://cff.dwbooster.com/images/documentation/form-settings-tab.png):

    
    .quantity{display:none !important;}
    

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Populate woocommerce quantity input with field value’ is closed to new replies.