Getting parameters in sales_order_place_before event's observerGetting Product Price Null At Observerobserver method sales_order_place_after not executingMagento Observer object not containing anythingChange order status in observersales_order_place_before Observer Event not working in Magento 2Magento2: How to get shipping method in order using observer `sales_order_save_after`?Magento Event HandlingMagento order-data showing null in sales_order_place_before observermagento 2 exit without placing order sales_order_place_before event observerGet total in observer sales_order_place_before
Fair way to split coins
How are passwords stolen from companies if they only store hashes?
Print last inputted byte
Animating wave motion in water
Help with identifying unique aircraft over NE Pennsylvania
Recursively updating the MLE as new observations stream in
When did hardware antialiasing start being available?
Why doesn't the fusion process of the sun speed up?
Isn't the word "experience" wrongly used in this context?
Was World War I a war of liberals against authoritarians?
How to find the largest number(s) in a list of elements, possibly non-unique?
What is the tangent at a sharp point on a curve?
How can an organ that provides biological immortality be unable to regenerate?
UK Tourist Visa- Enquiry
How can a new country break out from a developed country without war?
Determine voltage drop over 10G resistors with cheap multimeter
What is the reasoning behind standardization (dividing by standard deviation)?
Why is there so much iron?
Air travel with refrigerated insulin
"Marked down as someone wanting to sell shares." What does that mean?
Could any one tell what PN is this Chip? Thanks~
PTIJ: At the Passover Seder, is one allowed to speak more than once during Maggid?
Pre-Employment Background Check With Consent For Future Checks
Can other pieces capture a threatening piece and prevent a checkmate?
Getting parameters in sales_order_place_before event's observer
Getting Product Price Null At Observerobserver method sales_order_place_after not executingMagento Observer object not containing anythingChange order status in observersales_order_place_before Observer Event not working in Magento 2Magento2: How to get shipping method in order using observer `sales_order_save_after`?Magento Event HandlingMagento order-data showing null in sales_order_place_before observermagento 2 exit without placing order sales_order_place_before event observerGet total in observer sales_order_place_before
I am using $request = $observer->getRequest();
in my observer method but it is not returning anything. i am using sales_order_place_before
event.
magento-1.9 event-observer
add a comment |
I am using $request = $observer->getRequest();
in my observer method but it is not returning anything. i am using sales_order_place_before
event.
magento-1.9 event-observer
$request = $observer->getEvent()->getRequest(); $params = $request->getParams();
– Bill
Nov 24 '15 at 7:43
add a comment |
I am using $request = $observer->getRequest();
in my observer method but it is not returning anything. i am using sales_order_place_before
event.
magento-1.9 event-observer
I am using $request = $observer->getRequest();
in my observer method but it is not returning anything. i am using sales_order_place_before
event.
magento-1.9 event-observer
magento-1.9 event-observer
asked Nov 24 '15 at 6:03
veduvedu
39711033
39711033
$request = $observer->getEvent()->getRequest(); $params = $request->getParams();
– Bill
Nov 24 '15 at 7:43
add a comment |
$request = $observer->getEvent()->getRequest(); $params = $request->getParams();
– Bill
Nov 24 '15 at 7:43
$request = $observer->getEvent()->getRequest(); $params = $request->getParams();
– Bill
Nov 24 '15 at 7:43
$request = $observer->getEvent()->getRequest(); $params = $request->getParams();
– Bill
Nov 24 '15 at 7:43
add a comment |
6 Answers
6
active
oldest
votes
To get Request parameters in the Observer, use following code
Mage::app()->getRequest()->getParams();
To get post variable
Mage::app()->getRequest()->getPost('your-param');
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
add a comment |
you can get shipping and billing array with below code
$shipping=Mage::app()->getRequest()->getPost('shipping');
$billing=Mage::app()->getRequest()->getPost('billing');
$yourfieldname=Mage::app()->getRequest()->getPost('yourfieldname');
Thank you for your answer. My field name is delivery_day and I am printing Mage::log(Mage::app()->getRequest()->getPost('delivery_day')); but, it is not printing anything.
– vedu
Nov 24 '15 at 6:53
can you post the input field so i can check that?
– Qaisar Satti
Nov 24 '15 at 6:55
<select name="delivery_day" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
– vedu
Nov 24 '15 at 6:56
I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then i was accessing parameter by $request->getParam('delivery_day').
– vedu
Nov 24 '15 at 6:58
use this eventcheckout_type_onepage_save_order_after
use in billing array<select name="billing[delivery_day]" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
and get it $billing['delivery_day'];
– Qaisar Satti
Nov 24 '15 at 7:03
|
show 10 more comments
Use the following code to resolve your query:
public function yourFunction(Varien_Event_Observer $observer)
$order = $observer->getEvent();
echo $order->getOrder()->getPayment()->getMethod(); // get selected paymante method
$quote = Mage::getSingleton('checkout/session')->getQuote();
echo $quote->getBillingAddress()->getTelephone(); // get billing address phone number
add a comment |
You may also try with below code to read all the parameters
$orders = $observer->getData();
echo '<pre>'; print_r($orders); echo '</pre>';
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
You may use $data = Mage::app()->getRequest()->getParams(); to get the data
– Vick
Nov 24 '15 at 6:47
add a comment |
As you can see from Mage_Sales_Model_Order::place()
, the only available data for this event is order
. To access the request object inside your event observer, you can do something like:
$request = Mage::app()->getRequest();
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
See my answer above: you don't have access to the request from the observer data, but you can still get the request object by calling$request = Mage::app()->getRequest();
in your event observer.
– fmrng
Nov 24 '15 at 6:42
That code is returing : Mage_Core_Controller_Request_Http Object array but there are different parameters present and parameters those I want are not present.
– vedu
Nov 24 '15 at 6:46
add a comment |
public function yourFunction(Varien_Event_Observer $observer)
$order = $observer->getEvent();
echo $order->getOrder()->getPayment()->getMethod(); // get selected paymante method
$quote = Mage::getSingleton('checkout/session')->getQuote();
echo $quote->getBillingAddress()->getTelephone(); // get billing address phone number
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f91326%2fgetting-parameters-in-sales-order-place-before-events-observer%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
To get Request parameters in the Observer, use following code
Mage::app()->getRequest()->getParams();
To get post variable
Mage::app()->getRequest()->getPost('your-param');
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
add a comment |
To get Request parameters in the Observer, use following code
Mage::app()->getRequest()->getParams();
To get post variable
Mage::app()->getRequest()->getPost('your-param');
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
add a comment |
To get Request parameters in the Observer, use following code
Mage::app()->getRequest()->getParams();
To get post variable
Mage::app()->getRequest()->getPost('your-param');
To get Request parameters in the Observer, use following code
Mage::app()->getRequest()->getParams();
To get post variable
Mage::app()->getRequest()->getPost('your-param');
answered Nov 24 '15 at 6:20
MeenakshiSundaram RMeenakshiSundaram R
8,12942752
8,12942752
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
add a comment |
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
add a comment |
you can get shipping and billing array with below code
$shipping=Mage::app()->getRequest()->getPost('shipping');
$billing=Mage::app()->getRequest()->getPost('billing');
$yourfieldname=Mage::app()->getRequest()->getPost('yourfieldname');
Thank you for your answer. My field name is delivery_day and I am printing Mage::log(Mage::app()->getRequest()->getPost('delivery_day')); but, it is not printing anything.
– vedu
Nov 24 '15 at 6:53
can you post the input field so i can check that?
– Qaisar Satti
Nov 24 '15 at 6:55
<select name="delivery_day" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
– vedu
Nov 24 '15 at 6:56
I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then i was accessing parameter by $request->getParam('delivery_day').
– vedu
Nov 24 '15 at 6:58
use this eventcheckout_type_onepage_save_order_after
use in billing array<select name="billing[delivery_day]" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
and get it $billing['delivery_day'];
– Qaisar Satti
Nov 24 '15 at 7:03
|
show 10 more comments
you can get shipping and billing array with below code
$shipping=Mage::app()->getRequest()->getPost('shipping');
$billing=Mage::app()->getRequest()->getPost('billing');
$yourfieldname=Mage::app()->getRequest()->getPost('yourfieldname');
Thank you for your answer. My field name is delivery_day and I am printing Mage::log(Mage::app()->getRequest()->getPost('delivery_day')); but, it is not printing anything.
– vedu
Nov 24 '15 at 6:53
can you post the input field so i can check that?
– Qaisar Satti
Nov 24 '15 at 6:55
<select name="delivery_day" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
– vedu
Nov 24 '15 at 6:56
I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then i was accessing parameter by $request->getParam('delivery_day').
– vedu
Nov 24 '15 at 6:58
use this eventcheckout_type_onepage_save_order_after
use in billing array<select name="billing[delivery_day]" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
and get it $billing['delivery_day'];
– Qaisar Satti
Nov 24 '15 at 7:03
|
show 10 more comments
you can get shipping and billing array with below code
$shipping=Mage::app()->getRequest()->getPost('shipping');
$billing=Mage::app()->getRequest()->getPost('billing');
$yourfieldname=Mage::app()->getRequest()->getPost('yourfieldname');
you can get shipping and billing array with below code
$shipping=Mage::app()->getRequest()->getPost('shipping');
$billing=Mage::app()->getRequest()->getPost('billing');
$yourfieldname=Mage::app()->getRequest()->getPost('yourfieldname');
edited Nov 24 '15 at 6:56
answered Nov 24 '15 at 6:50
Qaisar SattiQaisar Satti
26.9k1256109
26.9k1256109
Thank you for your answer. My field name is delivery_day and I am printing Mage::log(Mage::app()->getRequest()->getPost('delivery_day')); but, it is not printing anything.
– vedu
Nov 24 '15 at 6:53
can you post the input field so i can check that?
– Qaisar Satti
Nov 24 '15 at 6:55
<select name="delivery_day" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
– vedu
Nov 24 '15 at 6:56
I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then i was accessing parameter by $request->getParam('delivery_day').
– vedu
Nov 24 '15 at 6:58
use this eventcheckout_type_onepage_save_order_after
use in billing array<select name="billing[delivery_day]" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
and get it $billing['delivery_day'];
– Qaisar Satti
Nov 24 '15 at 7:03
|
show 10 more comments
Thank you for your answer. My field name is delivery_day and I am printing Mage::log(Mage::app()->getRequest()->getPost('delivery_day')); but, it is not printing anything.
– vedu
Nov 24 '15 at 6:53
can you post the input field so i can check that?
– Qaisar Satti
Nov 24 '15 at 6:55
<select name="delivery_day" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
– vedu
Nov 24 '15 at 6:56
I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then i was accessing parameter by $request->getParam('delivery_day').
– vedu
Nov 24 '15 at 6:58
use this eventcheckout_type_onepage_save_order_after
use in billing array<select name="billing[delivery_day]" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
and get it $billing['delivery_day'];
– Qaisar Satti
Nov 24 '15 at 7:03
Thank you for your answer. My field name is delivery_day and I am printing Mage::log(Mage::app()->getRequest()->getPost('delivery_day')); but, it is not printing anything.
– vedu
Nov 24 '15 at 6:53
Thank you for your answer. My field name is delivery_day and I am printing Mage::log(Mage::app()->getRequest()->getPost('delivery_day')); but, it is not printing anything.
– vedu
Nov 24 '15 at 6:53
can you post the input field so i can check that?
– Qaisar Satti
Nov 24 '15 at 6:55
can you post the input field so i can check that?
– Qaisar Satti
Nov 24 '15 at 6:55
<select name="delivery_day" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
– vedu
Nov 24 '15 at 6:56
<select name="delivery_day" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
– vedu
Nov 24 '15 at 6:56
I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then i was accessing parameter by $request->getParam('delivery_day').
– vedu
Nov 24 '15 at 6:58
I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then i was accessing parameter by $request->getParam('delivery_day').
– vedu
Nov 24 '15 at 6:58
use this event
checkout_type_onepage_save_order_after
use in billing array <select name="billing[delivery_day]" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
and get it $billing['delivery_day'];– Qaisar Satti
Nov 24 '15 at 7:03
use this event
checkout_type_onepage_save_order_after
use in billing array <select name="billing[delivery_day]" id='emq_del_day'> <option value="">--Select Day--</option> <option value="Today">Today</option> <option value="Tomorrow">Tomorrow</option> </select>
and get it $billing['delivery_day'];– Qaisar Satti
Nov 24 '15 at 7:03
|
show 10 more comments
Use the following code to resolve your query:
public function yourFunction(Varien_Event_Observer $observer)
$order = $observer->getEvent();
echo $order->getOrder()->getPayment()->getMethod(); // get selected paymante method
$quote = Mage::getSingleton('checkout/session')->getQuote();
echo $quote->getBillingAddress()->getTelephone(); // get billing address phone number
add a comment |
Use the following code to resolve your query:
public function yourFunction(Varien_Event_Observer $observer)
$order = $observer->getEvent();
echo $order->getOrder()->getPayment()->getMethod(); // get selected paymante method
$quote = Mage::getSingleton('checkout/session')->getQuote();
echo $quote->getBillingAddress()->getTelephone(); // get billing address phone number
add a comment |
Use the following code to resolve your query:
public function yourFunction(Varien_Event_Observer $observer)
$order = $observer->getEvent();
echo $order->getOrder()->getPayment()->getMethod(); // get selected paymante method
$quote = Mage::getSingleton('checkout/session')->getQuote();
echo $quote->getBillingAddress()->getTelephone(); // get billing address phone number
Use the following code to resolve your query:
public function yourFunction(Varien_Event_Observer $observer)
$order = $observer->getEvent();
echo $order->getOrder()->getPayment()->getMethod(); // get selected paymante method
$quote = Mage::getSingleton('checkout/session')->getQuote();
echo $quote->getBillingAddress()->getTelephone(); // get billing address phone number
answered Dec 19 '16 at 10:46
Abhinav SinghAbhinav Singh
2,105611
2,105611
add a comment |
add a comment |
You may also try with below code to read all the parameters
$orders = $observer->getData();
echo '<pre>'; print_r($orders); echo '</pre>';
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
You may use $data = Mage::app()->getRequest()->getParams(); to get the data
– Vick
Nov 24 '15 at 6:47
add a comment |
You may also try with below code to read all the parameters
$orders = $observer->getData();
echo '<pre>'; print_r($orders); echo '</pre>';
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
You may use $data = Mage::app()->getRequest()->getParams(); to get the data
– Vick
Nov 24 '15 at 6:47
add a comment |
You may also try with below code to read all the parameters
$orders = $observer->getData();
echo '<pre>'; print_r($orders); echo '</pre>';
You may also try with below code to read all the parameters
$orders = $observer->getData();
echo '<pre>'; print_r($orders); echo '</pre>';
answered Nov 24 '15 at 6:23
VickVick
98111
98111
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
You may use $data = Mage::app()->getRequest()->getParams(); to get the data
– Vick
Nov 24 '15 at 6:47
add a comment |
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
You may use $data = Mage::app()->getRequest()->getParams(); to get the data
– Vick
Nov 24 '15 at 6:47
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
You may use $data = Mage::app()->getRequest()->getParams(); to get the data
– Vick
Nov 24 '15 at 6:47
You may use $data = Mage::app()->getRequest()->getParams(); to get the data
– Vick
Nov 24 '15 at 6:47
add a comment |
As you can see from Mage_Sales_Model_Order::place()
, the only available data for this event is order
. To access the request object inside your event observer, you can do something like:
$request = Mage::app()->getRequest();
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
See my answer above: you don't have access to the request from the observer data, but you can still get the request object by calling$request = Mage::app()->getRequest();
in your event observer.
– fmrng
Nov 24 '15 at 6:42
That code is returing : Mage_Core_Controller_Request_Http Object array but there are different parameters present and parameters those I want are not present.
– vedu
Nov 24 '15 at 6:46
add a comment |
As you can see from Mage_Sales_Model_Order::place()
, the only available data for this event is order
. To access the request object inside your event observer, you can do something like:
$request = Mage::app()->getRequest();
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
See my answer above: you don't have access to the request from the observer data, but you can still get the request object by calling$request = Mage::app()->getRequest();
in your event observer.
– fmrng
Nov 24 '15 at 6:42
That code is returing : Mage_Core_Controller_Request_Http Object array but there are different parameters present and parameters those I want are not present.
– vedu
Nov 24 '15 at 6:46
add a comment |
As you can see from Mage_Sales_Model_Order::place()
, the only available data for this event is order
. To access the request object inside your event observer, you can do something like:
$request = Mage::app()->getRequest();
As you can see from Mage_Sales_Model_Order::place()
, the only available data for this event is order
. To access the request object inside your event observer, you can do something like:
$request = Mage::app()->getRequest();
edited Nov 24 '15 at 6:43
answered Nov 24 '15 at 6:19
fmrngfmrng
2,7781317
2,7781317
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
See my answer above: you don't have access to the request from the observer data, but you can still get the request object by calling$request = Mage::app()->getRequest();
in your event observer.
– fmrng
Nov 24 '15 at 6:42
That code is returing : Mage_Core_Controller_Request_Http Object array but there are different parameters present and parameters those I want are not present.
– vedu
Nov 24 '15 at 6:46
add a comment |
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
See my answer above: you don't have access to the request from the observer data, but you can still get the request object by calling$request = Mage::app()->getRequest();
in your event observer.
– fmrng
Nov 24 '15 at 6:42
That code is returing : Mage_Core_Controller_Request_Http Object array but there are different parameters present and parameters those I want are not present.
– vedu
Nov 24 '15 at 6:46
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
Thank you for your answer. In starting, I was using checkout_controller_onepage_save_shipping_method this event and, I was able to get request object by $request = $observer->getRequest(); and then I was accessing parameter by $request->getParam('parameter_name'). Can you tell me how to access this parameter by using sales_order_place_before event.
– vedu
Nov 24 '15 at 6:39
See my answer above: you don't have access to the request from the observer data, but you can still get the request object by calling
$request = Mage::app()->getRequest();
in your event observer.– fmrng
Nov 24 '15 at 6:42
See my answer above: you don't have access to the request from the observer data, but you can still get the request object by calling
$request = Mage::app()->getRequest();
in your event observer.– fmrng
Nov 24 '15 at 6:42
That code is returing : Mage_Core_Controller_Request_Http Object array but there are different parameters present and parameters those I want are not present.
– vedu
Nov 24 '15 at 6:46
That code is returing : Mage_Core_Controller_Request_Http Object array but there are different parameters present and parameters those I want are not present.
– vedu
Nov 24 '15 at 6:46
add a comment |
public function yourFunction(Varien_Event_Observer $observer)
$order = $observer->getEvent();
echo $order->getOrder()->getPayment()->getMethod(); // get selected paymante method
$quote = Mage::getSingleton('checkout/session')->getQuote();
echo $quote->getBillingAddress()->getTelephone(); // get billing address phone number
add a comment |
public function yourFunction(Varien_Event_Observer $observer)
$order = $observer->getEvent();
echo $order->getOrder()->getPayment()->getMethod(); // get selected paymante method
$quote = Mage::getSingleton('checkout/session')->getQuote();
echo $quote->getBillingAddress()->getTelephone(); // get billing address phone number
add a comment |
public function yourFunction(Varien_Event_Observer $observer)
$order = $observer->getEvent();
echo $order->getOrder()->getPayment()->getMethod(); // get selected paymante method
$quote = Mage::getSingleton('checkout/session')->getQuote();
echo $quote->getBillingAddress()->getTelephone(); // get billing address phone number
public function yourFunction(Varien_Event_Observer $observer)
$order = $observer->getEvent();
echo $order->getOrder()->getPayment()->getMethod(); // get selected paymante method
$quote = Mage::getSingleton('checkout/session')->getQuote();
echo $quote->getBillingAddress()->getTelephone(); // get billing address phone number
edited 15 mins ago
magefms
1,701425
1,701425
answered Jan 27 '17 at 13:49
AnbuAnbu
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f91326%2fgetting-parameters-in-sales-order-place-before-events-observer%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$request = $observer->getEvent()->getRequest(); $params = $request->getParams();
– Bill
Nov 24 '15 at 7:43