Thursday, 27 July 2017

Magento 2 Commands

php bin/magento setup:upgrade
php bin/magento setup:di:compile
rm -rf var/* pub/static/*
php bin/magento setup:static-content:deploy
php bin/magento setup:static-content:deploy en_GB
php bin/magento indexer:reindex
php bin/magento cache:flush
php bin/magento cache:clean
chmod -R 777 var pub/static

php bin/magento maintenance:enable --ip=xxx.xx.xxx.xxx --ip=xxx.xx.xx.xxx
php bin/magento maintenance:disable

Cron Command:-
*/1 * * * * php -c <ini-file-path> <your Magento install dir>/bin/magento cron:run
*/1 * * * * php -c <ini-file-path> <your Magento install dir>/update/cron.php
*/1 * * * * php -c <ini-file-path> <your Magento install dir>/bin/magento setup:cron:run

Monday, 17 February 2014

Url rewrite in magento

Url rewrite in magento
Step1


Step2


Friday, 3 January 2014

Show new and featuted products on home page in magento by XML

Show new Product on home page xml

{{block type="catalog/product_new" name="home.catalog.product.new" alias="product_homepage" template="catalog/product/new.phtml"}} 


Show featured product on home page xml
{{block type="featuredproducts/listing"}} 

{{block type="featuredproducts/product_list" name="featured_product_list" as="featured_product_list" template="inchoo/featuredproducts/list.phtml"}}


Show best selleing product on home page xml
{{block type="bnm/bestsellingproduct" displaylocation="homepage" template="bnm/bestsellingproduct.phtml"}}

Thursday, 26 December 2013

my account Login logout script in magento header

my account Login logout script in magento header


<?php
$loggedIn = $this->helper("customer")->isLoggedIn();
if($loggedIn == 1){ echo "<a href=\"".Mage::getBaseUrl()."customer/account/logout/\" />Logout</a>"; }
else{ echo "<a href=\"".Mage::getBaseUrl()."customer/account/\" />Login</a>"; }
?>

Show currency symbol in magento header

Show currency symbol in magento header

<?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?>


Thursday, 12 December 2013

Related product in view page in magento


Related product in view page in magento

Remove this line of code from catalog.xml
app/design/frontend/default/Your theme/layout/catalog.xml

<reference name="right">
<block type="catalog/product_list_related" name="catalog.product.related" before="-" template="catalog/product/list/related.phtml"/>
</reference>

and add below line of code above the upsell xml bloxk in catalog.xml

<block type="catalog/product_list_related" name="catalog.product.related" as="related_products" before="-" template="catalog/product/list/related.phtml"/>

add this line of cade in view.phtml above upsell block:-

app/design/frontend/default/Your theme/template/catalog/product/view.phtml

<?php echo $this->getChildHtml('related_products') ?>