Products and cart #808
-
Hello everyone! I need your help to get some things to understand. I have a project, where I need to sell products like parquet. So the price that is displayed in the shop is per m2, but in a package are 2.6 m2. The shop customer can only buy full packages. So how can I achieve this with the standard mall solution? I have currently no clue. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
That's a tricky one. A solution to this problem is to use mall to create your parquet product of 2.6 m2 with a fixed price that the customer can buy. Then use either a custom field to add the price for a single m2 and display this instead of the effective product price in the frontend. Another, but a bit more complex solution, is to add a custom db column to the products table and extend the product form with a new "m2 cost" field. Then use this in the frontend. https://octobercms.com/docs/plugin/extending#extending-backend-form |
Beta Was this translation helpful? Give feedback.
-
And why not create variants? It is also possible to create variants of the parquet product:
Each with their own price and the product with a price per m². |
Beta Was this translation helpful? Give feedback.
-
I also thought of variants, but if I have the product 1 with a price of 10 per m2 and in a package is 2.6 m2 how can I increase the price, if the customer is putting the item in the cart? For example the customer needs 8 m2. the customer is getting 2 packages. 2 * 2,6 = 5,2 m2. The price per m2 is 10. The price in the cart must be 52 dollar or euro or whatever. Variants don't fit for this or? I think I need to extend the backend form... |
Beta Was this translation helpful? Give feedback.
-
I made a website for a butcher a while back, maybe it might be of some use. I created variants based on the property "package". And so now the client can choose products based on price per kilo, per piece and per 10 pieces. Might be of some use: https://georgesviandefumee.be/categorie/producten The pipe character is used as a unit. I split the property label on this character and use the latter part to show next to the quantity selector on the product page. This way, you can see that you are buying 1 piece or 1 pack or 1 kilo or whatever you like. My addtocart.html partial looks like this. Note "verpakking" => this is the unit in dutch (the property
Also, here is my cart.htm partial. Below you can see a dropdown selector for the variants with a different packaging:
My advice would be to use this kind of approach. If the user selects for example 10 individual products, while a 10 pack would be more economical, I would say that this is the responsability of the customer. You could technically detect the unit and the quantity via JavaScript and then display a message if you'd like. You could hook into the onchange event of the quantity selector, and then display something like "We notice that you put 10 individual pieces in your basket. Have you checked out our more economical bulk packaging?". Hopefully this might be of some use. |
Beta Was this translation helpful? Give feedback.
-
Hello!!! Thank you very much. This helped me out!!! Thanks one more again! |
Beta Was this translation helpful? Give feedback.
I made a website for a butcher a while back, maybe it might be of some use. I created variants based on the property "package". And so now the client can choose products based on price per kilo, per piece and per 10 pieces. Might be of some use:
https://georgesviandefumee.be/categorie/producten
The property looks like this:
The pipe character is used as a unit. I split the property label on this character and use the latter part to show next to the quantity selector on the product page. This way, you can see that you are buying 1 piece or 1 pack or 1 kilo or whatever you like.
My addtocart.html partial looks like this. Note "verpakking" => this is the unit in dutch (the property