<?php $curr_date = date(‘Y-m-d H:i:s’); $order = $observer->getEvent()->getOrder(); foreach ($order->getItemsCollection() as $item) { $productId = $item->getProductId(); $qty…
Magento
Magento tutorials, Magento how to, Magento, Apache, Nginx
<?php $order = Mage::getModel(‘sales/order’) ->load(Mage::getSingleton(‘sales/order’)->getLastOrderId()); $getLastOrderIncrementId = $order->getIncrementId(); If the above code does not work try the…
<?php $order = Mage::getModel(‘sales/order’)->load($orderid); $Incrementid = $order->getIncrementId();
If you want to get the customer information at the success page for you to be able…
<?php $customer_email = “customer@example.com”; $customer = Mage::getModel(“customer/customer”); $customer->setWebsiteId(Mage::app()->getWebsite()->getId()); //load customer by email id $customer->loadByEmail($customer_email); echo $customer->getId(); //get…
READ CSV — getData() To read a csv file the file has to be in Magento root….
I was given a task to bulk update tier prices for our wholesale site and for wholesale…
//get all order statuses and save the array $orderStatus[status][label] //in $status associative array $orderStatusCollection = Mage::getModel(‘sales/order_status’)->getResourceCollection()->getData(); $status…
In Magento, suppose we wanted to override/rewrite the core adminhtml controller class which is originally based in app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php…