Hi community, my uncle has lost his business website due to his old site coding no longer being supported by the host. I am trying to do a new site for him with ZERO knowledge of web development. I know...
The product he sells (cotton yarn) can be bought in two formats - by the cone or by kilo. Smaller customers tend to buy in number of cones but larger customers buy in kilos. All cones weigh the same at 1.5kg, so when buying 10 cones you are effectively buying 15kg. What I need to do is have some means of rounding up the required mass to a multiple of 1.5 (full cones), so if a customer orders 15kg that's fine - they need 10 cones, but if a customer only needs 14kg, they would still need 10 cones and if they require 16kg, then they would need 11 cones with a total weight of 16.5kg. Cones can't be split, so the full 16.5kg/11 cones in the previous example would need to be charged for, but customers still need the option to order by the cone if they want to.
I have so far allowed for two buying formats - by cone and by kilo, using a price premium to multiply the 'by kilo' price to yield a 'by cone' price, but I'm stumped by the rounding element.
I am open to either having this calculated automatically behind the scenes, or just to have a calculator on the product page which asks for the required weight and tells the customer how many cones they would need to satisfy the weight requirement. I'd love to think they could divide by 1.5 and round up to the nearest integer all by themselves but something tells me this is a recipe for cancelled orders and product returns.
Any and all help would be massively appreciated. Especially if it's in dummy language.