Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 77899

General questions about Magento 2, not specific to a minor version. Use this tag to distinguish from Magento 1. If you have issues with a specific version, please use the appropriate 'Magento-2.x' tag instead. Functionalities between Magento 2 minor versions might differ.

3 votes
Accepted

Remove VAT from products which include Tax in catalog price

Ok I figured this one out and posting in case I forget in future, but also to assist with anyone else who was looking for a solution to this problem :) So I basically resolved this using a custom tota …
SNAFU's user avatar
  • 306
3 votes

Refund part order but don't refund shipping

Ok, I figured this one out :D So basically when we run the `execute` method on the refundInvoice object, we need to send some arguments with it also. We can set those arguments using the Magento\Sal …
SNAFU's user avatar
  • 306
2 votes
2 answers
1k views

Override Shipping Rates at checkout

I am simply looking to get the shipping rates from the current quote and override them via a plugin/interceptor but have no idea where I'm going wrong here: <?php namespace Vendor\Module\Plugin\Model …
SNAFU's user avatar
  • 306
2 votes
1 answer
537 views

Refund part order but don't refund shipping

at the moment I have a function which will refund the invoice on an order. However the shipping is currently also being refunded, which I don't want. Is there a way to set the shipping to zero on an i …
SNAFU's user avatar
  • 306
1 vote
Accepted

Override Shipping Rates at checkout

Solution worked for me: <?php namespace Vendor\Model\Plugin\Model\Quote\Address\RateResult; class MethodPlugin { public function afterSetPrice($subject) { $new_price = "2.00"; …
SNAFU's user avatar
  • 306
1 vote

Custom Order API Extension Attribute Not Saving

Ok I figured this one out. So it turns out instead of setting the payload like this: { "entity":{ "entity_id":1557418, "repeat_order":"true" } } I should have set it like this because it' …
SNAFU's user avatar
  • 306
1 vote
1 answer
1k views

How to refund only part of an order programmatically

I am looking for a way to programmatically refund part of an order within a custom module. I have been following this blog post (https://www.rakeshjesadiya.com/create-creditmemo-for-order-item-in-mage …
SNAFU's user avatar
  • 306
1 vote
Accepted

Magento 2: Disable Welcome Email Using preference

$storeId = null, $sendemailStoreId = null ): void { return; } } Which essentially inverts the original functionality of the method linked here (https://github.com/magento/magento2
SNAFU's user avatar
  • 306
1 vote
1 answer
1k views

Magepack Bundle Console Error On Magento 2.4.4

After upgrading from 2.4.3-p1 to 2.4.4, the following error shows up in the console: Uncaught Error: Mismatched anonymous define() module: function( $ ) { I've traced the error back to the generated / …
SNAFU's user avatar
  • 306
1 vote
1 answer
4k views

Duplicate current quote with new ID on Magento 2

Is there a way to somehow take the existing quote and create a new one identical to it but with a new ID? This is what I currently have: Updated following suggestions from @Vishwas: use Magento\Fra …
SNAFU's user avatar
  • 306
1 vote
Accepted

Get Latest Entry For Duplicate Rows In Collection

Ok, so after a long time of troubleshooting this, I have finally resolved it. So here is the solution for anyone else who encounters a similar problem. The initial method: protected function _initSele …
SNAFU's user avatar
  • 306
1 vote
3 answers
5k views

How To Get The Tax Rate From A Product

I am looking to get the tax rate value from a product (not quote item) in a plugin, which fires on the beforeAddProduct() method. Currently I have the following in my plugin code: $taxClassId = $produ …
SNAFU's user avatar
  • 306
0 votes
1 answer
1k views

How to create a custom router with url key

I'm looking to create a custom router so that if I go to www.mysite.com/promotions/cruise-trip it would route to www.mysite/offers/promotions/index/id/5 for example. I'm not really sure how to do this …
SNAFU's user avatar
  • 306
0 votes
1 answer
271 views

Call to checkout URL redirecting to homepage

When adding a redirect to the checkout page in an Ajax done callback function, it seems to just go straight to the homepage instead: }).done(function (data) { if (data.error) { console.log …
SNAFU's user avatar
  • 306
0 votes

Call to checkout URL redirecting to homepage

It turned out to be that there was a condition which was trying to re-direct the user to the /checkout/cart page, if the customer wasn't logged in. However the /checkout/cart controller was being over …
SNAFU's user avatar
  • 306

15 30 50 per page