簡體   English   中英

應用程序的 shopware 6 管理模塊未在菜單中顯示應用程序

[英]shopware 6 admin module for app not showing app in menu

我制作了一個 shopware 應用程序,並在 manifest.xml 中添加了管理模塊的標簽:

 <admin>
        <module name="VisualSearchAdminModule"
                parent="sw-extension"
                source="http://localhost:8080/admin/shopware"
                position="50"
        >
            <label>Visual Search</label>
            <label lang="de-DE">Visual Search</label>
        </module>
    </admin>

您知道為什么管理模塊沒有顯示在菜單中嗎?

該應用程序已安裝並激活。
模塊源是有效的 url。

稍后編輯

我的清單中確實有設置標簽。 我在整個清單下方發布

<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/platform/trunk/src/Core/Framework/App/Manifest/Schema/manifest-1.0.xsd">
    <meta>
        <name>VisualSearch</name>
        <label>Visual Search</label>
        <label lang="de-DE">Visual Search</label>
        <description>Visual Search app for Shopware 6</description>
        <description lang="de-DE">Visual Search app für Shopware 6</description>
        <author>Agency</author>
        <copyright>(c) by Agency</copyright>
        <version>1.0.0</version>
        <icon>Resources/config/plugin.png</icon>
        <license>MIT</license>
    </meta>
    <setup>
        <registrationUrl>http://myapp/auth</registrationUrl>
        <secret>visualsearchsecret</secret>
    </setup>

    <admin>
        <module name="VisualSearchAdminModule"
                parent="sw-extension"
                source="http://myapp/admin/shopware"
                position="50">
            <label>Visual Search</label>
            <label lang="de-DE">Visual Search</label>
        </module>
    </admin>

    <permissions>
        <read>product</read>
    </permissions>

    <webhooks>
        <webhook name="app-activated" url="http://myapp/api/shop/activate" event="app.activated"/>
        <webhook name="app-deactivated" url="http://myapp/api/shop/deactivate" event="app.deactivated"/>
        <webhook name="app-deleted" url="http://myapp/api/shop/delete" event="app.deleted"/>
    </webhooks>

</manifest>

該應用程序的注冊工作正常。
但是管理模塊沒有顯示在 shopware 管理菜單中。

要注冊管理模塊,您的應用目前必須有一個設置段才能注冊到外部 web 服務,即使它是私有應用也是如此。 否則模塊將被忽略。

<manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/shopware/platform/master/src/Core/Framework/App/Manifest/Schema/manifest-1.0.xsd">
    <!-- ... -->
    <setup>
        <registrationUrl>http://localhost/register.php</registrationUrl>
        <secret>verysecret</secret>
    </setup>
    <admin>
        <module name="exampleModule"
                source="https://example.com/promotion/view/promotion-module"
                parent="sw-marketing"
                position="50"
        >
            <label>Example module</label>
            <label lang="de-DE">Beispiel Modul</label>
        </module>
    </admin>
</manifest>

這是register.php的最小示例。php

<?php

require __DIR__ . '/vendor/autoload.php';

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\JsonResponse;

$request = Request::createFromGlobals();
$query = $request->query->all();
$proof = \hash_hmac(
    'sha256',
    $query['shop-id'] . $query['shop-url'] . 'TestApp',
    'verysecret'
);

$response = new JsonResponse([
    'proof' => $proof,
    'secret' => 'verysecret',
    'confirmation_url' => 'http://localhost/confirm.php'
]);

$response->send();

TestApp您的應用名稱。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM