Skip to main content

Posts

Showing posts from February, 2016

Magento - Get product by sku

Hi Everybody, I was working with magento products and found that how we can find product object using sku and I have found below solution. // Here $sku is our sku variable for product. $sku = 'A1001' ; //loadByAttribute function is helpful for getting product data $product = Mage:: getModel ( 'catalog/product' ) -> loadByAttribute ( 'sku' , $sku ) ;

Angular JS Table Filter and Sorting

Hi All, I am new to angular js and doing some random stuff. I am sharing the code here. Hope this will help you some where. <style> table, td  {   border: 1px solid grey;   border-collapse: collapse;   padding: 5px; } .sortorder:after {   content: '\25b2'; } .sortorder.reverse:after {   content: '\25bc'; } </style> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <body> <div ng-app="myApp" ng-controller="customersCtrl"> <table>     <tr>         <td ng-click="order('Name')">           Customer Name           <span class="sortorder" ng-show="predicate === 'Name'" ng-class="{reverse:reverse}"></span>         </td>         <td ng-click="order('City')">           City           <span class="sortorder"