Aimeos Create an new extension and Api in it.

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!
User avatar
aimeos
Administrator
Posts: 8633
Joined: 01 Jan 1970, 00:00

Re: Aimeos Create an new extension and Api in it.

Post by aimeos » 13 Jun 2024, 10:46

No, that must be part of your Laravel application
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
TEJASPARMAR
Posts: 15
Joined: 20 Mar 2024, 11:53

Re: Aimeos Create an new extension and Api in it.

Post by TEJASPARMAR » 13 Jun 2024, 19:41

I just want to create a new page within an extension and load it on some URL/route.
How can we do that in an extension?

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

Re: Aimeos Create an new extension and Api in it.

Post by aimeos » 14 Jun 2024, 15:58

Only in the Laravel application itself, not in an Aimeos extension.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
TEJASPARMAR
Posts: 15
Joined: 20 Mar 2024, 11:53

Re: Aimeos Create an new extension and Api in it.

Post by TEJASPARMAR » 17 Jun 2024, 11:57

Can we modify/override the checkout page within an extension on the same URL, but the content should be changed for the checkout page?

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

Re: Aimeos Create an new extension and Api in it.

Post by aimeos » 18 Jun 2024, 08:46

Yes, you can adapt the existing Aimeos pages without problem, e.g. for the checkout page have a look here:
https://aimeos.org/docs/latest/frontend ... omponents/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
TEJASPARMAR
Posts: 15
Joined: 20 Mar 2024, 11:53

Re: Aimeos Create an new extension and Api in it.

Post by TEJASPARMAR » 25 Jun 2024, 13:17

Can we get products from the basket using code within an extension?
Also, can we add the javascript in an extension?
If yes, where can we add javascript?

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

Re: Aimeos Create an new extension and Api in it.

Post by aimeos » 26 Jun 2024, 12:05

TEJASPARMAR wrote: 25 Jun 2024, 13:17 Can we get products from the basket using code within an extension?
Sure. Do you need the basket in the frontend, backend or in a job controller?
TEJASPARMAR wrote: 25 Jun 2024, 13:17 Also, can we add the javascript in an extension?
If yes, where can we add javascript?
Yes. The easiest way is to create a Laravel theme extension where you can customize the CSS/JS completely.
If you only want to add a few lines of JS to the used theme, add a file to the ./themes/client/html/ directory of your extension. Then, add that file path in the component where you need it by overwriting the header.php file of that component in your own extension. Here you can see how CSS/JS files are inclued:
https://github.com/aimeos/ai-client-htm ... er.php#L83

For your own file, e.g. in ./themes/client/html/custom.js use:

Code: Select all

<script defer src="<?= $enc->attr( $this->content( 'custom.js', 'fs-theme', true ) ) ?>"></script>
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
TEJASPARMAR
Posts: 15
Joined: 20 Mar 2024, 11:53

Re: Aimeos Create an new extension and Api in it.

Post by TEJASPARMAR » 03 Jul 2024, 11:57

I have added javascript within an extension. But it is taking path of "public" folder in the web page.
Is there anyway to deploy our extension in the public/vendor or any way to change javascript path to our extension ?

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

Re: Aimeos Create an new extension and Api in it.

Post by aimeos » 04 Jul 2024, 09:44

If you copy the existing theme into a new directory besides, you can create a new theme that will be published to ./public/vendor/shop/themes/
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
TEJASPARMAR
Posts: 15
Joined: 20 Mar 2024, 11:53

Re: Aimeos Create an new extension and Api in it.

Post by TEJASPARMAR » 09 Jul 2024, 17:31

Refused to execute inline event handler because it violates the following Content Security Policy directive: "default-src 'self' 'nonce-/nqamicZj8GcbZ9UY9FyUQ=='". Either the 'unsafe-inline' keyword, a hash ('sha256-...'), or a nonce ('nonce-...') is required to enable inline execution. Note that hashes do not apply to event handlers, style attributes and javascript: navigations unless the 'unsafe-hashes' keyword is present. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback

Getting this error for security policy.
Can please help me for that ?

Post Reply