How to get quote Id using sales_quote_collect_totals_after events Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30 pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Get just the SIMPLE products ordered from a quote when Configurable Products are purchasedCustom cron causing one page checkout deadlocksConvert Order to Quote and Load to Current CartDifference Between Sales Quote and Sales Quote AddressGet quote items from admin quote sessionM1 CE, paypal exception “PayPal NVP gateway errors”Magento 2: After login how to get current quote id?How to remove items from quote using observer whenever quote is loaded?Using events vs overriding? Why events are better?Get Quote from Order Success Observer
Was Objective-C really a hindrance to Apple software development?
Does using the Inspiration rules for character defects encourage My Guy Syndrome?
Is there a verb for listening stealthily?
In search of the origins of term censor, I hit a dead end stuck with the greek term, to censor, λογοκρίνω
Philosophers who were composers?
Does Prince Arnaud cause someone holding the Princess to lose?
Can gravitational waves pass through a black hole?
Is it accepted to use working hours to read general interest books?
How to compute a Jacobian using polar coordinates?
"Working on a knee"
How to translate "red flag" into Spanish?
Suing a Police Officer Instead of the Police Department
How can I wire a 9-position switch so that each position turns on one more LED than the one before?
RIP Packet Format
How would it unbalance gameplay to rule that Weapon Master allows for picking a fighting style?
Has a Nobel Peace laureate ever been accused of war crimes?
What happened to Viserion in Season 7?
false 'Security alert' from Google - every login generates mails from 'no-reply@accounts.google.com'
Could a cockatrice have parasitic embryos?
How was Lagrange appointed professor of mathematics so early?
What is ls Largest Number Formed by only moving two sticks in 508?
Is there a possibility to generate a list dynamically in Latex?
Why does Java have support for time zone offsets with seconds precision?
Why aren't road bicycle wheels tiny?
How to get quote Id using sales_quote_collect_totals_after events
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30 pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?Get just the SIMPLE products ordered from a quote when Configurable Products are purchasedCustom cron causing one page checkout deadlocksConvert Order to Quote and Load to Current CartDifference Between Sales Quote and Sales Quote AddressGet quote items from admin quote sessionM1 CE, paypal exception “PayPal NVP gateway errors”Magento 2: After login how to get current quote id?How to remove items from quote using observer whenever quote is loaded?Using events vs overriding? Why events are better?Get Quote from Order Success Observer
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have create a programmatically order. But when submit order sales_quote_collect_totals_after events fire before save collect totals.
Here is my code :
$storeId = Mage::app()->getStore()->getStoreId();
try
$customer_id = $this->getRequest()->getParam('customer_id');
$selected_product_details = $this->getRequest()->getParam('selected_product_details');
$firstname = $this->getRequest()->getParam('firstname');
$lastname = $this->getRequest()->getParam('lastname');
$email = $this->getRequest()->getParam('email');
$street = $this->getRequest()->getParam('street');
$mobile = $this->getRequest()->getParam('mobile');
if ($customer_id == '')
$store = Mage::app()->getStore();
$customer = Mage::getModel("customer/customer");
$customer->setWebsiteId($websiteId)
->setStore($store)
->setFirstname($firstname)
->setLastname($lastname)
->setEmail($email)
->setPassword('123456');
$customer->save();
$customer_id = $customer->getCustomerId();
else
$customer = Mage::getModel('customer/customer')->load($customer_id);
$product_details = json_decode($selected_product_details, true);
$websiteId = Mage::app()->getWebsite()->getId();
// Start New Sales Order Quote
$quote = Mage::getModel('sales/quote')
->setStoreId($storeId);
// Set Sales Order Quote Currency
$quote->setCurrency($order->AdjustmentAmount->currencyID);
// Assign Customer To Sales Order Quote
$quote->assignCustomer($customer);
// Configure Notification
$quote->setSendCconfirmation(1);
foreach ($product_details as $_products)
$productId = $_products['productId'];
$qty = $_products['qty'];
$product = Mage::getModel('catalog/product')->load($productId);
$quote->addProduct($product, new Varien_Object(array('qty' => $qty)));
// Set Sales Order Billing Address
$billingAddress = $quote->getBillingAddress()->addData(array(
'customer_address_id' => '',
'prefix' => '',
'firstname' => $firstname,
'middlename' => '',
'lastname' => $lastname,
'suffix' => '',
'company' => '',
'street' => $street,
'telephone' => $mobile,
'vat_id' => '',
'save_in_address_book' => 1
));
// Set Sales Order Shipping Address
$shippingAddress = $quote->getShippingAddress()->addData(array(
'customer_address_id' => '',
'prefix' => '',
'firstname' => $firstname,
'middlename' => '',
'lastname' => $lastname,
'suffix' => '',
'company' => '',
'street' => $street,
'telephone' => $mobile,
'vat_id' => '',
'save_in_address_book' => 1
));
if ($shippingPrice == 0)
$shippingAddress->setCollectShippingRates(true)
->collectShippingRates()
->setShippingMethod('freeshipping_freeshipping')
->setPaymentMethod('cashondelivery');
else
$shippingAddress->setCollectShippingRates(true)
->collectShippingRates()
->setShippingMethod('flatrate_flatrate')
->setPaymentMethod('cashondelivery');
//Fire event sales_quote_collect_totals_after Before ->collectTotals->save();
$quote->getPayment()->importData(array('method' => 'cashondelivery'));
$quote->collectTotals->save();
// Create Order From Quote
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
$orderId = $service->getOrder()->getRealOrderId();
// Resource Clean-Up
$quote = $customer = $service = null;
$this->createOrderInvoice($orderId);
$message = $this->__('Ordered Created Successfully');
$success = 1;
//send mail when placing order
$order_mail = new Mage_Sales_Model_Order();
$order_mail->loadByIncrementId($orderId);
$order_mail->sendNewOrderEmail();
$result = array("success" => $success, "message" => $message, "order_id" => $orderId);
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
catch (Exception $ex)
$message = $this->__('Something went wrong. Please try again.');
$success = 0;
$result = array("success" => $success, "message" => $message);
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
return false;
Here is config.xml :
<modules>
<Assel_StoreOwners>
<version>0.1.0</version>
</Assel_StoreOwners>
</modules>
<global>
<blocks>
<storeowners>
<class>Assel_StoreOwners_Block</class>
</storeowners>
</blocks>
<helpers>
<storeowners>
<class>Assel_StoreOwners_Helper</class>
</storeowners>
</helpers>
<events>
<sales_quote_collect_totals_after>
<observers>
<set_custom_discount>
<type>singleton</type>
<class>Assel_StoreOwners_Model_Observer</class>
<method>setDiscount</method>
</set_custom_discount>
</observers>
</sales_quote_collect_totals_after>
</events>
</global>
I have create a setDiscount function in observer.php
But When fire this events i have didn't get quote_id.
Here is observer.php code :
function setDiscount($observer)
$quote=$observer->getEvent()->getQuote();
$quoteid=$quote->getId();
$customer_id = $quote->getCustomerId();
when call this observer I have didn't get quote_id. But I have getting customer_id.
Please anyone help me.
magento-1.9 orders event-observer quote sales
bumped to the homepage by Community♦ 16 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have create a programmatically order. But when submit order sales_quote_collect_totals_after events fire before save collect totals.
Here is my code :
$storeId = Mage::app()->getStore()->getStoreId();
try
$customer_id = $this->getRequest()->getParam('customer_id');
$selected_product_details = $this->getRequest()->getParam('selected_product_details');
$firstname = $this->getRequest()->getParam('firstname');
$lastname = $this->getRequest()->getParam('lastname');
$email = $this->getRequest()->getParam('email');
$street = $this->getRequest()->getParam('street');
$mobile = $this->getRequest()->getParam('mobile');
if ($customer_id == '')
$store = Mage::app()->getStore();
$customer = Mage::getModel("customer/customer");
$customer->setWebsiteId($websiteId)
->setStore($store)
->setFirstname($firstname)
->setLastname($lastname)
->setEmail($email)
->setPassword('123456');
$customer->save();
$customer_id = $customer->getCustomerId();
else
$customer = Mage::getModel('customer/customer')->load($customer_id);
$product_details = json_decode($selected_product_details, true);
$websiteId = Mage::app()->getWebsite()->getId();
// Start New Sales Order Quote
$quote = Mage::getModel('sales/quote')
->setStoreId($storeId);
// Set Sales Order Quote Currency
$quote->setCurrency($order->AdjustmentAmount->currencyID);
// Assign Customer To Sales Order Quote
$quote->assignCustomer($customer);
// Configure Notification
$quote->setSendCconfirmation(1);
foreach ($product_details as $_products)
$productId = $_products['productId'];
$qty = $_products['qty'];
$product = Mage::getModel('catalog/product')->load($productId);
$quote->addProduct($product, new Varien_Object(array('qty' => $qty)));
// Set Sales Order Billing Address
$billingAddress = $quote->getBillingAddress()->addData(array(
'customer_address_id' => '',
'prefix' => '',
'firstname' => $firstname,
'middlename' => '',
'lastname' => $lastname,
'suffix' => '',
'company' => '',
'street' => $street,
'telephone' => $mobile,
'vat_id' => '',
'save_in_address_book' => 1
));
// Set Sales Order Shipping Address
$shippingAddress = $quote->getShippingAddress()->addData(array(
'customer_address_id' => '',
'prefix' => '',
'firstname' => $firstname,
'middlename' => '',
'lastname' => $lastname,
'suffix' => '',
'company' => '',
'street' => $street,
'telephone' => $mobile,
'vat_id' => '',
'save_in_address_book' => 1
));
if ($shippingPrice == 0)
$shippingAddress->setCollectShippingRates(true)
->collectShippingRates()
->setShippingMethod('freeshipping_freeshipping')
->setPaymentMethod('cashondelivery');
else
$shippingAddress->setCollectShippingRates(true)
->collectShippingRates()
->setShippingMethod('flatrate_flatrate')
->setPaymentMethod('cashondelivery');
//Fire event sales_quote_collect_totals_after Before ->collectTotals->save();
$quote->getPayment()->importData(array('method' => 'cashondelivery'));
$quote->collectTotals->save();
// Create Order From Quote
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
$orderId = $service->getOrder()->getRealOrderId();
// Resource Clean-Up
$quote = $customer = $service = null;
$this->createOrderInvoice($orderId);
$message = $this->__('Ordered Created Successfully');
$success = 1;
//send mail when placing order
$order_mail = new Mage_Sales_Model_Order();
$order_mail->loadByIncrementId($orderId);
$order_mail->sendNewOrderEmail();
$result = array("success" => $success, "message" => $message, "order_id" => $orderId);
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
catch (Exception $ex)
$message = $this->__('Something went wrong. Please try again.');
$success = 0;
$result = array("success" => $success, "message" => $message);
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
return false;
Here is config.xml :
<modules>
<Assel_StoreOwners>
<version>0.1.0</version>
</Assel_StoreOwners>
</modules>
<global>
<blocks>
<storeowners>
<class>Assel_StoreOwners_Block</class>
</storeowners>
</blocks>
<helpers>
<storeowners>
<class>Assel_StoreOwners_Helper</class>
</storeowners>
</helpers>
<events>
<sales_quote_collect_totals_after>
<observers>
<set_custom_discount>
<type>singleton</type>
<class>Assel_StoreOwners_Model_Observer</class>
<method>setDiscount</method>
</set_custom_discount>
</observers>
</sales_quote_collect_totals_after>
</events>
</global>
I have create a setDiscount function in observer.php
But When fire this events i have didn't get quote_id.
Here is observer.php code :
function setDiscount($observer)
$quote=$observer->getEvent()->getQuote();
$quoteid=$quote->getId();
$customer_id = $quote->getCustomerId();
when call this observer I have didn't get quote_id. But I have getting customer_id.
Please anyone help me.
magento-1.9 orders event-observer quote sales
bumped to the homepage by Community♦ 16 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I have create a programmatically order. But when submit order sales_quote_collect_totals_after events fire before save collect totals.
Here is my code :
$storeId = Mage::app()->getStore()->getStoreId();
try
$customer_id = $this->getRequest()->getParam('customer_id');
$selected_product_details = $this->getRequest()->getParam('selected_product_details');
$firstname = $this->getRequest()->getParam('firstname');
$lastname = $this->getRequest()->getParam('lastname');
$email = $this->getRequest()->getParam('email');
$street = $this->getRequest()->getParam('street');
$mobile = $this->getRequest()->getParam('mobile');
if ($customer_id == '')
$store = Mage::app()->getStore();
$customer = Mage::getModel("customer/customer");
$customer->setWebsiteId($websiteId)
->setStore($store)
->setFirstname($firstname)
->setLastname($lastname)
->setEmail($email)
->setPassword('123456');
$customer->save();
$customer_id = $customer->getCustomerId();
else
$customer = Mage::getModel('customer/customer')->load($customer_id);
$product_details = json_decode($selected_product_details, true);
$websiteId = Mage::app()->getWebsite()->getId();
// Start New Sales Order Quote
$quote = Mage::getModel('sales/quote')
->setStoreId($storeId);
// Set Sales Order Quote Currency
$quote->setCurrency($order->AdjustmentAmount->currencyID);
// Assign Customer To Sales Order Quote
$quote->assignCustomer($customer);
// Configure Notification
$quote->setSendCconfirmation(1);
foreach ($product_details as $_products)
$productId = $_products['productId'];
$qty = $_products['qty'];
$product = Mage::getModel('catalog/product')->load($productId);
$quote->addProduct($product, new Varien_Object(array('qty' => $qty)));
// Set Sales Order Billing Address
$billingAddress = $quote->getBillingAddress()->addData(array(
'customer_address_id' => '',
'prefix' => '',
'firstname' => $firstname,
'middlename' => '',
'lastname' => $lastname,
'suffix' => '',
'company' => '',
'street' => $street,
'telephone' => $mobile,
'vat_id' => '',
'save_in_address_book' => 1
));
// Set Sales Order Shipping Address
$shippingAddress = $quote->getShippingAddress()->addData(array(
'customer_address_id' => '',
'prefix' => '',
'firstname' => $firstname,
'middlename' => '',
'lastname' => $lastname,
'suffix' => '',
'company' => '',
'street' => $street,
'telephone' => $mobile,
'vat_id' => '',
'save_in_address_book' => 1
));
if ($shippingPrice == 0)
$shippingAddress->setCollectShippingRates(true)
->collectShippingRates()
->setShippingMethod('freeshipping_freeshipping')
->setPaymentMethod('cashondelivery');
else
$shippingAddress->setCollectShippingRates(true)
->collectShippingRates()
->setShippingMethod('flatrate_flatrate')
->setPaymentMethod('cashondelivery');
//Fire event sales_quote_collect_totals_after Before ->collectTotals->save();
$quote->getPayment()->importData(array('method' => 'cashondelivery'));
$quote->collectTotals->save();
// Create Order From Quote
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
$orderId = $service->getOrder()->getRealOrderId();
// Resource Clean-Up
$quote = $customer = $service = null;
$this->createOrderInvoice($orderId);
$message = $this->__('Ordered Created Successfully');
$success = 1;
//send mail when placing order
$order_mail = new Mage_Sales_Model_Order();
$order_mail->loadByIncrementId($orderId);
$order_mail->sendNewOrderEmail();
$result = array("success" => $success, "message" => $message, "order_id" => $orderId);
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
catch (Exception $ex)
$message = $this->__('Something went wrong. Please try again.');
$success = 0;
$result = array("success" => $success, "message" => $message);
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
return false;
Here is config.xml :
<modules>
<Assel_StoreOwners>
<version>0.1.0</version>
</Assel_StoreOwners>
</modules>
<global>
<blocks>
<storeowners>
<class>Assel_StoreOwners_Block</class>
</storeowners>
</blocks>
<helpers>
<storeowners>
<class>Assel_StoreOwners_Helper</class>
</storeowners>
</helpers>
<events>
<sales_quote_collect_totals_after>
<observers>
<set_custom_discount>
<type>singleton</type>
<class>Assel_StoreOwners_Model_Observer</class>
<method>setDiscount</method>
</set_custom_discount>
</observers>
</sales_quote_collect_totals_after>
</events>
</global>
I have create a setDiscount function in observer.php
But When fire this events i have didn't get quote_id.
Here is observer.php code :
function setDiscount($observer)
$quote=$observer->getEvent()->getQuote();
$quoteid=$quote->getId();
$customer_id = $quote->getCustomerId();
when call this observer I have didn't get quote_id. But I have getting customer_id.
Please anyone help me.
magento-1.9 orders event-observer quote sales
I have create a programmatically order. But when submit order sales_quote_collect_totals_after events fire before save collect totals.
Here is my code :
$storeId = Mage::app()->getStore()->getStoreId();
try
$customer_id = $this->getRequest()->getParam('customer_id');
$selected_product_details = $this->getRequest()->getParam('selected_product_details');
$firstname = $this->getRequest()->getParam('firstname');
$lastname = $this->getRequest()->getParam('lastname');
$email = $this->getRequest()->getParam('email');
$street = $this->getRequest()->getParam('street');
$mobile = $this->getRequest()->getParam('mobile');
if ($customer_id == '')
$store = Mage::app()->getStore();
$customer = Mage::getModel("customer/customer");
$customer->setWebsiteId($websiteId)
->setStore($store)
->setFirstname($firstname)
->setLastname($lastname)
->setEmail($email)
->setPassword('123456');
$customer->save();
$customer_id = $customer->getCustomerId();
else
$customer = Mage::getModel('customer/customer')->load($customer_id);
$product_details = json_decode($selected_product_details, true);
$websiteId = Mage::app()->getWebsite()->getId();
// Start New Sales Order Quote
$quote = Mage::getModel('sales/quote')
->setStoreId($storeId);
// Set Sales Order Quote Currency
$quote->setCurrency($order->AdjustmentAmount->currencyID);
// Assign Customer To Sales Order Quote
$quote->assignCustomer($customer);
// Configure Notification
$quote->setSendCconfirmation(1);
foreach ($product_details as $_products)
$productId = $_products['productId'];
$qty = $_products['qty'];
$product = Mage::getModel('catalog/product')->load($productId);
$quote->addProduct($product, new Varien_Object(array('qty' => $qty)));
// Set Sales Order Billing Address
$billingAddress = $quote->getBillingAddress()->addData(array(
'customer_address_id' => '',
'prefix' => '',
'firstname' => $firstname,
'middlename' => '',
'lastname' => $lastname,
'suffix' => '',
'company' => '',
'street' => $street,
'telephone' => $mobile,
'vat_id' => '',
'save_in_address_book' => 1
));
// Set Sales Order Shipping Address
$shippingAddress = $quote->getShippingAddress()->addData(array(
'customer_address_id' => '',
'prefix' => '',
'firstname' => $firstname,
'middlename' => '',
'lastname' => $lastname,
'suffix' => '',
'company' => '',
'street' => $street,
'telephone' => $mobile,
'vat_id' => '',
'save_in_address_book' => 1
));
if ($shippingPrice == 0)
$shippingAddress->setCollectShippingRates(true)
->collectShippingRates()
->setShippingMethod('freeshipping_freeshipping')
->setPaymentMethod('cashondelivery');
else
$shippingAddress->setCollectShippingRates(true)
->collectShippingRates()
->setShippingMethod('flatrate_flatrate')
->setPaymentMethod('cashondelivery');
//Fire event sales_quote_collect_totals_after Before ->collectTotals->save();
$quote->getPayment()->importData(array('method' => 'cashondelivery'));
$quote->collectTotals->save();
// Create Order From Quote
$service = Mage::getModel('sales/service_quote', $quote);
$service->submitAll();
$orderId = $service->getOrder()->getRealOrderId();
// Resource Clean-Up
$quote = $customer = $service = null;
$this->createOrderInvoice($orderId);
$message = $this->__('Ordered Created Successfully');
$success = 1;
//send mail when placing order
$order_mail = new Mage_Sales_Model_Order();
$order_mail->loadByIncrementId($orderId);
$order_mail->sendNewOrderEmail();
$result = array("success" => $success, "message" => $message, "order_id" => $orderId);
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
catch (Exception $ex)
$message = $this->__('Something went wrong. Please try again.');
$success = 0;
$result = array("success" => $success, "message" => $message);
$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
return false;
Here is config.xml :
<modules>
<Assel_StoreOwners>
<version>0.1.0</version>
</Assel_StoreOwners>
</modules>
<global>
<blocks>
<storeowners>
<class>Assel_StoreOwners_Block</class>
</storeowners>
</blocks>
<helpers>
<storeowners>
<class>Assel_StoreOwners_Helper</class>
</storeowners>
</helpers>
<events>
<sales_quote_collect_totals_after>
<observers>
<set_custom_discount>
<type>singleton</type>
<class>Assel_StoreOwners_Model_Observer</class>
<method>setDiscount</method>
</set_custom_discount>
</observers>
</sales_quote_collect_totals_after>
</events>
</global>
I have create a setDiscount function in observer.php
But When fire this events i have didn't get quote_id.
Here is observer.php code :
function setDiscount($observer)
$quote=$observer->getEvent()->getQuote();
$quoteid=$quote->getId();
$customer_id = $quote->getCustomerId();
when call this observer I have didn't get quote_id. But I have getting customer_id.
Please anyone help me.
magento-1.9 orders event-observer quote sales
magento-1.9 orders event-observer quote sales
edited Mar 29 '17 at 13:36
Dinesh Yadav
4,0931937
4,0931937
asked Mar 29 '17 at 13:20
Rakesh PatidarRakesh Patidar
132217
132217
bumped to the homepage by Community♦ 16 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 16 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
You can use $quote->getEntityId() to get the quote_id
Yes, I have tried $quote->getEntityId() but not success.
– Rakesh Patidar
Mar 30 '17 at 4:18
Does the order and quote are saved on the database?
– manumotate
Mar 31 '17 at 14:08
add a comment |
As per my understanding with your code,you are creating order programatically by adding and loading products,customer hence quote id is not generating.Since quote id is generated when a product is added to cart thats why you are not getting quote id.
add a comment |
$quote = Mage::getModel('checkout/session')->getQuote();
$quote->getEntityId(); or $quote->getId();
$quote = Mage::getModel('checkout/session')->getQuote();
$grandTotal = 0;
foreach ($quote->getAllItems() as $item)
//get all data here
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%2f166764%2fhow-to-get-quote-id-using-sales-quote-collect-totals-after-events%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use $quote->getEntityId() to get the quote_id
Yes, I have tried $quote->getEntityId() but not success.
– Rakesh Patidar
Mar 30 '17 at 4:18
Does the order and quote are saved on the database?
– manumotate
Mar 31 '17 at 14:08
add a comment |
You can use $quote->getEntityId() to get the quote_id
Yes, I have tried $quote->getEntityId() but not success.
– Rakesh Patidar
Mar 30 '17 at 4:18
Does the order and quote are saved on the database?
– manumotate
Mar 31 '17 at 14:08
add a comment |
You can use $quote->getEntityId() to get the quote_id
You can use $quote->getEntityId() to get the quote_id
edited Mar 29 '17 at 18:58
answered Mar 29 '17 at 14:46
manumotatemanumotate
163
163
Yes, I have tried $quote->getEntityId() but not success.
– Rakesh Patidar
Mar 30 '17 at 4:18
Does the order and quote are saved on the database?
– manumotate
Mar 31 '17 at 14:08
add a comment |
Yes, I have tried $quote->getEntityId() but not success.
– Rakesh Patidar
Mar 30 '17 at 4:18
Does the order and quote are saved on the database?
– manumotate
Mar 31 '17 at 14:08
Yes, I have tried $quote->getEntityId() but not success.
– Rakesh Patidar
Mar 30 '17 at 4:18
Yes, I have tried $quote->getEntityId() but not success.
– Rakesh Patidar
Mar 30 '17 at 4:18
Does the order and quote are saved on the database?
– manumotate
Mar 31 '17 at 14:08
Does the order and quote are saved on the database?
– manumotate
Mar 31 '17 at 14:08
add a comment |
As per my understanding with your code,you are creating order programatically by adding and loading products,customer hence quote id is not generating.Since quote id is generated when a product is added to cart thats why you are not getting quote id.
add a comment |
As per my understanding with your code,you are creating order programatically by adding and loading products,customer hence quote id is not generating.Since quote id is generated when a product is added to cart thats why you are not getting quote id.
add a comment |
As per my understanding with your code,you are creating order programatically by adding and loading products,customer hence quote id is not generating.Since quote id is generated when a product is added to cart thats why you are not getting quote id.
As per my understanding with your code,you are creating order programatically by adding and loading products,customer hence quote id is not generating.Since quote id is generated when a product is added to cart thats why you are not getting quote id.
answered Oct 25 '17 at 9:59
akgolaakgola
1,462520
1,462520
add a comment |
add a comment |
$quote = Mage::getModel('checkout/session')->getQuote();
$quote->getEntityId(); or $quote->getId();
$quote = Mage::getModel('checkout/session')->getQuote();
$grandTotal = 0;
foreach ($quote->getAllItems() as $item)
//get all data here
add a comment |
$quote = Mage::getModel('checkout/session')->getQuote();
$quote->getEntityId(); or $quote->getId();
$quote = Mage::getModel('checkout/session')->getQuote();
$grandTotal = 0;
foreach ($quote->getAllItems() as $item)
//get all data here
add a comment |
$quote = Mage::getModel('checkout/session')->getQuote();
$quote->getEntityId(); or $quote->getId();
$quote = Mage::getModel('checkout/session')->getQuote();
$grandTotal = 0;
foreach ($quote->getAllItems() as $item)
//get all data here
$quote = Mage::getModel('checkout/session')->getQuote();
$quote->getEntityId(); or $quote->getId();
$quote = Mage::getModel('checkout/session')->getQuote();
$grandTotal = 0;
foreach ($quote->getAllItems() as $item)
//get all data here
answered Aug 18 '18 at 13:37
satishsatish
18413
18413
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%2f166764%2fhow-to-get-quote-id-using-sales-quote-collect-totals-after-events%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