{"id":255709,"date":"2020-06-20T14:04:26","date_gmt":"2020-06-20T14:04:26","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=255709"},"modified":"2022-11-23T05:39:33","modified_gmt":"2022-11-23T05:39:33","slug":"custom-storefront-controller-in-shopware6","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/","title":{"rendered":"Custom Storefront Controller in Shopware6"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Introduction<\/h2>\n\n\n\n<p>This article  give you a brief introduction  on how to create a custom storefront controller in <a href=\"https:\/\/webkul.com\/blog\/how-to-use-service-api-in-shopware-6\/\" target=\"_blank\" rel=\"noreferrer noopener\">shopware6<\/a>. If you want to create you own plugin then you need to know how to create a custom controller in storefront.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Overview<\/h2>\n\n\n\n<p> If you want to perform some custom business logic from your storefront , you will need to create a storefront controller . This article about to create a new product with help of custom controller.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Controller Class<\/h2>\n\n\n\n<p>For create a custom storefront controller in shopware6 . Create a class inside the&nbsp;<code>&lt;plugin base&gt;\/src\/Storefront\/Controller<\/code>&nbsp;and name it&nbsp;<code>ProductController<\/code>.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">\n&lt;?php declare(strict_types=1);\nuse Shopware\\Storefront\\Controller\\StorefrontController;\nuse Symfony\\Component\\Routing\\Annotation\\Route;\nuse Shopware\\Core\\Framework\\Routing\\Annotation\\RouteScope;\nuse Shopware\\Core\\System\\SalesChannel\\SalesChannelContext;\n\n\/**\n * @RouteScope(scopes={&quot;storefront&quot;})\n *\/\nclass ProductController\n{\n    \n     \/**\n     * @Route(\n     *      &quot;\/storefront\/products\/&quot;,\n     *      name=&quot;storefront.products&quot;,\n     *      defaults={&quot;productId&quot;: null, &quot;csrf_protected&quot;=false, &quot;XmlHttpRequest&quot;=true},\n     *      methods={&quot;GET&quot;, &quot;POST&quot;, &quot;DELETE&quot;}\n     * )\n    *\/\n     public function createShopwareProduct($productDetails, SalesChannelContext \n         $salesChannelContext)\n    {\n        $context = Context::createDefaultContext();\n        $productRepository = $this-&gt;container-&gt;get(&#039;product.repository&#039;);\n        \n        \/\/ create product\n        $id = !isset($productDetails&#091;&#039;productId&#039;]) ? Uuid::randomHex() : $productDetails&#091;&#039;productId&#039;];\n        $taxRepository = $this-&gt;container-&gt;get(&#039;tax.repository&#039;);\n        $tax = $taxRepository-&gt;search((new Criteria())-&gt;addFilter(new EqualsFilter(&#039;id&#039;, $productDetails&#091;&#039;tax&#039;])), $context)-&gt;first();\n        $grossPrice = $productDetails&#091;&#039;price&#039;]+($productDetails&#091;&#039;price&#039;]*$tax-&gt;getTaxRate())\/100;\n\n        $data = &#091;\n            &#039;id&#039; =&gt; $id,\n            &#039;productNumber&#039; =&gt; $productDetails&#091;&#039;number&#039;],\n            &#039;description&#039; =&gt; $productDetails&#091;&#039;description&#039;],\n            &#039;stock&#039; =&gt; (int) $productDetails&#091;&#039;stock&#039;],\n            &#039;name&#039; =&gt; $productDetails&#091;&#039;name&#039;],\n            &#039;price&#039; =&gt; &#091;\n                &#091;\n                    &#039;linked&#039; =&gt; false,\n                    &#039;net&#039; =&gt; (float) $productDetails&#091;&#039;price&#039;],\n                    &#039;gross&#039; =&gt; (float) $grossPrice,\n                    &#039;currencyId&#039; =&gt; Defaults::CURRENCY,\n                ]\n            ],\n            &#039;manufacturer&#039; =&gt; &#091;&#039;id&#039; =&gt; $productDetails&#091;&#039;manufacturer&#039;]],\n            &#039;tax&#039; =&gt; &#091;\n                &#039;id&#039; =&gt; $productDetails&#091;&#039;tax&#039;]\n            ],\n        ];\n\n        $categoryCollection = &#091;];\n\n        if (isset($productDetails&#091;&#039;category&#039;]) &amp;&amp; $productDetails&#091;&#039;category&#039;]) {\n            $productDetails&#091;&#039;category&#039;] = explode(&#039;&amp;&#039;, $productDetails&#091;&#039;category&#039;]);\n            foreach ($productDetails&#091;&#039;category&#039;] as $category) {\n                array_push($categoryCollection, &#091;&quot;id&quot; =&gt; $category]);\n            }\n\n            $data&#091;&#039;categories&#039;] = $categoryCollection;\n        }\n\n        if (!isset($productDetails&#091;&#039;productId&#039;])) {\n            $data&#091;&#039;visibilities&#039;] = &#091;\n                &#091;&#039;salesChannelId&#039; =&gt; $salesChannelContext-&gt;getSalesChannel()-&gt;getId(), &#039;visibility&#039; =&gt; ProductVisibilityDefinition::VISIBILITY_ALL],\n            ];\n        }\n\n        if (isset($productDetails&#091;&#039;cover&#039;])) {\n            $data&#091;&#039;cover&#039;] = &#091;\n                &#039;id&#039; =&gt; Uuid::randomHex(),\n                &#039;position&#039; =&gt; 1,\n                &#039;media&#039; =&gt; &#091;\n                    &#039;id&#039; =&gt; $productDetails&#091;&#039;cover&#039;]&#091;&#039;id&#039;],\n                    &#039;title&#039; =&gt; $productDetails&#091;&#039;cover&#039;]&#091;&#039;title&#039;],\n                ],\n            ];\n        }\n\n        if (isset($productDetails&#091;&#039;media&#039;])) {\n            $data&#091;&#039;media&#039;] = &#091;];\n            foreach ($productDetails&#091;&#039;media&#039;] as $mediaDetails) {\n                $media = &#091;\n                    &#039;id&#039; =&gt; Uuid::randomHex(),\n                    &#039;media&#039; =&gt; &#091;\n                        &#039;id&#039; =&gt; $mediaDetails&#091;&#039;id&#039;],\n                        &#039;title&#039; =&gt; $mediaDetails&#091;&#039;title&#039;],\n                    ],\n                ];\n\n                array_push($data&#091;&#039;media&#039;], $media);\n            }\n        }\n\n        if (isset($productDetails&#091;&#039;active&#039;])) {\n            $data&#091;&#039;active&#039;] = $productDetails&#091;&#039;active&#039;];\n        }\n\n        try {\n           \n            $productRepository-&gt;upsert(&#091;$data], $context);\n\n             \/\/ get last created product with the help of id\n            $criteria = (new Criteria(&#091;$id]))\n                -&gt;addAssociation(&#039;cover&#039;);\n\n            $createdProductCollection = $productRepository-&gt;search($criteria, $context);\n            $createdProduct = $createdProductCollection-&gt;first();\n\n            $response = &#091;\n                &#039;status&#039; =&gt; true,\n                &#039;createdProduct&#039; =&gt; $createdProduct,\n            ];\n        } catch (\\Exception $exception) {\n            $response = &#091;\n                &#039;status&#039; =&gt; false,\n                &#039;exceptionCode&#039; =&gt; $exception-&gt;getErrorCode(),\n                &#039;exceptionMessage&#039; =&gt; $exception-&gt;getMessage(),\n            ];\n        }\n\n        return $response;\n    }\n\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Register controller in route<\/h2>\n\n\n\n<p>Next you have to tell Symfony that it should search for routes in your \/Controller folder. Therefore add an&nbsp;<code>routes.xml<\/code>&nbsp;inside the&nbsp;<code>&lt;plugin base&gt;\/src\/Resources\/config<\/code>&nbsp;folder.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;\n&lt;routes xmlns=&quot;http:\/\/symfony.com\/schema\/routing&quot;\n        xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;\n        xsi:schemaLocation=&quot;http:\/\/symfony.com\/schema\/routing\n        https:\/\/symfony.com\/schema\/routing\/routing-1.0.xsd&quot;&gt;\n\n    &lt;import resource=&quot;..\/..\/**\/Storefront\/Controller\/*ProductController.php&quot; type=&quot;annotation&quot; \/&gt;\n&lt;\/routes&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Register Controller in service<\/h2>\n\n\n\n<p>Now you need to register your controller in the DI-Container, therefore edit the&nbsp;<code>Resources\/config\/services.xml<\/code>&nbsp;to look like this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?xml version=&quot;1.0&quot; ?&gt;\n\n&lt;container xmlns=&quot;http:\/\/symfony.com\/schema\/dic\/services&quot;\n           xmlns:xsi=&quot;http:\/\/www.w3.org\/2001\/XMLSchema-instance&quot;\n           xsi:schemaLocation=&quot;http:\/\/symfony.com\/schema\/dic\/services http:\/\/symfony.com\/schema\/dic\/services\/services-1.0.xsd&quot;&gt;\n\n    &lt;services&gt;\n        &lt;service id=&quot;Swag\\StorefrontController\\Storefront\\Controller\\ProductController&quot; public=&quot;true&quot;&gt;\n            &lt;argument type=&quot;service&quot; id=&quot;Shopware\\Core\\Checkout\\Cart\\SalesChannel\\CartService&quot;\/&gt;\n\n            &lt;call method=&quot;setContainer&quot;&gt;\n                &lt;argument type=&quot;service&quot; id=&quot;service_container&quot;\/&gt;\n            &lt;\/call&gt;\n        &lt;\/service&gt;\n    &lt;\/services&gt;\n&lt;\/container&gt;<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Rendering Template<\/h2>\n\n\n\n<p>Lastly your Controller Action needs to return a Response object. You can render an own template via&nbsp;<code>$this-&gt;renderStorefront()<\/code>&nbsp;or forward to another action.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">public function createShopwareProduct($productDetails, SalesChannelContext \n         $salesChannelContext)\n{\n     return $this-&gt;renderStorefront(&#039;add-product.html.twig&#039;, $response);\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Triggering your controller<\/h2>\n\n\n\n<p>Now you need to trigger your custom action somehow. Add a anchor element that has an href to your route:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;a class=&quot;btn btn-primary btn-block&quot; href={{ path(&#039;storefront\/products&#039;) }}&gt;\n         Add Product\n &lt;\/a&gt;<\/pre>\n\n\n\n<p>To learn about more about this topic, there is a&nbsp;<a href=\"https:\/\/docs.shopware.com\/en\/shopware-platform-dev-en\/how-to\/custom-storefront-controller\">link<\/a>.<\/p>\n\n\n\n<p>I hope It will help you. Thanks for reading \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction This article give you a brief introduction on how to create a custom storefront controller in shopware6. If you want to create you own plugin then you need to know how to create a custom controller in storefront. Overview If you want to perform some custom business logic from your storefront , you will <a href=\"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":325,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-255709","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Custom Storefront Controller in Shopware6 - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Custom Storefront Controller in Shopware6 | How to create custom controller in shopware 6| how to create custom storefront controller.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Custom Storefront Controller in Shopware6 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Custom Storefront Controller in Shopware6 | How to create custom controller in shopware 6| how to create custom storefront controller.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-20T14:04:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-23T05:39:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prince Gupta\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prince Gupta\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/\"},\"author\":{\"name\":\"Prince Gupta\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/669b7c5067f73a7ae2204ff4aca829fd\"},\"headline\":\"Custom Storefront Controller in Shopware6\",\"datePublished\":\"2020-06-20T14:04:26+00:00\",\"dateModified\":\"2022-11-23T05:39:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/\"},\"wordCount\":222,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/\",\"url\":\"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/\",\"name\":\"Custom Storefront Controller in Shopware6 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2020-06-20T14:04:26+00:00\",\"dateModified\":\"2022-11-23T05:39:33+00:00\",\"description\":\"Custom Storefront Controller in Shopware6 | How to create custom controller in shopware 6| how to create custom storefront controller.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Custom Storefront Controller in Shopware6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/669b7c5067f73a7ae2204ff4aca829fd\",\"name\":\"Prince Gupta\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dd55a986709c72a714a8135a38f3b2cba1009ea371caec823a8547b2e01df18d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dd55a986709c72a714a8135a38f3b2cba1009ea371caec823a8547b2e01df18d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Prince Gupta\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/princegupta-wp031\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Custom Storefront Controller in Shopware6 - Webkul Blog","description":"Custom Storefront Controller in Shopware6 | How to create custom controller in shopware 6| how to create custom storefront controller.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/","og_locale":"en_US","og_type":"article","og_title":"Custom Storefront Controller in Shopware6 - Webkul Blog","og_description":"Custom Storefront Controller in Shopware6 | How to create custom controller in shopware 6| how to create custom storefront controller.","og_url":"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2020-06-20T14:04:26+00:00","article_modified_time":"2022-11-23T05:39:33+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-og.png","type":"image\/png"}],"author":"Prince Gupta","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Prince Gupta","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/"},"author":{"name":"Prince Gupta","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/669b7c5067f73a7ae2204ff4aca829fd"},"headline":"Custom Storefront Controller in Shopware6","datePublished":"2020-06-20T14:04:26+00:00","dateModified":"2022-11-23T05:39:33+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/"},"wordCount":222,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/","url":"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/","name":"Custom Storefront Controller in Shopware6 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2020-06-20T14:04:26+00:00","dateModified":"2022-11-23T05:39:33+00:00","description":"Custom Storefront Controller in Shopware6 | How to create custom controller in shopware 6| how to create custom storefront controller.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/custom-storefront-controller-in-shopware6\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Custom Storefront Controller in Shopware6"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/669b7c5067f73a7ae2204ff4aca829fd","name":"Prince Gupta","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/dd55a986709c72a714a8135a38f3b2cba1009ea371caec823a8547b2e01df18d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dd55a986709c72a714a8135a38f3b2cba1009ea371caec823a8547b2e01df18d?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Prince Gupta"},"url":"https:\/\/webkul.com\/blog\/author\/princegupta-wp031\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/255709","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/325"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=255709"}],"version-history":[{"count":4,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/255709\/revisions"}],"predecessor-version":[{"id":358370,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/255709\/revisions\/358370"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=255709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=255709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=255709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}