Length based article type

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
boettner
Advanced
Posts: 136
Joined: 09 Feb 2015, 17:49

Length based article type

Post by boettner » 07 Feb 2020, 15:16

Hi all,

as far as I can see there´s no length based article type. A product type for products sold by meter or any other length unit. Besides using block pricing what would be the best approach to set a per length price and let Aimeos calculate upon user entered desired length?

Best
Robert.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Length based article type

Post by aimeos » 08 Feb 2020, 14:57

A product type isn't required as it's related to prices and quantities (maybe fractions of quantities).

The easiest way would be to create a new price type for €/m that you display in the frontend. Then, you can add one default price for the minium length unit (e.g. for one centimeter or one decimeter) with the price for that length. Aimeos will calculate the correct price by multiplying that price with the entered length of the user. Block pricing isn't required here, only that you need to define the minimum length unit.

If you want that users can enter fractions of a meter, you can compute the real quantity by dividing the user entered length in meter by the minimum length unit in the frontend via JS or in a HTML client decorator:
Example: 1,75m / 0,01m = 175cm
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

boettner
Advanced
Posts: 136
Joined: 09 Feb 2015, 17:49

Re: Length based article type

Post by boettner » 09 Feb 2020, 11:44

Thanks for your ongoing support! :-)

I suppose that I have to follow some conventions regarding the form field for the users length/amount input for the automatism you suggest, haven´t I?
aimeos wrote: 08 Feb 2020, 14:57 Aimeos will calculate the correct price by multiplying that price with the entered length of the user.
What do I have to ensure for the offered basket form field to integrate this type of price calculation automatism?

The next question would be, how is that handled regarding the basket weight. To calculate the right weight for delivery service selection?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Length based article type

Post by aimeos » 10 Feb 2020, 12:28

boettner wrote: 09 Feb 2020, 11:44 What do I have to ensure for the offered basket form field to integrate this type of price calculation automatism?
Only make sure that the customer always knows the scale he has to enter in the frontend.
boettner wrote: 09 Feb 2020, 11:44 The next question would be, how is that handled regarding the basket weight. To calculate the right weight for delivery service selection?
The product weight must be for the minimum scale, e.g. if the product length is mutiple of 1cm, the product weight must be for 1cm.

BTW: The upcoming 2020.04 version will support fractional quantities and the code is already in the repositories.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

boettner
Advanced
Posts: 136
Joined: 09 Feb 2015, 17:49

Re: Length based article type

Post by boettner » 10 Feb 2020, 13:43

Allright, nice! I think, that will do.

To make sure the customer knows the scale I would like to use
https://aimeos.org/docs/User_Manual/Adm ... ils#Prices
Option/Value (optional)
Arbitrary list of key/value pairs that will be available with each price item in the frontend
But that´s not directly available at a priceItem retrieved via

Code: Select all

$priceItems = $this->get( 'prices', [] );
How can I access the config array?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Length based article type

Post by aimeos » 11 Feb 2020, 13:11

We've used the product config (not price list config) until we decided to add a new column for the quantity scale:
https://github.com/aimeos/ai-client-htm ... 0R284-R285
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

boettner
Advanced
Posts: 136
Joined: 09 Feb 2015, 17:49

Re: Length based article type

Post by boettner » 12 Feb 2020, 14:54

That helped, thank you!

Post Reply