Announcement

Collapse
No announcement yet.

That old rounding problem!

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

    That old rounding problem!

    Hi

    I am setting up a site where order quantities must be in multiples of 6, but the 6 can be a selection from a range of products.

    I am trying out a bit of js from this thread coutesy of Norman the Great!, but as the price for 6 is going to be £13.00, and 13/6 = 2.16 recurring, I think the best I am going to be able to do with individual (though not shown) prices on the items is 217 pence * 6 = £13.02. Which is annoying for me and the client.

    Is there perhaps a way around this by calculating the order value based on CART_CONTENT(3) / 6 *1300. Of course I would have to ensure that the user could not get to the checkout page with a non-6 divisible quantity, but I reckon I could work that out with time if I could disable quantity changes in the checkout Perl phase.

    The other complication is that I will have to set up some discount parameters for bulk orders, and date controlled discounts as well.

    A bit of a minefield with my limited experience, but I thought I'd enquire.

    Thanks in advance, Dan
    adaptive-image.co.uk

    #2
    Is it required to divide the price to 6 equal parts? If it is not an issue then probably you should add the rounding difference to the last items. E.g. 2*2.16 and 4*2.17.

    Regards,
    Zoltan
    Actinic Software
    www.actinic.co.uk

    Comment


      #3
      Thanks Zoltan,

      But I can't control which individual items the customer orders, so they might order 6@217, or 5@216 and 1@217 etc. So I don't see how I can do it setting the prices at the item level.

      The price never needs to be divided into six equal parts for the customer, all they'll see is £13.00 for their first box of 6 mixed items, £10.50 for their second box - or £12.00 and £9.50 if they've ordered early!

      And they'll have no means to fiddle with quantites at the Perl stage (I'm using Norman's Cart Cookie remainder JS to prevent a Next click on Order_00 if not divisible by 6, OR qty < 6)

      Perhaps I'm trying to stretch the limits too much?

      Dan
      adaptive-image.co.uk

      Comment


        #4
        Ok, so as far as I understand you would like to sell six items for a fixed price. It is already solved how the number of items is limited to 6 but you can't find out how to create fixed prices. If that's the case and you are using Actinic Business then probably the new discounting can help you. Using the 'fixed price' reward type you can set up a configuration where all 6 products are sold for a fixed price and adjustment lines are automatically created to get the fixed price. All the rounding issues are solved by the scripts automatically in this case.

        Regards,
        Zoltan
        Actinic Software
        www.actinic.co.uk

        Comment


          #5
          Thanks Zoltan

          That sounds ideal. I'll have to get my nose into the new discounting features now then!

          Dan
          adaptive-image.co.uk

          Comment

          Working...
          X