Skip to content

Instantly share code, notes, and snippets.

@cfgalvani
Forked from schmengler/add-checkout-form-key.sh
Created November 6, 2018 15:15
Show Gist options
  • Save cfgalvani/cdf620fea12c0fe54fc278c57c957892 to your computer and use it in GitHub Desktop.
Save cfgalvani/cdf620fea12c0fe54fc278c57c957892 to your computer and use it in GitHub Desktop.
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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment