#StackBounty: #magento2 #magento-2.1 #php Magento-2 Custom product price not working for multi-shipping checkout

Bounty: 50

Custom product price not working for multi shipping checkout.

Here is my code for the custom product price

appcodeCustomModuleetcfrontendevents.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
 <event name="checkout_cart_product_add_after">
     <observer name="customprice" instance="CustomModuleObserverCustomprice" />
 </event>
</config>

appcodeCustomModuleObserverCustomprice.php

<?php
namespace CustomModuleObserver;
use MagentoFrameworkEventObserverInterface;
use MagentoFrameworkAppRequestInterface;

class Customprice implements ObserverInterface
{
 public function execute(MagentoFrameworkEventObserver $observer) {
     $item = $observer->getEvent()->getData('quote_item');
     $item = ( $item->getParentItem() ? $item->getParentItem() : $item );
     $price = 100; //set your price here
     $item->setCustomPrice($price);
        $item->setOriginalCustomPrice($price);
        $item->getProduct()->setIsSuperMode(true);
 }

}


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.