PRODUCT MULTIPLE PRICES - HOW TO SELECT ONE ?

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!
sixbynine
Posts: 93
Joined: 10 Jan 2018, 11:22

PRODUCT MULTIPLE PRICES - HOW TO SELECT ONE ?

Post by sixbynine » 07 May 2018, 09:43

Hello,

I have a product with 2 different prices (because of different taxrates)... but only one price is showed and used by Aimeos.

Can you explain which one is used by default (I guess it's last one inserted)?

I would like to add an options to select the price by VAT instead in JSONAPI passing an attribute like :

"product.id": response[0]['id'],
quantity: 1,
stocktype: "default",
taxrate: "0.15" <-

What do you think about it? How can I do it?

Thank you very much !

sbn

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

Re: PRODUCT MULTIPLE PRICES - HOW TO SELECT ONE ?

Post by aimeos » 07 May 2018, 12:21

The price used might be arbitrary if both have the same quantity.

If you want to sell products with different prices and taxrates, you need the sites extension from the Aimeos company where you can create subsites for each country/etc. which you can assign the country specific prices to: https://aimeos.com/extensions/#c1331
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

sixbynine
Posts: 93
Joined: 10 Jan 2018, 11:22

Re: PRODUCT MULTIPLE PRICES - HOW TO SELECT ONE ?

Post by sixbynine » 07 May 2018, 14:55

Hello,

Thank you very much for your answer... i'm not sure the extension can help me because I just need to manage one country but in my country the same product from the same stock sold to the same customer can have 3 different taxrates depending how it will be used, so I need a way to select the VAT for the product and then add it to the basket.

Thank you a lot in advance,

sbn

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

Re: PRODUCT MULTIPLE PRICES - HOW TO SELECT ONE ?

Post by aimeos » 08 May 2018, 07:09

Interesting use case. Can you explain by example why this is the case and when you need with tax rate? In which country the product should be sold?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

sixbynine
Posts: 93
Joined: 10 Jan 2018, 11:22

Re: PRODUCT MULTIPLE PRICES - HOW TO SELECT ONE ?

Post by sixbynine » 08 May 2018, 08:07

It's for food ! People can order (and prepay) a meal and go to the shop to get it. Then if they bring it home (take away) or if they eat it in the shop they won't pay the same tax, if it contains alcohol the tax rate changes too... So they need to decide what they'll do and choose the correct taxrate when they order on the website. (It works like this in different EU countries I guess, mine is Belgium). Because for the same product I won't ever have two different prices with the same taxrate, I think I need to change de default db price select req and pass the selected taxrate in a where clause. I could also make 2 or 3 versions of each product but it would be really messy and complicated because the stock is the same !

Thank you very much for your answers and your patience !

sbn

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

Re: PRODUCT MULTIPLE PRICES - HOW TO SELECT ONE ?

Post by aimeos » 11 May 2018, 05:34

May we suggest another solution? Create selection products and variants with only contains the different prices. Then, the customers can select e.g. "take away" and "restaurant". The tax rate for alcohol is only in the prices for products that contain alcohol but the customers still only need to select "take away" and "restaurant". That seems much more user friendly.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

sixbynine
Posts: 93
Joined: 10 Jan 2018, 11:22

Re: PRODUCT MULTIPLE PRICES - HOW TO SELECT ONE ?

Post by sixbynine » 14 May 2018, 05:55

Hello,

Thank you very much for your response and your suggestion. I'm trying it... but it looks like i need to add all the prices as independant variants... it's really messy to manage.

if I keep the variant price set to 0, would it be possible to have only three variants that doesn't contain the prices but only the taxation rates that need to be used and that would overwrite the taxrate of the main price taxrate of the selection?

Thank you very much,

sbn

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

Re: PRODUCT MULTIPLE PRICES - HOW TO SELECT ONE ?

Post by aimeos » 14 May 2018, 08:58

You are right, you need to assign a price to each variant where only the tax rate differs. Inheritance of price values but not tax rates does not work.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

sixbynine
Posts: 93
Joined: 10 Jan 2018, 11:22

Re: PRODUCT MULTIPLE PRICES - HOW TO SELECT ONE ?

Post by sixbynine » 14 May 2018, 10:35

Ok ! I tried to use it this way but I've a stock problem... I this possible that two different variants can not share the same parent select stock?

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

Re: PRODUCT MULTIPLE PRICES - HOW TO SELECT ONE ?

Post by aimeos » 14 May 2018, 17:41

Currently, articles can't share the same stock level of the selection product but you can implement an alternative basket plugin for the stock level check: https://github.com/aimeos/aimeos-core/b ... tStock.php

Stock level update is done here: https://github.com/aimeos/aimeos-core/b ... d.php#L315
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply