Posts

Showing posts from March, 2018

Magento2 Commands

These are Some Magento2 Commands  <?php //Magento Commands// ( 1 ) sudo chmod -R 777 var ( 2 ) sudo chmod -R 777 pub ( 3 ) rm -Rf var /generation ( 4 ) sudo chmod -R 777 / var /www/html/magento2 ( for permission to folder) //////////////////Setup Upgrade Using Command Line php bin/magento setup:upgrade /////////////////////If you don’t want to remove pub/static files while installing/updating database then use following command. php bin/magento setup:upgrade --keep-generated //////////////////Cache Clean Using Command Line php bin/magento cache:clean //////////////////Cache Flush Using Command Line php bin/magento cache: flush //////////////////View cache status Using Command Line php bin/magento cache:status ///////////////////////Enable Cache Using Command Line php bin/magento cache:enable [cache_type] //////////////////////Disable Cache Using Command Line php bin/magento cache:disable [cache_type] ////////////////////////Static...

Get Swatch Text Product id of Configurable Product in Detail Page through Jquery Magento2

Add This Script in Detail Page You will get id of selected Product <script type= "text/javascript" > require([ 'jquery' ], function (jQuery){ jQuery( 'body' ).on( 'click' , '.swatch-option' , function (e) { var swatchid = jQuery( '.swatch-attribute' ).attr( 'option-selected' ); if (swatchid) { selpro(); } }); }); function selpro () { var selected_options = {}; jQuery( 'div.swatch-attribute' ).each( function (k,v){ var attribute_id = jQuery(v).attr( 'attribute-id' ); var option_selected = jQuery(v).attr( 'option-selected' ); console.log(attribute_id, option_selected); if (!attribute_id || !option_selected){ return ;} if (attribute_id || option_selected){ selected_options[attribute_id] = option_selected; } }); console.log(sel...