Questions tagged [before-plugin]

Denotes questions about Magento 2 BeforePlugins. For general questions use "plugin" tag.

Filter by
Sorted by
Tagged with
0
votes
0answers
23 views

Magento 2 system config Concatenate data to existing field with plugin beforeSave or aroundSave

I have a drop down field containing fruits where I would like to concatenate some data e.G: Using a Plugin save the data like so: Bananas are high in potassium Where are high in potassium is the ...
1
vote
3answers
57 views

Order beforeSave plugin throws TypeError

I've built a plugin that catches the order beforeSave event in order to add some extra data to the an order attribute. The problem is that when this plugin fires it causes an error: Uncaught ...
4
votes
1answer
69 views

Magento 2 :How to change or update request data using beforeExecute plugin?

i just want to change some request params by using beforeExecute plugin so can i do same.... ? etc/di.xml ** <type name="Magento\Customer\Controller\Account\CreatePassword"> <plugin ...
2
votes
1answer
28 views

Around Plugins ( Interceptors) in magento can be used to suppress before and after plugin execution?

In around plugin function, if we don't use proceed() then after plugin execution will be suppressed. Is there anyway by which we can suppress before plugin execution?
2
votes
1answer
32 views

get Coupon Code in beforePlaceOrder

Hello I want to get the coupon code in a plugin. My code is: private $logger; private $checkoutSession; public function __construct( \Psr\Log\LoggerInterface $logger, \Magento\Checkout\...
2
votes
1answer
51 views

how to save product name dynamically

for example i have 3 product attributes color ,size ,location. i do not want to enter product name instead of it should save combination of color,size,location. product name. 'red color small in new ...
0
votes
0answers
119 views

before plugin parameter magento 2

I am writing a before plugin for below public method. public function setup($user,$pass,$url = null){ $this->username = $user; $this->password = $pass; if ($url) { ...
0
votes
1answer
68 views

Observer or plugin use before the invoice creation

I have create custom attribute("current_seller_id") in sales_invoice_item and now want to save some value in this column how can i do this. Actually i already save the value in sale_order_item table ...
1
vote
0answers
62 views

Magento 2:"TypeError: Argument 1 passed to Test\HelloMagento\Plugin\ExamplePlugin::beforeSetTitle()

di.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd"> <type ...
4
votes
1answer
194 views

On what basis we need to pass the plugin parameters?how we know what should be pass?what's logic behind it?

My requirement is here:- I have a Game booking requirement in Magento 2, just like online movie booking(e.g- booking movie from Bookmyshow, Paytm etc). there is fix number of tickets in each slot ...
1
vote
2answers
406 views

Plugin Before Onepage Dispatch

I have the following plugin: <?php namespace Company\Module\Plugin; class DisableLoginCheckout { /** * @var \Magento\Customer\Model\Session */ protected $customerSession; /*...
0
votes
1answer
46 views

Before plugin for Submit query method

I am trying to create before plugin for SubmitQuote method of Magento\Quote\Model\QuoteManagement but plugin is not hitting. Its a api req so i have declared the plugin in /etc/webapi_rest/di.xml. ...