Skip to content

Instantly share code, notes, and snippets.

@veritstudio
veritstudio / cms_page_view.xml
Last active August 22, 2019 06:29
Remove breadcrumbs from CMS Pages - Magento 2
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="breadcrumbs" remove="true" />
</body>
</page>
@veritstudio
veritstudio / checkout_index_index.xml
Created August 20, 2019 06:22
Remove progress bar from checkout - Magento 2
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.root">
@veritstudio
veritstudio / checkout_index_index.xml
Created August 19, 2019 20:03
Move coupon code to sidebar - Magento 2
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.root">
@veritstudio
veritstudio / run.js
Created August 16, 2019 12:51
Run JS component after ajax - Magento 2
$('body').trigger('contentUpdated');
@veritstudio
veritstudio / default.xml
Created June 19, 2019 06:14
Call CMS static block in layout xml file
<block class="Magento\Cms\Block\Block" name="[block_name]">
<arguments>
<argument name="block_id" xsi:type="string">[block_id]</argument>
</arguments>
</block>
@veritstudio
veritstudio / custom.phtml
Created June 13, 2019 19:24
Call CMS static block in phtm in Magento 2
<?= $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('your_block_id')->toHtml() ?>
@veritstudio
veritstudio / form.html
Last active November 2, 2019 13:38
Underscore.js templates in Magento 2
<form action="post" action="<% formActionUrl %>">
<input type="email" name="email">
<button type="submit"><% buttonText %></button>
</form>
@veritstudio
veritstudio / billing-address-mixin.js
Created May 24, 2019 19:34
Automatically check billing address same as shipping in Magento 2
define([
'jquery',
'Magento_Checkout/js/checkout-data',
'Magento_Checkout/js/model/quote'
],function ($, checkoutData, quote) {
'use strict';
return function (Component) {
return Component.extend({
define([
'jquery',
'mage/tooltip'
], function ($, tooltip) {
'use strict';
$('#desired-element').tooltip({
show: {
effect: 'none',
delay: 0
@veritstudio
veritstudio / LayoutProcessorPlugin.php
Last active January 20, 2019 16:04
Modify address fields in Magento 2 checkout
<?php
namespace VeritStudio\Checkout\Model\Checkout;
class LayoutProcessorPlugin
{
/**
* @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
* @param array $jsLayout
* @return array
*/