Base Price

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)
Spam and unrelated posts will be removed immediately!
cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Base Price

Post 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

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

Re: Base Price

Post by aimeos » 26 Feb 2016, 11:25

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).
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Base Price

Post 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

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

Re: Base Price

Post 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/b ... efault.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Base Price

Post 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

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

Re: Base Price

Post 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?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

cnoelker
Advanced
Posts: 140
Joined: 20 Feb 2016, 18:21

Re: Base Price

Post 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.

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

Re: Base Price

Post 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.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply