To get all the ordered items of the order use the following code. <?php $order_id = 2314; //use your own…..
A collection of Code Snippets and articles of the latest
Technology and Open Source.
To get the shipping address details of the order. [cr]This code will return an object.[/cr] <?php $order_id = 2314; //use your own order id $order = Mage::getModel("sales/order")->load($order_id); //load order by order id $shipping_address = $order->getShippingAddress(); echo $shipping_address->getTelephone(); echo $shipping_address->getPostcode(); //use print_r($shipping_address->getData()); to get all the available elements of the object ?>
Slug is the seo friendly format of any text string. A slug is a text string contains alpha-numeric characters only,…..
We have customer email id and we want to get the other details of the customer. <?php $customer_email = “email@example.com”;…..
Magento is a complete and awesome MVC application. It’s fully moduler and easy to extend its features and functionality. All…..
Magento uses blocks terminology in its architecture to display the views. Blocks are classes in Magento modules which handles the…..
Removing or Adding top links in the header section of the theme is very easy via Layout.xml files. However we…..
Using the Google hosted Jquery and other Libraries on the website is the best method to speed up the things and saves a lot of bandwidth as well. Other benefit is that it provides synchronous loading.
In case if google server is down, fallback to own hosted Jquery keep the website running with proper functioning. Given code will load the jquery from the Google CDN and if it fails than load from the own host.
<html> <head> <!-- Load the Google CDN’s Jquery --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <!-- check if jquery is loaded and active else load the jquery from own hosting --> <script>window.jQuery || document.write('<script src="http://www.hostname.com/jquery.min.js"><\/script>')</script> </head>....