Linked Questions

3 votes
1 answer
1k views

Argument passing error in after plugin

I am trying to create after plugin for delete function of Magento\Tax\Model\TaxRuleRepository function looks like follows public function delete(TaxRuleInterface $rule) { $ruleId = $rule-...
1 vote
1 answer
3k views

Get Tax class name from id in magento2

I have used below code to get tax class name from id. $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $taxClassObj = $objectManager->create('Magento\Tax\Model\TaxClass\Source ...
10 votes
3 answers
16k views

Magento 2 : Add Custom Tax Amount In Cart Programatically

I want to add custom tax amount to checkout cart programmatically. Here is the example. Cart Old Tax = 4.21 Custom Tax = 2 New Tax = 4.21 + 2 = 6 Check the screenshot below. I need this done ...
1 vote
2 answers
8k views

How to change the price in quote while adding product to cart?

I want to apply a custom price for the current order. I read that I should use sales_quote_add_item, But its looks like I am doing something wrong. I found some tutorials for magento1 but not for ...
0 votes
3 answers
562 views

Custom price in cart not working in Magento 2.3.1 observer

I am developing a magento site for furniture sale. I have some grouped products. If a customer add 1 piece of any product of the group to cart, the special price will be added to cart. If the ...
1 vote
2 answers
4k views

how to update tax amount with custom price in magento 2

HOW TO UPDATE TAX WITH CUSTOM VALUE IN CART OR CHECKOUT.My requirement was when customer click add to cart and he move to cart that time i want to update tax with some API so do the needful.
6 votes
4 answers
2k views

Magento2 : How to get equivalent class of "Mage::getModel('tax/calculation')"?

I am trying to convert below code in magento2. I'm unable to find equivalent class of Mage::getModel('tax/calculation') in Magento2. $taxCalculation = Mage::getModel('tax/calculation'); $request = $...
3 votes
1 answer
663 views

Magento 2 create ajax request from out of magento

I wanna create Ajax request from empty HTML with jQuery. I do like this $.ajax({ url: "http://****.com/rest/V1/integration/admin/token?username=***&password=****", type: "POST", ...
1 vote
2 answers
90 views

What are the best blogs for Magento 2 tutorial?

I'm learning Magento 2 and would like to improve my skill in Magento. I can see that there are a lot of blogs available for Magento tutorial but, could you please suggest me the best blog for Magento ...
0 votes
2 answers
272 views

Magento 2.3: How To Get The Primary Key From URL...?

I'm very new to Magneto 2.3, I'm trying to get the primary key from URL, this is my code: This is my import button, on click of this button, a function hit. /app/code/EC/Customimport/view/adminhtml/...
3 votes
1 answer
2k views

Magento 2 - Facebook pixel tracking on AddToCart event

Note: Before marking it as duplicate please read description carefully I am creating a module for Facebook pixel tracking and I am stuck at AddToCart event. I have seen some 3rd party extensions, ...
0 votes
1 answer
674 views

Create/Update Attribute Option Custom api issue

I have created custom rest api to create/update attribute options by attribute_id. Here is my webapi.xml file code. <route url="/V1/attribute/AttributeOption" method="POST"> <service ...
1 vote
1 answer
103 views

Add to cart not working in custom template magento2

I am getting add to cart url by product object like below. Block file. use Magento\Catalog\Api\ProductRepositoryInterface; use \Magento\Checkout\Helper\Cart as CartHelper; class CustomAdd ...
0 votes
1 answer
168 views

How to add tax amount in old orders in Magento-2.1?

I have some orders is placed, when tax rule is not build. After some times, I will create tax rule. Now all orders is placed with tax rules. But I want to add tax rule in old orders. How can I do this ...
1 vote
1 answer
3k views

Magento 2 : Add discount and tax in order programmatically

I used below link to place an order, but in that, I cannot get any solution. how to add the tax or discount in order so anyone has done this thing? please help to solve this issue. http://www....

15 30 50 per page