Skip to content

Commit

Permalink
docs: update docs for 6.7 instructions for the sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
jleifeld committed Jan 30, 2025
1 parent 11b05f5 commit 2923f41
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions docs/admin-sdk/docs/guide/1_getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,33 @@ can use the NPM package.
### Plugin:
**Notice:** Plugins will work on self-hosted instances only. You won't be able to use a Shopware 6 cloud instance with plugins.

#### For Shopware 6.7 and higher:
Create the folder `custom/plugins/yourPlugin/src/Resources/app/meteor-app`. This is the base path for all new files for your extension.

Create a new base `index.html` file. This file will be automatically injected as a hidden iFrame to the administration when the plugin is activated. Then you need to create a JavaScript file in the subfolder `src/main.js` and add it to your `index.html`:

```html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Your extension</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
```

Then you initialize a new Node project with `npm init --yes` and install the SDK via NPM with `npm i --save @shopware-ag/meteor-admin-sdk`.

If you want to have a custom Vite configuration you can install Vite with `npm i --save vite` and create a `vite.config.js` file in the `meteor-app` folder with your custom configuration.


#### For Shopware 6.6 and lower:
Open the path `custom/plugins/yourPlugin/src/Resources/app/administration`. This is the base path for all new admin files.

Create a new base `index.html` file. This file will be automatically injected to the administration when the plugin is activated. Then you need to create a JavaScript file in the subfolder `src/main.js`. This file will be automatically injected into the created HTML file.
Expand Down
2 changes: 1 addition & 1 deletion docs/admin-sdk/docs/guide/2_api-reference/location.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Returns a string with the name of the current location.

### Check if current location is inside iFrame

Useful for hybrid extensions which are using plugin and Extension SDK functionalities together. You can use this
Useful for hybrid extensions which are using plugin and Extension SDK functionalities together (Shopware 6.6 and lower). You can use this
check to separate code which should be executed inside the Extension SDK context and the plugin context.

#### Usage:
Expand Down

0 comments on commit 2923f41

Please sign in to comment.