{"id":55223,"date":"2021-12-20T05:59:34","date_gmt":"2021-12-20T05:59:34","guid":{"rendered":"https:\/\/www.icreativetechnologies.com\/?p=5433"},"modified":"2021-12-20T05:59:34","modified_gmt":"2021-12-20T05:59:34","slug":"change-the-price-of-items-in-cart","status":"publish","type":"post","link":"https:\/\/www.icreativetechnologies.com\/de\/change-the-price-of-items-in-cart\/","title":{"rendered":"How To Change Price Of Items In Cart &#8211; Shopware 6 Development"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">If you want to change price of Items in cart then you can use a cart collector and a cart processor.\u00a0<\/span><\/p>\n<h2>The collector<\/h2>\n<p><span style=\"font-weight: 400;\">The Collector collects all the necessary data for line items. It will also take care of reducing duplicated requests, but we&#8217;ll get into that later.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This guide will not cover where to actually fetch the new prices from, that&#8217;s up to you. This could e.g. be an <\/span><a href=\"https:\/\/developer.shopware.com\/docs\/guides\/plugins\/plugins\/framework\/data-handling\/add-complex-data-to-existing-entities\"><span style=\"font-weight: 400;\">extension of the product entity<\/span><\/a><span style=\"font-weight: 400;\">, which contains the new price, or an API call from somewhere else, which will return the new price.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Your collector class has to implement the interface Shopware\\Core\\Checkout\\Cart\\CartDataCollectorInterface and therefore the method collect.<\/span><\/p>\n<div class=\"shopware-blog-code\" style=\"padding-left: 0px !important;\">\n<table style=\"margin-left: 0px !important;\">\n<tbody>\n<tr>\n<td style=\"border: none;\"><span style=\"font-weight: 400;\">&lt;?php declare(strict_types=1);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">namespace ICT\\BasicExample\\Core\\Checkout\\Cart;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">use Shopware\\Core\\Checkout\\Cart\\Cart;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">use Shopware\\Core\\Checkout\\Cart\\CartBehavior;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">use Shopware\\Core\\Checkout\\Cart\\CartDataCollectorInterface;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">use Shopware\\Core\\Checkout\\Cart\\LineItem\\CartDataCollection;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">use Shopware\\Core\\Checkout\\Cart\\LineItem\\LineItem;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">use Shopware\\Core\\System\\SalesChannel\\SalesChannelContext;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">class OverwritePriceCollector implements CartDataCollectorInterface<\/span><\/p>\n<p><span style=\"font-weight: 400;\">{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0public function collect(CartDataCollection $data, Cart $original, SalesChannelContext $context, CartBehavior $behavior): void<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ get all product ids of current cart<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$productIds = $original-&gt;getLineItems()-&gt;filterType(LineItem::PRODUCT_LINE_ITEM_TYPE)-&gt;getReferenceIds();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ remove all product ids which are already fetched from the database<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$filtered = $this-&gt;filterAlreadyFetchedPrices($productIds, $data);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ Skip execution if there are no prices to be requested &amp; saved<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (empty($filtered)) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0foreach ($filtered as $id) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$key = $this-&gt;buildKey($id);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ Needs implementation, just an example<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$newPrice = $this-&gt;doSomethingToGetNewPrice();<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ we have to set a value for each product id to prevent duplicate queries in next calculation<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$data-&gt;set($key, $newPrice);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0private function filterAlreadyFetchedPrices(array $productIds, CartDataCollection $data): array<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$filtered = [];<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0foreach ($productIds as $id) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$key = $this-&gt;buildKey($id);<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\/\/ already fetched from database?<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if ($data-&gt;has($key)) {<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0continue;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$filtered[] = $id;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return $filtered;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0private function buildKey(string $id): string<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0{<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return &#8216;price-overwrite-&#8216;.$id;<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0}<\/span><\/p>\n<p><span style=\"font-weight: 400;\">}<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><span style=\"font-weight: 400;\"><strong>Weiterlesen<\/strong>: <a href=\"https:\/\/www.icreativetechnologies.com\/de\/shopware-6-plugin-cross-selling-and-up-selling-in-the-cart-increases-order-value\/\" target=\"_blank\" rel=\"noopener\">Shopware 6 Plugin: Cross-Selling and Up-Selling in the Cart<\/a><\/span><\/p>\n<p><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">So the example class is called <\/span><span style=\"font-weight: 400;\">OverwritePriceCollector<\/span><span style=\"font-weight: 400;\"> here and it implements the method collect. This method&#8217;s parameters are the following:<\/span><\/p>\n<ul>\n<li><strong>CartDataCollection<\/strong><span style=\"font-weight: 400;\">: This is the object, that will contain our new data, which is then processed in the processor.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Here you&#8217;re going to save the new price. It contains key-value pairs, so we will save the new price as the value, it&#8217;s key <\/span><span style=\"font-weight: 400;\">being the line item ID. We will prefix a custom string to the line item ID, so our code will not interfere with other collectors, <\/span><span style=\"font-weight: 400;\">that might also save the line item ID as a key.\u00a0<\/span><\/p>\n<ul>\n<li><strong>Cart<\/strong><span style=\"font-weight: 400;\">: Well, the current cart and its line items.<\/span><\/li>\n<li><strong>SalesChannelContext<\/strong><span style=\"font-weight: 400;\">: The current sales channel context, containing information about the currency, the country, etc.<\/span><\/li>\n<li style=\"font-weight: 400;\"><strong>CartBehavior<\/strong><span style=\"font-weight: 400;\">: It contains cart permissions, which are not necessary for our example.<\/span><\/li>\n<\/ul>\n<h2>The processor<\/h2>\n<p><span style=\"font-weight: 400;\">The processor is only used for collecting prices and calculating them appropriately and applying them to the line items.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The processor now has to fetch the new prices from the <\/span><span style=\"font-weight: 400;\">CartDataCollector<\/span><span style=\"font-weight: 400;\"> and it has to calculate the actual new price of that line item, e.g. due to taxes. For this case, it will need the Shopware\\Core\\Checkout\\Cart\\Price\\QuantityPriceCalculator.<\/span><\/p>\n<div class=\"shopware-blog-code\" style=\"padding-left: 0px !important;\">\n<table style=\"margin-left: 0px !important;\">\n<tbody>\n<tr>\n<td style=\"border: none;\">&lt;?php declare(strict_types=1);<\/p>\n<p>namespace <span style=\"font-weight: 400;\">ICT<\/span>\\BasicExample\\Core\\Checkout\\Cart;<\/p>\n<p>use Shopware\\Core\\Checkout\\Cart\\Cart;<\/p>\n<p>use Shopware\\Core\\Checkout\\Cart\\CartBehavior;<\/p>\n<p>use Shopware\\Core\\Checkout\\Cart\\CartDataCollectorInterface;<\/p>\n<p>use Shopware\\Core\\Checkout\\Cart\\CartProcessorInterface;<\/p>\n<p>use Shopware\\Core\\Checkout\\Cart\\LineItem\\CartDataCollection;<\/p>\n<p>use Shopware\\Core\\Checkout\\Cart\\LineItem\\LineItem;<\/p>\n<p>use Shopware\\Core\\Checkout\\Cart\\Price\\QuantityPriceCalculator;<\/p>\n<p>use Shopware\\Core\\Checkout\\Cart\\Price\\Struct\\QuantityPriceDefinition;<\/p>\n<p>use Shopware\\Core\\System\\SalesChannel\\SalesChannelContext;<\/p>\n<p>class OverwritePriceCollector implements CartDataCollectorInterface, CartProcessorInterface<\/p>\n<p>{<\/p>\n<p>private QuantityPriceCalculator $calculator;<\/p>\n<p>public function __construct(QuantityPriceCalculator $calculator) {<\/p>\n<p>$this-&gt;calculator = $calculator;<\/p>\n<p>}<\/p>\n<p>public function collect(CartDataCollection $data, Cart $original, SalesChannelContext $context, CartBehavior $behavior): void<\/p>\n<p>{<\/p>\n<p>\/\/ get all product ids of current cart<\/p>\n<p>$productIds = $original-&gt;getLineItems()-&gt;filterType(LineItem::PRODUCT_LINE_ITEM_TYPE)-&gt;getReferenceIds();<\/p>\n<p>\/\/ remove all product ids which are already fetched from the database<\/p>\n<p>$filtered = $this-&gt;filterAlreadyFetchedPrices($productIds, $data);<\/p>\n<p>\/\/ Skip execution if there are no prices to be saved<\/p>\n<p>if (empty($filtered)) {<\/p>\n<p>return;<\/p>\n<p>}<\/p>\n<p>foreach ($filtered as $id) {<\/p>\n<p>$key = $this-&gt;buildKey($id);<\/p>\n<p>\/\/ Needs implementation, just an example<\/p>\n<p>$newPrice = $this-&gt;doSomethingToGetNewPrice();<\/p>\n<p>\/\/ we have to set a value for each product id to prevent duplicate queries in next calculation<\/p>\n<p>$data-&gt;set($key, $newPrice);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>public function process(CartDataCollection $data, Cart $original, Cart $toCalculate, SalesChannelContext $context, CartBehavior $behavior): void<\/p>\n<p>{<\/p>\n<p>\/\/ get all product line items<\/p>\n<p>$products = $toCalculate-&gt;getLineItems()-&gt;filterType(LineItem::PRODUCT_LINE_ITEM_TYPE);<\/p>\n<p>foreach ($products as $product) {<\/p>\n<p>$key = $this-&gt;buildKey($product-&gt;getReferencedId());<\/p>\n<p>\/\/ no overwritten price? continue with next product<\/p>\n<p>if (!$data-&gt;has($key) || $data-&gt;get($key) === null) {<\/p>\n<p>continue;<\/p>\n<p>}<\/p>\n<p>$newPrice = $data-&gt;get($key);<\/p>\n<p>\/\/ build new price definition<\/p>\n<p>$definition = new QuantityPriceDefinition(<\/p>\n<p>$newPrice,<\/p>\n<p>$product-&gt;getPrice()-&gt;getTaxRules(),<\/p>\n<p>$product-&gt;getPrice()-&gt;getQuantity()<\/p>\n<p>);<\/p>\n<p>\/\/ build CalculatedPrice over calculator class for overwritten price<\/p>\n<p>$calculated = $this-&gt;calculator-&gt;calculate($definition, $context);<\/p>\n<p>\/\/ set new price into line item<\/p>\n<p>$product-&gt;setPrice($calculated);<\/p>\n<p>$product-&gt;setPriceDefinition($definition);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>private function filterAlreadyFetchedPrices(array $productIds, CartDataCollection $data): array<\/p>\n<p>{<\/p>\n<p>$filtered = [];<\/p>\n<p>foreach ($productIds as $id) {<\/p>\n<p>$key = $this-&gt;buildKey($id);<\/p>\n<p>\/\/ already fetched from database?<\/p>\n<p>if ($data-&gt;has($key)) {<\/p>\n<p>continue;<\/p>\n<p>}<\/p>\n<p>$filtered[] = $id;<\/p>\n<p>}<\/p>\n<p>return $filtered;<\/p>\n<p>}<\/p>\n<p>private function buildKey(string $id): string<\/p>\n<p>{<\/p>\n<p>return &#8216;price-overwrite-&#8216;.$id;<\/p>\n<p>}<\/p>\n<p>}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><span style=\"font-weight: 400;\">First of all, note the second interface we implemented, next to the <\/span><span style=\"font-weight: 400;\">CartDataCollectorInterface<\/span><span style=\"font-weight: 400;\">. We also added a constructor in order to inject the <\/span><span style=\"font-weight: 400;\">QuantityPriceCalculator<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">But now, let&#8217;s have a look at the process method. You should already be familiar with most of its parameters since they&#8217;re mostly the same with those of the collector. Yet, there&#8217;s one main\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">difference: Next to the<\/span><span style=\"font-weight: 400;\"> $original<\/span><span style=\"font-weight: 400;\"> Cart, you&#8217;ve got another Cart parameter being called $toCalculatehere. Make sure to do all the changes on the<\/span><span style=\"font-weight: 400;\"> $toCalculate<\/span><span style=\"font-weight: 400;\"> instance, since this is\u00a0<\/span><span style=\"font-weight: 400;\">the cart that&#8217;s going to be considered in the end. The $original one is just there, because it may contain necessary data for the actual cart instance.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Now let&#8217;s have a look inside the process method.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We start by filtering all line items down to only products, just like we did in the collect method. Then we&#8217;re iterating over all products found, building the unique key, which is necessary for fetching the new price from the <\/span><span style=\"font-weight: 400;\">CartDataCollector<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If there&#8217;s no price to be processed saved in the <\/span><span style=\"font-weight: 400;\">CartDataCollector<\/span><span style=\"font-weight: 400;\">, there&#8217;s nothing to do here. Otherwise, we&#8217;re fetching the new price, we&#8217;re building a new instance of a\u00a0<\/span><span style=\"font-weight: 400;\">QuantityPriceDefinition containing the new price. Using that instance, we can calculate the actual new price using the previously injected <\/span><span style=\"font-weight: 400;\">QuantityPriceCalculator<\/span><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><b>NOTE: <\/b><span style=\"font-weight: 400;\">Do not query the database in the process method. Make sure to always use a collector for that.<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>If you want to change price of Items in cart then you [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":18447,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[86],"tags":[],"class_list":["post-55223","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shopware"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Change Price Of Items In Cart - Shopware 6 Development<\/title>\n<meta name=\"description\" content=\"How to Change the Price of Items in Cart- Shopware 6 Development blog by certified developer. Cart collector &amp; processor to change prices in cart\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Change Price Of Items In Cart - Shopware 6 Development\" \/>\n<meta property=\"og:description\" content=\"How to Change the Price of Items in Cart- Shopware 6 Development blog by certified developer. Cart collector &amp; processor to change prices in cart\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.icreativetechnologies.com\/de\/change-the-price-of-items-in-cart\/\" \/>\n<meta property=\"og:site_name\" content=\"iCreative Technologies\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-20T05:59:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.icreativetechnologies.com\/wp-content\/uploads\/2021\/12\/2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"960\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Rajanik Bambhaniya - Shopware 6 Team Lead\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rajanik Bambhaniya - Shopware 6 Team Lead\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"5\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/change-the-price-of-items-in-cart\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/change-the-price-of-items-in-cart\\\/\"},\"author\":{\"name\":\"Rajanik Bambhaniya - Shopware 6 Team Lead\",\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/#\\\/schema\\\/person\\\/66d9c33c2e2e219aafa7f95176cce629\"},\"headline\":\"How To Change Price Of Items In Cart &#8211; Shopware 6 Development\",\"datePublished\":\"2021-12-20T05:59:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/change-the-price-of-items-in-cart\\\/\"},\"wordCount\":1110,\"publisher\":{\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/change-the-price-of-items-in-cart\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/2.png\",\"articleSection\":[\"Shopware\"],\"inLanguage\":\"de\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/change-the-price-of-items-in-cart\\\/\",\"url\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/change-the-price-of-items-in-cart\\\/\",\"name\":\"How To Change Price Of Items In Cart - Shopware 6 Development\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/change-the-price-of-items-in-cart\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/change-the-price-of-items-in-cart\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/2.png\",\"datePublished\":\"2021-12-20T05:59:34+00:00\",\"description\":\"How to Change the Price of Items in Cart- Shopware 6 Development blog by certified developer. Cart collector & processor to change prices in cart\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/change-the-price-of-items-in-cart\\\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.icreativetechnologies.com\\\/change-the-price-of-items-in-cart\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/change-the-price-of-items-in-cart\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/2.png\",\"contentUrl\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/2.png\",\"width\":1920,\"height\":960,\"caption\":\"2\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/change-the-price-of-items-in-cart\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Change Price Of Items In Cart &#8211; Shopware 6 Development\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/#website\",\"url\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/\",\"name\":\"iCreative Technologies\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/#organization\",\"name\":\"iCreative Technologies\",\"url\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/logo-e1628229333795.png.png\",\"contentUrl\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/wp-content\\\/uploads\\\/2024\\\/11\\\/logo-e1628229333795.png.png\",\"width\":240,\"height\":66,\"caption\":\"iCreative Technologies\"},\"image\":{\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.icreativetechnologies.com\\\/#\\\/schema\\\/person\\\/66d9c33c2e2e219aafa7f95176cce629\",\"name\":\"Rajanik Bambhaniya - Shopware 6 Team Lead\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab8ee394ffda3b27429710e11341d6b1c3d8f608fc12db315b94e7adbb74c19a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab8ee394ffda3b27429710e11341d6b1c3d8f608fc12db315b94e7adbb74c19a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab8ee394ffda3b27429710e11341d6b1c3d8f608fc12db315b94e7adbb74c19a?s=96&d=mm&r=g\",\"caption\":\"Rajanik Bambhaniya - Shopware 6 Team Lead\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Change Price Of Items In Cart - Shopware 6 Development","description":"How to Change the Price of Items in Cart- Shopware 6 Development blog by certified developer. Cart collector & processor to change prices in cart","robots":{"index":"noindex","follow":"follow"},"og_locale":"de_DE","og_type":"article","og_title":"How To Change Price Of Items In Cart - Shopware 6 Development","og_description":"How to Change the Price of Items in Cart- Shopware 6 Development blog by certified developer. Cart collector & processor to change prices in cart","og_url":"https:\/\/www.icreativetechnologies.com\/de\/change-the-price-of-items-in-cart\/","og_site_name":"iCreative Technologies","article_published_time":"2021-12-20T05:59:34+00:00","og_image":[{"width":1920,"height":960,"url":"https:\/\/www.icreativetechnologies.com\/wp-content\/uploads\/2021\/12\/2.png","type":"image\/png"}],"author":"Rajanik Bambhaniya - Shopware 6 Team Lead","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Rajanik Bambhaniya - Shopware 6 Team Lead","Gesch\u00e4tzte Lesezeit":"5\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.icreativetechnologies.com\/change-the-price-of-items-in-cart\/#article","isPartOf":{"@id":"https:\/\/www.icreativetechnologies.com\/change-the-price-of-items-in-cart\/"},"author":{"name":"Rajanik Bambhaniya - Shopware 6 Team Lead","@id":"https:\/\/www.icreativetechnologies.com\/#\/schema\/person\/66d9c33c2e2e219aafa7f95176cce629"},"headline":"How To Change Price Of Items In Cart &#8211; Shopware 6 Development","datePublished":"2021-12-20T05:59:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.icreativetechnologies.com\/change-the-price-of-items-in-cart\/"},"wordCount":1110,"publisher":{"@id":"https:\/\/www.icreativetechnologies.com\/#organization"},"image":{"@id":"https:\/\/www.icreativetechnologies.com\/change-the-price-of-items-in-cart\/#primaryimage"},"thumbnailUrl":"https:\/\/www.icreativetechnologies.com\/wp-content\/uploads\/2021\/12\/2.png","articleSection":["Shopware"],"inLanguage":"de"},{"@type":"WebPage","@id":"https:\/\/www.icreativetechnologies.com\/change-the-price-of-items-in-cart\/","url":"https:\/\/www.icreativetechnologies.com\/change-the-price-of-items-in-cart\/","name":"How To Change Price Of Items In Cart - Shopware 6 Development","isPartOf":{"@id":"https:\/\/www.icreativetechnologies.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.icreativetechnologies.com\/change-the-price-of-items-in-cart\/#primaryimage"},"image":{"@id":"https:\/\/www.icreativetechnologies.com\/change-the-price-of-items-in-cart\/#primaryimage"},"thumbnailUrl":"https:\/\/www.icreativetechnologies.com\/wp-content\/uploads\/2021\/12\/2.png","datePublished":"2021-12-20T05:59:34+00:00","description":"How to Change the Price of Items in Cart- Shopware 6 Development blog by certified developer. Cart collector & processor to change prices in cart","breadcrumb":{"@id":"https:\/\/www.icreativetechnologies.com\/change-the-price-of-items-in-cart\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.icreativetechnologies.com\/change-the-price-of-items-in-cart\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.icreativetechnologies.com\/change-the-price-of-items-in-cart\/#primaryimage","url":"https:\/\/www.icreativetechnologies.com\/wp-content\/uploads\/2021\/12\/2.png","contentUrl":"https:\/\/www.icreativetechnologies.com\/wp-content\/uploads\/2021\/12\/2.png","width":1920,"height":960,"caption":"2"},{"@type":"BreadcrumbList","@id":"https:\/\/www.icreativetechnologies.com\/change-the-price-of-items-in-cart\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.icreativetechnologies.com\/"},{"@type":"ListItem","position":2,"name":"How To Change Price Of Items In Cart &#8211; Shopware 6 Development"}]},{"@type":"WebSite","@id":"https:\/\/www.icreativetechnologies.com\/#website","url":"https:\/\/www.icreativetechnologies.com\/","name":"iCreative Technologies","description":"","publisher":{"@id":"https:\/\/www.icreativetechnologies.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.icreativetechnologies.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/www.icreativetechnologies.com\/#organization","name":"iCreative Technologies","url":"https:\/\/www.icreativetechnologies.com\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.icreativetechnologies.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.icreativetechnologies.com\/wp-content\/uploads\/2024\/11\/logo-e1628229333795.png.png","contentUrl":"https:\/\/www.icreativetechnologies.com\/wp-content\/uploads\/2024\/11\/logo-e1628229333795.png.png","width":240,"height":66,"caption":"iCreative Technologies"},"image":{"@id":"https:\/\/www.icreativetechnologies.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.icreativetechnologies.com\/#\/schema\/person\/66d9c33c2e2e219aafa7f95176cce629","name":"Rajanik Bambhaniya - Shopware 6 Team Lead","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/secure.gravatar.com\/avatar\/ab8ee394ffda3b27429710e11341d6b1c3d8f608fc12db315b94e7adbb74c19a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ab8ee394ffda3b27429710e11341d6b1c3d8f608fc12db315b94e7adbb74c19a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ab8ee394ffda3b27429710e11341d6b1c3d8f608fc12db315b94e7adbb74c19a?s=96&d=mm&r=g","caption":"Rajanik Bambhaniya - Shopware 6 Team Lead"}}]}},"_links":{"self":[{"href":"https:\/\/www.icreativetechnologies.com\/de\/wp-json\/wp\/v2\/posts\/55223","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.icreativetechnologies.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.icreativetechnologies.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.icreativetechnologies.com\/de\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.icreativetechnologies.com\/de\/wp-json\/wp\/v2\/comments?post=55223"}],"version-history":[{"count":0,"href":"https:\/\/www.icreativetechnologies.com\/de\/wp-json\/wp\/v2\/posts\/55223\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.icreativetechnologies.com\/de\/wp-json\/wp\/v2\/media\/18447"}],"wp:attachment":[{"href":"https:\/\/www.icreativetechnologies.com\/de\/wp-json\/wp\/v2\/media?parent=55223"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.icreativetechnologies.com\/de\/wp-json\/wp\/v2\/categories?post=55223"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.icreativetechnologies.com\/de\/wp-json\/wp\/v2\/tags?post=55223"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}