Product with required subscription
					Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
	Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Product with required subscription
Hi,
I have set up a product with an annual subscription. The product price is also set for a year.
As I want to use the subscription (Next Date field) to check is customer is allowed on member area, I also want to enforce the year interval, but now on the product page the interval can be chosen ('none' or 'a year').
- Is this possible to have a product automatically tied to an interval, and if yes how?
- Is there a better approach?
Kind regards, Marc
(Laravel 9, Aimeos 2022.10)
PS: I also gave it a try asking ChatGPT and it came up with the solution to add below to shop.php config file, but I assume this is incorrect?
			
			
			
									
									
						I have set up a product with an annual subscription. The product price is also set for a year.
As I want to use the subscription (Next Date field) to check is customer is allowed on member area, I also want to enforce the year interval, but now on the product page the interval can be chosen ('none' or 'a year').
- Is this possible to have a product automatically tied to an interval, and if yes how?
- Is there a better approach?
Kind regards, Marc
(Laravel 9, Aimeos 2022.10)
PS: I also gave it a try asking ChatGPT and it came up with the solution to add below to shop.php config file, but I assume this is incorrect?
Code: Select all
'products' => [
    'product id number' => [
        'subscription' => [
            'enable' => true,
            'options' => [
                [
                    'interval' => 'P1Y0M0W2D',
                ],
            ],
        ],
    ],
],Re: Product with required subscription
Yes, configure the attribute of the type to be pre-selected so the "None" or "Please select" isn't rendered here:
https://github.com/aimeos/ai-client-htm ... #L164-L166
Docs: https://aimeos.org/docs/2022.x/config/c ... #preselect
That's complete non-sense

Professional support and custom implementation are available at  Aimeos.com
If you like Aimeos, give us a star
 give us a star
						If you like Aimeos,
 give us a star
 give us a starRe: Product with required subscription
Thanks for your response again. I will go with that.
			
			
			
									
									System info:
Running Aimeos Laravel: 2022.10
Laravel Framework 9.52
Almalinux
PHP 8.1
 Star Repo
					Star Repo
				