Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Bailey matt-bailey

View GitHub Profile
@matt-bailey
matt-bailey / customer_account.xml
Last active Nov 10, 2020
Disable My Account sidebar links in Magento 2
View customer_account.xml
<?xml version="1.0"?>
<!--
/**
* Copyright © 2016 Magento. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<!-- Remove unwanted account navigation links -->
View drawer.js
/**
* drawer.js
*/
define(['jquery', 'm2base'], function($, m2base) {
'use strict';
var Drawer = window.M2base.Drawer = {
elements: {
@matt-bailey
matt-bailey / m2-setup-install.sh
Last active Oct 7, 2018
Example Magento 2 setup:install command
View m2-setup-install.sh
php bin/magento setup:install --base-url=http://mysite.dev --db-host=localhost --db-name=mysite --db-user=root --admin-firstname=Magento --admin-lastname=User --admin-email=my@email.com --admin-user=admin --admin-password=password123 --language=en_GB --currency=GBP --timezone=Europe/London --use-rewrites=1 --backend-frontname=admin
@matt-bailey
matt-bailey / package.json
Created May 8, 2015
Bare bones package.json file
View package.json
{
"name": "[project-name]",
"description": "[project-description]",
"version": "1.0.0"
}
@matt-bailey
matt-bailey / Gruntfile.js
Created May 8, 2015
SC5 Style Guide Generator Grunt usage instructions
View Gruntfile.js
module.exports = function(grunt) {
var gulp = require('gulp'),
styleguide = require('sc5-styleguide');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
@matt-bailey
matt-bailey / magento-notifications.html
Last active Sep 14, 2017
Magento notification markup
View magento-notifications.html
<ul class="messages">
<li class="error-msg">
<ul>
<li><span>Error Message</span></li>
</ul>
</li>
<li class="success-msg">
<ul>
<li><span>Success Message</span></li>
</ul>
@matt-bailey
matt-bailey / style-guide.html
Last active Aug 29, 2015
Basic HTML markup for use in style guides - it contains some of the standard BEM style class naming conventions I use.
View style-guide.html
<h1>Style Guide</h1>
<hr>
<h2>Display Headings</h2>
<h1 class="font-family--tradegothic">Display Heading 1<br>
<span class="sub-heading">Display Heading 1 Sub-heading</span></h1>
<h2 class="font-family--tradegothic">Display Heading 2<br>
<span class="sub-heading">Display Heading 2 Sub-heading</span></h2>
@matt-bailey
matt-bailey / local.xml
Created Mar 11, 2015
How to edit Magento's top links
View local.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="root">
<reference name="top.links">
<!-- Add custom links. Pretty self-explanatory.
Dig into app/code/core/Mage/Page/Block/Template/Links.php for more info -->
<action method="addLink" translate="label title">
<label>About Us</label>
<url>about</url> <!-- can use full url also -->
@matt-bailey
matt-bailey / nosto-actions.phtml
Created Feb 4, 2015
Magento & Nosto: How to add 'Add To Cart' and 'Add To Wishlist' buttons to Nosto recommendation templates
View nosto-actions.phtml
<div class="actions">
<button class="button btn-cart" type="button" title="Add to Basket" onclick="nostojs(function(api){api.reportAddToCart('$!product.productId','$!divId');});setLocation('/checkout/cart/add/product/$!product.productId');">
<span><span>Add to Basket</span></span>
</button>
<a class="button link-wishlist" href="/wishlist/index/add/product/$!product.productId">Add to Wishlist</a>
</div>
@matt-bailey
matt-bailey / nosto-stars.html
Last active Aug 29, 2015
Magento & Nosto: How to add Star Ratings to Nosto recommendation templates
View nosto-stars.html
<!--
/**
* Add this markup to the recommendation template in your Nosto control panel
*/
-->
<div class="ratings-wrapper">
<div class="ratings">
<div class="rating-box">
<div class="rating" style="width:$!product.tags1.get(0)%"></div>
</div>
You can’t perform that action at this time.