How to let customer select price (member/not member)?

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!
claude27
Posts: 21
Joined: 25 Jul 2024, 11:24

How to let customer select price (member/not member)?

Post by claude27 » 10 Mar 2025, 16:54

Hello,

how can I let a customer select a price (member / not member)?
In the aimeos backend (inside TYPO3) I have added a second price for an (example) product:
screenshot-www.aimeos.ddev.site-2025.03.10-17_42_02.png
screenshot-www.aimeos.ddev.site-2025.03.10-17_42_02.png (35.04 KiB) Viewed 43224 times
As the membership is controlled afterwards (memberships are saved in an external, not reachable database), no user membership check is required.

I created a quick & dirty select field in my extension inside the form:
packages/sitepackage/Resources/Private/Extensions/sitepackage/templates/client/html/catalog/detail/body.php

Code: Select all

<select name="ai[b_prod][0][price]" id="priceSelection" class="form-select">
                                            <option value="<?= $this->detailProductItem->getRefItems( 'price', 'default' )->first()->get('price.id') ?>">
                                                Standard price: <?= $this->number( $this->detailProductItem->getRefItems( 'price', 'default' )->first()->get('price.value'), 2 ) ?> €
                                            </option>
                                            <option value="<?= $this->detailProductItem->getRefItems( 'price', 'kostenmitglied' )->first()->get('price.id') ?>">
                                                Member price: <?= $this->number( $this->detailProductItem->getRefItems( 'price', 'kostenmitglied' )->first()->get('price.value'), 2 ) ?> €
                                            </option>
                                        </select>
The prices and price ids are shown correctly.

The event type is "event".

How can I now transfer the non-standard membership price to the basket and save it correctly? I didn't manage it yet.
Thank you for any help or tip!

Environment:
TYPO3 12 / Aimeos 24

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

Re: How to let customer select price (member/not member)?

Post by aimeos » 11 Mar 2025, 11:05

The solution is to create a selection product with two variant articles and different prices for each article. The articles need a variant attribute of a type like "membership" (attribute values can be "yes" and "no").
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

claude27
Posts: 21
Joined: 25 Jul 2024, 11:24

Re: How to let customer select price (member/not member)?

Post by claude27 » 11 Mar 2025, 11:36

Thank you!

Is it possible with the select product and the variant attributes to take into account the number of available seats regardless of the selection made? We do not have a fixed number of seats reserved for members or non-members, only the total number of seats counts.

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

Re: How to let customer select price (member/not member)?

Post by aimeos » 11 Mar 2025, 11:39

In that case it's better to use a standard product with two configurable attributes which can also have prices.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

claude27
Posts: 21
Joined: 25 Jul 2024, 11:24

Re: How to let customer select price (member/not member)?

Post by claude27 » 11 Mar 2025, 13:26

Unfortunately we have event products and furthermore each product has different member/not member prices. So I can't use general settings. I don't see in the aimeos backend how to create different prices for attributes inside the options of a product – is it not possible?

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

Re: How to let customer select price (member/not member)?

Post by aimeos » 12 Mar 2025, 18:22

The price of a (configurable) attribute is fixed so you may need to create two attributes for each event product that contains the member/non-member prices of the event.

If the price for non-members is higher by a fixed value (lets say 10 Euro), then you can give the event product the base price and the 10 Euros are added on top when non-membership is selected.

If the price for non-members is a percentage of the base value, then you could create a price rule provider that calculates the attribute price of the event products based on the base price of the event product.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply