Announcement

Collapse
No announcement yet.

Automate quantity and other info

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Automate quantity and other info

    I have a form that calculates the quantity (sq m.) a customer needs according to the dimensions he inputs. I want to show him the total price for the quantity and place the quantity and dimensions (as other info) in the cart without requiring the customer to reinput them. Any ideas how I might do this?

    #2
    I think you would need some javascript to do the calculation and then to add a resultant string into the 'Other Info Question' on the product.

    Comment


      #3
      Thanks, drounding. I have the javascript doing the calculation but am a bit rusty on adding the string into other info; also updating quantity.

      Comment


        #4
        Add Q_<actinic:variable name="ProductID" /> to the Quantity field tag.

        Add O_<actinic:variable name="ProductID" /> to the Other info tag.

        In your JavaScript (assuming it's part of the product layout) use
        Code:
        document.getElementById('Q_' + <actinic:variable name="ProductID" />).value = myquantity;
        And a similar line:
        Code:
        document.getElementById('O_' + <actinic:variable name="ProductID" />).value = myotherinfo;
        If your JavaScript isn't part of the Product Layout, then pass the ProductID value to your code.

        Note that this will not stop the customer altering these values in the shopping cart.

        If you want a cleaner solution, I have an add-on "Sell by Area or Length" that's designed for such scenarios. It allows you to set a price per square metre (or cm, inch, etc) and set minimum/maximum allowed widths and lengths.

        See http://www.drillpine.biz/v10-made-to...o_measure.html for a demo.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Thanks, Norman. So far so good The quantity is definitely being updated on the product page but I can't get it passed to the 'Add to cart confirmation page'. (Quantity is not shown on product page - it would not be practical to change it for the whole site)
          I could be interested in your add-on and would appreciate further details (couldn't find it on drillpine) but our accounting package requires that quantity = no. of sq m.

          Comment


            #6
            Without a link to a live page, no-one can see what's happening. At a guess, you should make sure that the product is in a Section with a Shopping Mode of Quantity on Product Page. That's needed if you want to get the quantity you see alongside the product into the cart.

            You can email me via the link in my name to the left of this message.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment

            Working...
            X