Advance shorting option for category/list page in magento Note: Please Make folder structure app/code/local and place all files in same structure in this folder ,If you make changes in core files its your risk.please make proper backup for core files if you modify that . Step -1. For Advance shorting option you have to create new collection by overriding Collection class. Overrride the collection class(/app/code/core/Mage/Catalog/Model/Resource/Product/collection.php and create a new function <?php public function sortByReview ( $dir ){ $table = $this -> getTable ( 'review/review' ); $entity_code_id = Mage :: getModel ( 'review/review' ) -> getEntityIdByCode (Mage_Rating_Model_Rating :: ENTITY_PRODUCT_CODE ); $cond = $this -> getConnection () -> quoteInto ( 't2.entity_pk_value = e.entity_id and ' , '' ) . $this -> getConnection () -> quoteInto ( 't2.entity_id = ? ' , $entity_code_id ); $this -...
Magento Website / Store Groups / Store Views Magento is much flexible and provide us a gteat flexibility for multistore setup.But there is a common confusion between Website,Store & Store View. If you login to your Magento backend and go to System > Manage Store There you'll find the terms "Website", "Store" and "Store view". This is really confusing as soon as you start digging into the code because there those terms are mapped to "Website", "Store Group" and "Store View": Backend Label Website Store Store View Model Class Mage_Core_Model_Website Mage_Core_Model_Store_Group Mage_Core_Model_Store Database Table core_website core_store_group core_store To always be clear I'll stick to the terms "Website", "Store Group" and "St...
How to Import custom less css 1- add new file this location (app\design\frontend\Vendor\Themename\web\css\source\_custom.less) 2-and import _custom.less file in _sources.less (app\design\frontend\Vendor\Themename\web\css\source\_sources.less) @import '_custom.less'; 3- Run static content deploy> Go to Root of M2 setup php bin/magento setup:static-content: deploy How to Override default less file 1-Copy file form vendor/magento/theme-frontend-blank/web/css/styles-l.less 2- Paste file here (app\design\frontend\Vendor\Themename\web\css\) In styles-l.less file import _styles.less and in _styles.less import _sources.less 3- Run static content deploy> Go to Root of M2 setup php bin/magento setup:static-content: deploy How to Import custom css file 1- add new file this location (app\design\frontend\Vendor\Themename\web\css\_custom1.less) ...
Comments
Post a Comment