Mini Basket auto reload

Questions around the TYPO3 integration and plugins as well as Flow and NeosCMS
Forum rules
Always add your TYPO3/Flow, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
georg03
Posts: 13
Joined: 15 Jul 2019, 10:46

Re: Mini Basket auto reload

Post by georg03 » 13 Aug 2019, 09:27

I set the page ID for JSON API manually in each plugin. However mini basket still needs a page reload to update. I also came across a similar Typoscript setting however with typenum = 191351524 and 191351525.
https://github.com/aimeos/aimeos-typo3/ ... /setup.txt

What do you mean with "default page tree". Do I have to insert this Typoscript setup in an extension template only for the JSON API page?
Last edited by georg03 on 13 Aug 2019, 14:05, edited 1 time in total.

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

Re: Mini Basket auto reload

Post by aimeos » 13 Aug 2019, 09:57

We offer a page tree for import into TYPO3 that contains all necessary pages, plugins and settings:
https://aimeos.org/docs/TYPO3/Install_A ... s#Download
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

georg03
Posts: 13
Joined: 15 Jul 2019, 10:46

Re: Mini Basket auto reload

Post by georg03 » 13 Aug 2019, 12:36

Thank you! I checked the default page tree and added the typoscript for jsonapi page. Now when I add a product to basket I get the following error message in Developer Tools/Network/Response --> SyntaxError: JSON.parse: unexpected character at line 11 column 7 of the JSON data

cnoelker
Posts: 54
Joined: 20 Feb 2016, 18:21

Re: Mini Basket auto reload

Post by cnoelker » 13 Aug 2019, 12:49

Check the response which you get in the developer tools. Most probably, there is some string content above the json which is not allowed there.

georg03
Posts: 13
Joined: 15 Jul 2019, 10:46

Re: Mini Basket auto reload

Post by georg03 » 13 Aug 2019, 13:53

I was able to eliminate all unexpected characters. For some reason however the json is called twice (see below) which generates the following error message: --> SyntaxError: JSON.parse: unexpected non-whitespace character after JSON data at line 7 column 1 of the JSON data

{
"errors": {
"title": "Use OPTIONS method for the resource list",
"detail": "This is the Aimeos JSON REST API\n\nUse the HTTP OPTIONS method to retrieve a list available resources from http:\/\/wbesiteurl.at\/index.php?id=32&ai%5Bcontroller%5D=Jsonapi&ai%5Baction%5D=options\nDocumentation about he Aimeos JSON REST API is available at https:\/\/aimeos.org\/docs\/Developers\/Client\/JSONAPI"
}
}
{
"errors": {
"title": "Use OPTIONS method for the resource list",
"detail": "This is the Aimeos JSON REST API\n\nUse the HTTP OPTIONS method to retrieve a list available resources from http:\/\/websiteurl.at\/index.php?id=32&ai%5Bcontroller%5D=Jsonapi&ai%5Baction%5D=options\nDocumentation about he Aimeos JSON REST API is available at https:\/\/aimeos.org\/docs\/Developers\/Client\/JSONAPI"
}
}

How can this be? There is just one JSON REST API plugin on page ID 32.

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

Re: Mini Basket auto reload

Post by aimeos » 14 Aug 2019, 07:48

What's your TypoScript code for that page and the parent pages?
Is the plugin inherited from a parent page too?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

georg03
Posts: 13
Joined: 15 Jul 2019, 10:46

Re: Mini Basket auto reload

Post by georg03 » 14 Aug 2019, 15:40

Finally I was able to solve the problem. This installation I took over from another developer uses the extensions fluidpages and flux for setup. Maybe there are some conflicts?

What I had to do is to change the ext Template Typoscript setup for the JSON REST API page from page = PAGE ... to e.g. jsonpage = PAGE ...

Thanks a lot for your help!

Post Reply