How to configure and adapt Aimeos based shops as developer
Forum rules: Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#2562 by cnoelker
26 Feb 2016, 11:08
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
#2564 by cnoelker
26 Feb 2016, 11:45
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
#2565 by aimeos
26 Feb 2016, 11:51
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/blob/master/client/html/templates/common/partials/price-default.php
#2566 by cnoelker
26 Feb 2016, 12:46
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
#2567 by aimeos
26 Feb 2016, 13:44
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?
#2568 by cnoelker
26 Feb 2016, 14:17
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.
#2569 by aimeos
26 Feb 2016, 21:24
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.