• Resolved Dave Dean

    (@deaner666)


    Hello there. I have a problem that I thought would be solved by the measurement price calculator extension, but that extension doesn’t do what I expected at all! (I wonder if I’m the only person to think that?)

    I’m creating a site that sells banners and other printed products at custom sizes. The customer needs to be able to enter a width and a height and have a price generated that is an area calculation based on that width and height.

    The measurement price calculator ties this calculation into the quantity for some reason (ie. it works out how many of a product to order based on the given dimensions), I can’t image many people wanting to use it like that, but I might be wrong.

    I need a customer to choose, say, a 2m x 1m banner, have a price displayed that’s calculated from a per square metre price, and then be able to update the quantity to decide how many of those 2m x 1m banners they want.

    Can I do this in any of the following ways:

    * With the measurement price calculator extension
    * With a “width” and “height” attribute
    * In some other way I haven’t thought of?

    Cheers,

    Dave

    https://www.ads-software.com/extend/plugins/woocommerce/

Viewing 15 replies - 16 through 30 (of 51 total)
  • Thread Starter Dave Dean

    (@deaner666)

    Ah. I just thought of something else…

    In my example:

    https://www.print-2-media.com/shop/banners/pvc-banners-510gsm-heavy-weight-single-sided/

    The “finishing” radio button field is NOT an options field. It’s just a normal radio button field which the calculation fields use to determine the price multiplication factor.

    If it were an “options” field then the price associated with each option would get added to the total, which may be where you’re getting a problem.

    I realise my initial instructions were confusing on this point (because I’d forgotten it myself!), so I’m really sorry!

    Cheers,

    Dave

    Hi @deaner666,

    how do you update the pricing field so that the correct price is added to cart?

    For example:
    I have a product for e.g. $30. I have a text field where 15 chars. free, each additional is $0.10. So i have created a JS calculation. Now i want to update the the pricing field to $30.50 and add to cart. Which field has to be updated? You know what i mean?

    Thanks!

    Thread Starter Dave Dean

    (@deaner666)

    @codeworxx – are you using Woocommerce and Gravity Forms with the Gravity Forms Product Addons?

    No – only WooCommerce and the WooCommerce Product Addon (https://www.woothemes.com/products/product-add-ons/).

    Thread Starter Dave Dean

    (@deaner666)

    @codeworxx – I’m sorry, I wouldn’t know the answer to that. I’ve not got any experience of manipulating the Woocommerce fields via Javascript.

    I can recommend Gravity Forms and the gravity forms product addons extension. It means when WordPress / Woocommerce or your theme are updated, somebody else is doing the work of updating the code to match (otherwise you have to go back through all the sites you run to update your own bit of code).

    Ok, but does Gravitiy update the pricing?

    Thread Starter Dave Dean

    (@deaner666)

    I’ve never used it for your specific use-case, so I can’t be totally sure. You could try the Gravity Forms forums:

    https://www.gravityhelp.com/forums/

    @deaner666

    That was the trick! It works as described and explained now.

    However there is one more thing that I need clarification on now (as it usually goes when implementing functionality):

    When I set up my drop down fields and radio buttons, I set the value as just the price for that particular option (ex:https://fbcdn-sphotos-g-a.akamaihd.net/hphotos-ak-prn2/q71/1045239_10201200692714492_629984526_n.jpg). As a result when the product variations are displayed in the cart it only displays that price value. I’d like for it to display the field label as in your example.
    (Here is a link to a screenshot comparing variation displays from each of our sites: https://fbcdn-sphotos-h-a.akamaihd.net/hphotos-ak-prn2/1045067_10201200644193279_2095602698_n.jpg)

    Thanks!

    Thread Starter Dave Dean

    (@deaner666)

    Ah… that one’s easy ??

    You just have to set the value to be the same as the label.

    I can’t remember if conditional logic uses the label or the value. If it uses the value you’ll have to update the conditions in your calculation fields.

    Glad you’ve got it working!

    Cheers,

    Dave

    Wouldn’t that mess with the calculations?

    Thread Starter Dave Dean

    (@deaner666)

    Do you mean you’re using the number in your radio field value directly in your calculation?

    That’s not how mine works. For each radio button in the radio group, I have a calculation field that is only shown (via conditional logic on the field) when that radio button is selected.

    Here’s an example of the calculation that is applied when someone chooses “Hems and eyelets – £22.50 per m2”

    (({Width:5} / 100) * ({Height:4} / 100)) * 22.5

    As you can see – the 22.50 is hard coded in the calculation, so the value on the radio button can be whatever you want. It’s only used to determine which calculation field to apply.

    If you choose “Unhemmed, no eyelets – £20 per m2”, then a different calculation field is applied (via conditional logic) with the following calculation:

    (({Width:5} / 100) * ({Height:4} / 100)) * 20

    Does this make sense?

    I was able to make my implementation match the needed functionality.

    Thank you very much for all of your help Deaner666!

    Thread Starter Dave Dean

    (@deaner666)

    No probs. Glad you got it working. It took me a lot of working out to get it sorted so I’m glad to be able to pass it on to someone else!

    Have you got a link you can share so I can see it in action? I’m curious now!

    Cheers,

    Dave

    I’m currently finishing up the site now and it is not live. It will be in the next week though. I’ll keep you posted!

    Hi Deaner666,
    I have seen your link https://www.print-2-media.com/shop/banners/pvc-banners-510gsm-heavy-weight-single-sided/ that is what I want to achieve and struggling for it from the past many days, I am able to use gravity form and can multiply the fields and can get a total but what I am not able to do is that I am unable to add total price to the cart, if you can spare some time and give me an idea how u r doing that will be a great help for me.

Viewing 15 replies - 16 through 30 (of 51 total)
  • The topic ‘Price based on width and height entered by customer’ is closed to new replies.