Page 1 of 1

Base Price

Posted: 26 Feb 2016, 11:08
by cnoelker
Hello,
is there a built-in way so that Aimeos displays the Base Price of a product?

E.g. Product "5kg of sand" costs 2 EUR.
Base price should then be "0.40 € per kg"

Claudia

Re: Base Price

Posted: 26 Feb 2016, 11:25
by aimeos
Aimeos supports custom price types:
https://aimeos.org/docs/Developers/Html ... pe_formats

You have to adapt the CSS if you want to show both price types. This mechanism is also used at the aimeos.com web site for the support subscriptions (price per month, paid for a year).

Re: Base Price

Posted: 26 Feb 2016, 11:45
by cnoelker
I created a new Price type and a new Attribute type, both with the domain 'price'. However, they do not appear in the Type select box, when I want to add a new price or a new attribute.

Is the shop administrator then supposed to compute the base price and to enter the value into this price field?
That would be rather inconvenient, cause for each price change, this field needs to be updated, too.
The preferred way is to compute the base price from an 'amount' and a 'unit' field and the price. E.g.
amount: 5.00
unit: kg
price: 2.00
=> compute 2.00 / 5.00 => output: '0.40 € per kg'

Claudia

Re: Base Price

Posted: 26 Feb 2016, 11:51
by aimeos
cnoelker wrote:I created a new Price type and a new Attribute type, both with the domain 'price'. However, they do not appear in the Type select box, when I want to add a new price or a new attribute.
Please reload the admin interface so the new types are available.
cnoelker wrote:The preferred way is to compute the base price from an 'amount' and a 'unit' field and the price. => compute 2.00 / 5.00 => output: '0.40 € per kg'
If you have the necessary information, you can also create a new price partial, which does the calculation automatically:
https://github.com/aimeos/aimeos-core/b ... efault.php

Re: Base Price

Posted: 26 Feb 2016, 12:46
by cnoelker
I reloaded the Admin interface, cleared the (TYPO3 and Aimeos) cache, logged out and logged in, again - the new types are not available, though. (They are stored in the database, though).

But I got the idea how the base price could be added/computed.

Thanks
Claudia

Re: Base Price

Posted: 26 Feb 2016, 13:44
by aimeos
cnoelker wrote:I reloaded the Admin interface, cleared the (TYPO3 and Aimeos) cache, logged out and logged in, again - the new types are not available, though. (They are stored in the database, though).
Did you've assigned the correct domain (e.g. product) for the new price type?

Re: Base Price

Posted: 26 Feb 2016, 14:17
by cnoelker
aimeos wrote:Did you've assigned the correct domain (e.g. product) for the new price type?
Okay, I changed the domain to product and the new price type is displayed when I add a price for the product.

After playing with this a bit, I think that for computing the base price, the better way is to create an additional attribute for the product and then computing the base price depending on the value which is set in this additional attribute.

Re: Base Price

Posted: 26 Feb 2016, 21:24
by aimeos
If you want to store the weight of the product somewhere, the product properties are the right place. Attributes are only for information shared between products.