Include custom jQuery in Magento 2 phtml file

require([‘jquery’, ‘jquery/ui’], function($){
jQuery(document).ready( function() {
//do your code here
});
}

Advertisements

change magento2 addtocart style

Go to

  • C:\xampp7\htdocs\m1\pub\static\frontend\Magento\luma\en_US\css\styles-m.css
  • change style using the class .tocart
  • then run the deploy static-content:deploy command

 

yii tabs

Use this class “yii\bootstrap\Tabs” in the view file before using the tab

echo Tabs::widget([
‘items’ => [
[
‘label’ => ‘One’,
‘content’ => ‘Anim pariatur cliche…’,
‘active’ => true
],
[
‘label’ => ‘Two’,
‘content’ => ‘Anim pariatur cliche…’,
‘headerOptions’ => […],
‘options’ => [‘id’ => ‘myveryownID’],
],
[
‘label’ => ‘Example’,
‘url’ => ‘http://www.example.com’,
],
[
‘label’ => ‘Dropdown’,
‘items’ => [
[
‘label’ => ‘DropdownA’,
‘content’ => ‘DropdownA, Anim pariatur cliche…’,
],
[
‘label’ => ‘DropdownB’,
‘content’ => ‘DropdownB, Anim pariatur cliche…’,
],
[
‘label’ => ‘External Link’,
‘url’ => ‘http://www.example.com’,
],
],
],
],
]);