• Resolved barryhealy123

    (@barryhealy123)


    Hi,

    I’m a total novice with wordpress and woocommerce, but am managing to put a shop together bit by by bit. Sadly I’ve come across an issue that I hope your plugin can help me resolve.

    I need the woocommerce quantity field to reflect a calculated field from your plugin.

    For example, our customer might require 5 pieces of an item cut at 100mm.

    I have created an input for quantity required(fieldname2) and length required in mm(fieldname3). As we sell items in our inventory package in metres I have created a field that calculates the required amount as follows.

    fieldname2*(fieldname3/1000) = 0.5 which is great. The issue i’m having is getting the value to update the woocommerce quantity field, which I will hide from the customers view.

    I have tried to add some script as per a thread on this forum, but to no avail

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

    Please can you help me understand where I’m going wrong?

    Thank you

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @barryhealy123

    The correct would be (assuming the fieldname1 is the corresponding field for the quantity), insert a HTML Content field in the form with the following piece of code:

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

    If you have additional questions about the commercial versions of the plugin, you should to create a ticket in my private website:

    https://cff.dwbooster.com/contact-us

    Best regards.

    Thread Starter barryhealy123

    (@barryhealy123)

    Thank you for coming back so quickly!

    That has done the trick. I see I had a couple of errors in the code.

    Is it possible to show fieldname2 and fieldname3 in the cart as currently it displays the total quantity required, which gives no description to the customer.

    Plugin Author codepeople

    (@codepeople)

    Hello @barryhealy123

    Please, for question related with features in the commercial versions of the plugin, you should to create a ticket in the support system:

    https://cff.dwbooster.com/contact-us

    Best regards.

    Thread Starter barryhealy123

    (@barryhealy123)

    Sorry will do, thanks again

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Woocommerce quantity field’ is closed to new replies.