Request for new feature

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!
thisisbintang
Posts: 12
Joined: 30 Jun 2022, 10:10

Request for new feature

Post by thisisbintang » 30 Jun 2022, 10:18

Good evening, your work on aimeos jsonapi is quite good. I've been using it for almost a month.
But when I want to change the service data in basket I get that I am not allowed to do that. For convenience, I request to add a feature to be able to update the service (payment/delivery) data in basket. Thank you for your availability
Attachments
Screenshot from 2022-06-30 17-14-57.png
Screenshot from 2022-06-30 17-14-57.png (10.96 KiB) Viewed 1795 times

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

Re: Request for new feature

Post by aimeos » 30 Jun 2022, 10:33

Which request are you sending to the API (request URL and body)?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

thisisbintang
Posts: 12
Joined: 30 Jun 2022, 10:10

Re: Request for new feature

Post by thisisbintang » 30 Jun 2022, 10:39

url: {{BASE_URL}}/jsonapi/basket?related=service&relatedid=delivery
method: PATCH
body: {
"data": {
"id": "delivery",
"type": "delivery",
"attributes": {
"service.id": "3"
}
}
}

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

Re: Request for new feature

Post by aimeos » 30 Jun 2022, 12:56

Should be possible but need to remove and add the delivery service again here:
https://github.com/aimeos/ai-client-jso ... andard.php

Are you able to create a pull request with the necessary code?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

thisisbintang
Posts: 12
Joined: 30 Jun 2022, 10:10

Re: Request for new feature

Post by thisisbintang » 30 Jun 2022, 13:17

no, i don't know much about php

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

Re: Request for new feature

Post by aimeos » 30 Jun 2022, 14:13

Because Aimeos supports multiple delivery and payment options per basket, the PATCH request may also look like:

Code: Select all

/jsonapi/basket?related=service&relatedid=delivery
method: PATCH
body: {
	"data": [{
		"id": "delivery",
		"type": "delivery",
		"attributes": {
			"service.id": "3"
		}
	}]
}
The difference is the list ([{...}]) of options to pass but this can be optional.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

thisisbintang
Posts: 12
Joined: 30 Jun 2022, 10:10

Re: Request for new feature

Post by thisisbintang » 30 Jun 2022, 16:04

still not working
Attachments
Screenshot from 2022-06-30 23-04-17.png
Screenshot from 2022-06-30 23-04-17.png (61.34 KiB) Viewed 1632 times

thisisbintang
Posts: 12
Joined: 30 Jun 2022, 10:10

Re: Request for new feature

Post by thisisbintang » 30 Jun 2022, 16:05

i forgot to show body request

thisisbintang
Posts: 12
Joined: 30 Jun 2022, 10:10

Re: Request for new feature

Post by thisisbintang » 30 Jun 2022, 16:06

:D
Attachments
Screenshot from 2022-06-30 23-05-18.png
Screenshot from 2022-06-30 23-05-18.png (75.3 KiB) Viewed 1632 times

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

Re: Request for new feature

Post by aimeos » 01 Jul 2022, 09:08

Support for PATCH method for basket services is now available in aimeos/ai-client-jsonapi:dev-master and will be part of the 2022.07 release:
https://aimeos.org/docs/master/frontend ... e-services
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply