{"id":256233,"date":"2020-06-26T16:48:17","date_gmt":"2020-06-26T16:48:17","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=256233"},"modified":"2021-06-17T12:17:30","modified_gmt":"2021-06-17T12:17:30","slug":"how-to-change-price-of-product-in-cart-in-shopware-6","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/","title":{"rendered":"How to change price of a product in cart in Shopware 6"},"content":{"rendered":"\n<p>In this blog, you are going to learn \u201cHow to change the price of a product in the cart in  Shopware 6 at the storefront.\u201d<br>I hope you know the directory structure of&nbsp;Shopware&nbsp;6 plugin, if you don\u2019t know, see here-&nbsp;<a rel=\"noreferrer noopener\" href=\"https:\/\/webkul.com\/blog\/create-product-and-product-variant-in-shopware-6\/\" target=\"_blank\">https:\/\/docs.shopware.com\/en\/shopware-platform-dev-en\/internals\/directory-structure<\/a>.<\/p>\n\n\n\n<p>&nbsp;In this example, the prices are fetched from a database table.&nbsp;You have already created your own working plugin with a custom entity for those prices.&nbsp;&nbsp;If you don&#8217;t know that&#8217;s done have a look at <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/docs.shopware.com\/en\/shopware-platform-dev-en\/how-to\/custom-entity\" target=\"_blank\" rel=\"noreferrer noopener\">how to create a custom entity<\/a>.<\/p>\n\n\n\n<p>Entity:- ChangePriceEntity.php<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php declare(strict_types=1);\n\nnamespace Webkul\\Test\\Cart\\Checkout\\ChangePrice;\n\nuse Shopware\\Core\\Content\\Product\\ProductEntity;\nuse Shopware\\Core\\Framework\\DataAbstractionLayer\\Entity;\nuse Shopware\\Core\\Framework\\DataAbstractionLayer\\EntityIdTrait;\n\nclass ChangePriceEntity extends Entity\n{\n    use EntityIdTrait;\n\n    \/**\n     * @var ProductEntity\n     *\/\n    protected $product;\n\n    \/**\n     * @var string\n     *\/\n    protected $productId;\n\n    \/**\n     * @var float\n     *\/\n    protected $price;\n\n    public function getProduct(): ProductEntity\n    {\n        return $this-&gt;product;\n    }\n\n    public function setProduct(ProductEntity $product): void\n    {\n        $this-&gt;product = $product;\n    }\n\n    public function getProductId(): string\n    {\n        return $this-&gt;productId;\n    }\n\n    public function setProductId(string $productId): void\n    {\n        $this-&gt;productId = $productId;\n    }\n\n    public function getPrice(): float\n    {\n        return $this-&gt;price;\n    }\n\n    public function setPrice(float $price): void\n    {\n        $this-&gt;price = $price;\n    }\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Changing  the price<\/h2>\n\n\n\n<p>Change the price of the product in the cart, you should use the collector pattern. For this, you need to create your own cart collector.<br>The collector compares the product IDs of the products in the cart with the product IDs from the custom table. If there&#8217;s any match, the price has to be overwritten.<\/p>\n\n\n\n<p>All adjustments are done in the method, where the product items already own a name and a price. If no product in the cart matches your condition, you can early return in the method. Afterward,  in addition to this, you have to create a new line item for the new discount.  For the latter, you want the line item to not be stackable and it shouldn&#8217;t be removable either.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php declare(strict_types=1);\n\nnamespace Webkul\\Test\\Cart\\Checkout;\n\nuse Shopware\\Core\\Checkout\\Cart\\Cart;\nuse Shopware\\Core\\Checkout\\Cart\\CartBehavior;\nuse Shopware\\Core\\Checkout\\Cart\\CartDataCollectorInterface;\nuse Shopware\\Core\\Checkout\\Cart\\CartProcessorInterface;\nuse Shopware\\Core\\Checkout\\Cart\\LineItem\\CartDataCollection;\nuse Shopware\\Core\\Checkout\\Cart\\LineItem\\LineItem;\nuse Shopware\\Core\\Checkout\\Cart\\Price\\QuantityPriceCalculator;\nuse Shopware\\Core\\Checkout\\Cart\\Price\\Struct\\QuantityPriceDefinition;\nuse Shopware\\Core\\Framework\\DataAbstractionLayer\\EntityRepositoryInterface;\nuse Shopware\\Core\\Framework\\DataAbstractionLayer\\Search\\Criteria;\nuse Shopware\\Core\\Framework\\DataAbstractionLayer\\Search\\Filter\\EqualsAnyFilter;\nuse Shopware\\Core\\System\\SalesChannel\\SalesChannelContext;\nuse Webkul\\Test\\Cart\\Checkout\\ChangePrice\\ChangePriceeEntity;\n\nclass OverwrittenPriceCollector implements CartDataCollectorInterface, CartProcessorInterface\n{\n    \/**\n     * @var EntityRepositoryInterface\n     *\/\n    private $overwritePriceRepository;\n\n    \/**\n     * @var QuantityPriceCalculator\n     *\/\n    private $calculator;\n\n    public function __construct(\n        EntityRepositoryInterface $overwritePriceRepository,\n        QuantityPriceCalculator $calculator\n    ) {\n        $this-&gt;overwritePriceRepository = $overwritePriceRepository;\n        $this-&gt;calculator = $calculator;\n    }\n\n    public function collect(CartDataCollection $data, Cart $original, SalesChannelContext $context, CartBehavior $behavior): void\n    {\n        \/\/ get all product ids of current cart\n        $productIds = $original-&gt;getLineItems()-&gt;filterType(LineItem::PRODUCT_LINE_ITEM_TYPE)-&gt;getReferenceIds();\n\n        \/\/ remove all product ids which are already fetched from the database\n        $filtered = $this-&gt;filterAlreadyFetchedPrices($productIds, $data);\n\n        if (empty($filtered)) {\n            return;\n        }\n\n        $criteria = new Criteria();\n        $criteria-&gt;addFilter(new EqualsAnyFilter(&#039;productId&#039;, $filtered));\n\n        \/\/ fetch prices from database\n        $prices = $this-&gt;overwritePriceRepository-&gt;search($criteria, $context-&gt;getContext());;\n\n        foreach ($filtered as $id) {\n            $key = $this-&gt;buildKey($id);\n\n            $price = null;\n            \/\/ find price for the current product id\n            foreach ($prices as $current) {\n                if ($current-&gt;getProductId() === $id) {\n                    $price = $current;\n                    break;\n                }\n            }\n\n            \/\/ we have to set a value for each product id to prevent duplicate queries in next calculation\n            $data-&gt;set($key, $price);\n        }\n    }\n\n    public function process(CartDataCollection $data, Cart $original, Cart $toCalculate, SalesChannelContext $context, CartBehavior $behavior): void\n    {\n        \/\/ get all product line items\n        $products = $toCalculate-&gt;getLineItems()-&gt;filterType(LineItem::PRODUCT_LINE_ITEM_TYPE);\n\n        foreach ($products as $product) {\n            $key = $this-&gt;buildKey($product-&gt;getReferencedId());\n\n            \/\/ no overwritten price? continue with next product\n            if (!$data-&gt;has($key) || $data-&gt;get($key) === null) {\n                continue;\n            }\n\n            \/** @var OverwrittenPriceEntity $price *\/\n            $price = $data-&gt;get($key);\n\n            \/\/ build new price definition\n            $definition = new QuantityPriceDefinition(\n                $price-&gt;getPrice(),\n                $product-&gt;getPrice()-&gt;getTaxRules(),\n                $product-&gt;getPrice()-&gt;getQuantity()\n            );\n\n            \/\/ build CalculatedPrice over calculator class for overwritten price\n            $calculated = $this-&gt;calculator-&gt;calculate($definition, $context);\n\n            \/\/ set new price into line item\n            $product-&gt;setPrice($calculated);\n            $product-&gt;setPriceDefinition($definition);\n        }\n    }\n\n    private function filterAlreadyFetchedPrices(array $productIds, CartDataCollection $data): array\n    {\n        $filtered = &#091;];\n\n        foreach ($productIds as $id) {\n            $key = $this-&gt;buildKey($id);\n\n            \/\/ already fetched from database?\n            if ($data-&gt;has($key)) {\n                continue;\n            }\n\n            $filtered&#091;] = $id;\n        }\n\n        return $filtered;\n    }\n\n    private function buildKey(string $id): string\n    {\n        return &#039;price-overwrite-&#039;.$id;\n    }\n}<\/pre>\n\n\n\n<p>The respective&nbsp;<code>services.xml<\/code>, which registers the collector in the first instance. You can learn more about the <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/docs.shopware.com\/en\/shopware-platform-dev-en\/developer-guide\/services-subscriber\" target=\"_blank\" rel=\"noreferrer noopener\">service<\/a>. The cart repository is not writable so cart interface help the to edit the cart. Line item service help to remove and add the product in the cart. You can learn about this from the docs of Shopware.<\/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;Webkul\\Test\\Cart\\Checkout\\OverwrittenPriceCollector&quot;&gt;\n            &lt;argument type=&quot;service&quot; id=&quot;overwritten_price.repository&quot; \/&gt;\n            &lt;argument type=&quot;service&quot;               \n            id=&quot;Shopware\\Core\\Checkout\\Cart\\Price\\QuantityPriceCalculator&quot;\/&gt;\n            &lt;tag name=&quot;shopware.cart.processor&quot; priority=&quot;4500&quot; \/&gt;\n            &lt;tag name=&quot;shopware.cart.collector&quot; priority=&quot;4500&quot; \/&gt;\n        &lt;\/service&gt;\n    &lt;\/services&gt;\n&lt;\/container&gt;<\/pre>\n\n\n\n<p>In the service file, you have to use the tag name shopware.cart.processor and set priority to 4500.<br>The quantity price calculator function calculates the price according to the quantity of the product.<\/p>\n\n\n\n<p>I hope it will help you. Thanks for reading. Happy Coding \ud83d\ude42<br>Thank You.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, you are going to learn \u201cHow to change the price of a product in the cart in Shopware 6 at the storefront.\u201dI hope you know the directory structure of&nbsp;Shopware&nbsp;6 plugin, if you don\u2019t know, see here-&nbsp;https:\/\/docs.shopware.com\/en\/shopware-platform-dev-en\/internals\/directory-structure. &nbsp;In this example, the prices are fetched from a database table.&nbsp;You have already created your own <a href=\"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":284,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-256233","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>How to change price of a product in cart in Shopware 6 - Webkul Blog %<\/title>\n<meta name=\"description\" content=\"In this example, the prices are fetched from a database table. If you don&#039;t know that&#039;s done have a look at how to create a custom entity.\" \/>\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\/how-to-change-price-of-product-in-cart-in-shopware-6\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to change price of a product in cart in Shopware 6 - Webkul Blog %\" \/>\n<meta property=\"og:description\" content=\"In this example, the prices are fetched from a database table. If you don&#039;t know that&#039;s done have a look at how to create a custom entity.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/\" \/>\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-26T16:48:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-06-17T12:17:30+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=\"Diwakar Rana\" \/>\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=\"Diwakar Rana\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/\"},\"author\":{\"name\":\"Diwakar Rana\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/4b025fe4ecbc5c0378cd13bb70da654f\"},\"headline\":\"How to change price of a product in cart in Shopware 6\",\"datePublished\":\"2020-06-26T16:48:17+00:00\",\"dateModified\":\"2021-06-17T12:17:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/\"},\"wordCount\":342,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/\",\"name\":\"How to change price of a product in cart in Shopware 6 - Webkul Blog %\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"datePublished\":\"2020-06-26T16:48:17+00:00\",\"dateModified\":\"2021-06-17T12:17:30+00:00\",\"description\":\"In this example, the prices are fetched from a database table. If you don't know that's done have a look at how to create a custom entity.\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to change price of a product in cart in Shopware 6\"}]},{\"@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\/4b025fe4ecbc5c0378cd13bb70da654f\",\"name\":\"Diwakar Rana\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/46482d0264c191ccd0337892016340a80ca4e4987a37f42514a0506aaee7e8dc?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\/46482d0264c191ccd0337892016340a80ca4e4987a37f42514a0506aaee7e8dc?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Diwakar Rana\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/diwakar-rana829\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to change price of a product in cart in Shopware 6 - Webkul Blog %","description":"In this example, the prices are fetched from a database table. If you don't know that's done have a look at how to create a custom entity.","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\/how-to-change-price-of-product-in-cart-in-shopware-6\/","og_locale":"en_US","og_type":"article","og_title":"How to change price of a product in cart in Shopware 6 - Webkul Blog %","og_description":"In this example, the prices are fetched from a database table. If you don't know that's done have a look at how to create a custom entity.","og_url":"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2020-06-26T16:48:17+00:00","article_modified_time":"2021-06-17T12:17:30+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":"Diwakar Rana","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Diwakar Rana","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/"},"author":{"name":"Diwakar Rana","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/4b025fe4ecbc5c0378cd13bb70da654f"},"headline":"How to change price of a product in cart in Shopware 6","datePublished":"2020-06-26T16:48:17+00:00","dateModified":"2021-06-17T12:17:30+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/"},"wordCount":342,"commentCount":2,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/","url":"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/","name":"How to change price of a product in cart in Shopware 6 - Webkul Blog %","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"datePublished":"2020-06-26T16:48:17+00:00","dateModified":"2021-06-17T12:17:30+00:00","description":"In this example, the prices are fetched from a database table. If you don't know that's done have a look at how to create a custom entity.","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-change-price-of-product-in-cart-in-shopware-6\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to change price of a product in cart in Shopware 6"}]},{"@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\/4b025fe4ecbc5c0378cd13bb70da654f","name":"Diwakar Rana","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/46482d0264c191ccd0337892016340a80ca4e4987a37f42514a0506aaee7e8dc?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\/46482d0264c191ccd0337892016340a80ca4e4987a37f42514a0506aaee7e8dc?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Diwakar Rana"},"url":"https:\/\/webkul.com\/blog\/author\/diwakar-rana829\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/256233","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\/284"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=256233"}],"version-history":[{"count":13,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/256233\/revisions"}],"predecessor-version":[{"id":293100,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/256233\/revisions\/293100"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=256233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=256233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=256233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}