Subscription cancellation fee

Help for integrating the Laravel package
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!
User avatar
aimeos
Administrator
Posts: 8378
Joined: 01 Jan 1970, 00:00

Re: Subscription cancellation fee

Post by aimeos » 10 Jun 2024, 15:46

Thanks you for the details!
Seems like there was a "clone" missing before setting the ID to "null". This is now fixed in dev-master, 2024.04.x-dev and 2023.10.x-dev versions of the aimeos/ai-controller-jobs package and will be part of the next release.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

mrkepzie
Posts: 5
Joined: 03 Jun 2024, 06:37

Re: Subscription cancellation fee

Post by mrkepzie » 10 Jun 2024, 21:46

Thanks for the fix, seems it did the trick!

mrkepzie
Posts: 5
Joined: 03 Jun 2024, 06:37

Re: Subscription cancellation fee

Post by mrkepzie » 14 Jun 2024, 13:11

Back on the original topic:
Basically to implement Cancellation fee we need a "Commitment Date Begin" added to a Subscription and an interval indicated on the product (probably in hidden product attributes?) indicating the "Commitment Period".
What would be the correct worfklow to add these attributes? Fork aimeos-core or can this be done as an extension?

I tried to play with custom attributes by adding a hidden attribute to a product (in its Characteristics tab). Then in the end subscription job I'm afraid I don't know how to check the attributes of products...

Code: Select all

foreach ($order->getProducts() as $prod) {
			foreach ($prod->getAttributeItems('hidden')  as $attritem) {
				Log::debug('dbg ',['prod: ' => $prod->getCode(), 'attrib: '=> $attritem]);
			}
}
This doesn't show any attribute in the product, even though it is there in the hidden attributes in the admin.
Any help appreciated, thanks.

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

Re: Subscription cancellation fee

Post by aimeos » 14 Jun 2024, 15:55

First of all: You can overwrite anything in Aimeos in your own extension without touching the core packages and you must not modify the core packages to get updates.

The interval is already added to the order product if the attribute is added to the product and chosen by the customer. The commitment date could be derived from the creation time of the order product.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply