Likewise, to get any attribute value, we need to first load the product object. Then get the…
$customers = Mage::getResourceModel(‘customer/customer_collection’) ->addAttributeToSelect(‘*’) ->addAttributeToFilter(‘firstname’, $firstName); The above code will only load the collection. To get customer…
<?php Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); $product = Mage::getModel(‘catalog/product’); if(!$product->getIdBySku(‘testsku11’)){ try { $product ->setStoreId(2) //you can set data in store scope…
<?php $curr_date = date(‘Y-m-d H:i:s’); $order = $observer->getEvent()->getOrder(); foreach ($order->getItemsCollection() as $item) { $productId = $item->getProductId(); $qty…
<?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…
You need to edit /etc/default/locale so it contains LANG=en_US.UTF-8 or some other English locale of your choice.