Skip to content

Instantly share code, notes, and snippets.

@schmengler
schmengler / add-checkout-form-key.sh
Last active September 2, 2022 16:23
Magento SUPEE-9767 Checkout Form Key Theme Patch
find -L app/design/frontend -regex '.*\(shipping\|billing\|shipping_method\|payment\).phtml' -exec grep -L formkey {} \; \
| xargs sed -i 's/<\/form>/<?php echo $this->getBlockHtml("formkey") ?><\/form>/g'
find -L skin/frontend -name 'opcheckout.js' -exec grep -L form_key {} \; \
| xargs sed -i 's/if (elements\[i\].name=='\''payment\[method\]'\'') {/if (elements[i].name=='\''payment[method]'\'' || elements[i].name == '\''form_key'\'') {/g'
@matt-bailey
matt-bailey / customer_account.xml
Last active July 3, 2023 23:10
Disable My Account sidebar links in Magento 2
<?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 -->
@conroyp
conroyp / setup_mailcatcher.sh
Created August 23, 2014 17:31
Mailcatcher installation script for Ubuntu 14.04
#!/bin/bash
# Install dependencies
apt-get install libsqlite3-dev ruby1.9.1-dev
# Install the gem
gem install mailcatcher
# Make it start on boot
echo "@reboot $(which mailcatcher) --ip=0.0.0.0" >> /etc/crontab
update-rc.d cron defaults
@thagxt
thagxt / How to Get the Base Url for a specific Magento Store View.php
Created April 23, 2014 12:25
How to Get the Base Url for a specific Magento Store View
<?php
/*
+ If you want, you can set manually the '$storeId' with the number (id) of the desired store.
+ You can also change 'Mage_Core_Model_Store::URL_TYPE_LINK' with one of these:
- Mage_Core_Model_Store::URL_TYPE_JS
- Mage_Core_Model_Store::URL_TYPE_LINK
- Mage_Core_Model_Store::URL_TYPE_MEDIA
- Mage_Core_Model_Store::URL_TYPE_SKIN
- Mage_Core_Model_Store::URL_TYPE_WEB