Category: Magento

Update order status programmatically in magento

We can update order status of product in magento by using this below code. setState() function will do this for us, all we need is just pass the required arguments like state to be updated, status of the state, comment for the status change. $order = Mage::getModel(‘sales/order’)->loadByIncrementId($orderId); $state = ‘new’;$status = ‘label_generated_by_user’;$comment = ‘You have […]

Read More…

Fix magento admin login failing in chrome browser

Login failure in chrome even though you have given correct username and password?Just follow to code to access admin page in chrome browser. Look for the line in appcodelocalMageCoreModelSessionAbstractVarien.php file. If you have found just replace that line with the follwing code In this way we can fix magento admin login failing in chrome browser […]

Read More…

Magento shopping cart total items quantity

If you want to get cart total items quantity from magento shopping cart, you can use the below snippet. function getCartQty(){ $cartcollection = Mage::getModel(‘checkout/cart’)->getQuote()->getData(); if (isset($cartcollection[‘items_qty’])) return (int)$cartcollection[‘items_qty’]; else return 0;} With the help of the above function we can get cart total items quantity by putting echo getCartQty();

Read More…