Skip to content

Instantly share code, notes, and snippets.

@aadmathijssen
Forked from schmengler/add-checkout-form-key.sh
Last active October 29, 2019 13:52

Revisions

  1. aadmathijssen revised this gist Jun 6, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions add-checkout-form-key.sh
    Original file line number Diff line number Diff line change
    @@ -5,3 +5,7 @@ find -L app/design/frontend -name 'shipping.phtml' -or -name 'billing.phtml' -or
    find -L skin/frontend -name 'opcheckout.js' \
    | xargs grep -L form_key \
    | xargs perl -i -pe 's/if \(elements\[i\]\.name=='\''payment\[method\]'\''\) \{/if (elements[i].name=='\''payment[method]'\'' || elements[i].name == '\''form_key'\'') {/g'

    find -L js -name 'payment.js' \
    | xargs grep -L form_key \
    | xargs perl -i -pe 's/if \(elements\[i\]\.name=='\''payment\[method\]'\''\) \{/if (elements[i].name=='\''payment[method]'\'' || elements[i].name == '\''form_key'\'') {/g'
  2. aadmathijssen revised this gist Jun 6, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion add-checkout-form-key.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    find -L app/design/frontend -name 'shipping.phtml' -or -name 'billing.phtml' -or -name 'shipping_method.phtml' -or -name 'payment.phtml' \
    find -L app/design/frontend -name 'shipping.phtml' -or -name 'billing.phtml' -or -name 'shipping_method.phtml' -or -name 'payment.phtml' -or -name 'addresses.phtml' \
    | xargs grep -L formkey \
    | xargs perl -i -pe 's/<\/form>/<?php echo \$this->getBlockHtml("formkey") ?>\n<\/form>/g'

  3. aadmathijssen revised this gist Jun 1, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion add-checkout-form-key.sh
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,4 @@ find -L app/design/frontend -name 'shipping.phtml' -or -name 'billing.phtml' -or

    find -L skin/frontend -name 'opcheckout.js' \
    | xargs grep -L form_key \
    | xargs perl -i -pe 's/if \(elements\[i\]\.name=='\''payment\[method\]'\''\) {/if (elements[i].name=='\''payment[method]'\'' || elements[i].name == '\''form_key'\'') {/g'
    | xargs perl -i -pe 's/if \(elements\[i\]\.name=='\''payment\[method\]'\''\) \{/if (elements[i].name=='\''payment[method]'\'' || elements[i].name == '\''form_key'\'') {/g'
  4. aadmathijssen revised this gist Jun 1, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion add-checkout-form-key.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    find -L app/design/frontend -name 'shipping.phtml' -or -name 'billing.phtml' -or -name 'shipping_method.phtml' -or -name 'payment.phtml' \
    | xargs grep -L formkey \
    | xargs perl -i -pe 's/<\/form>/<?php echo \$this->getBlockHtml("formkey") ?><\/form>/g'
    | xargs perl -i -pe 's/<\/form>/<?php echo \$this->getBlockHtml("formkey") ?>\n<\/form>/g'

    find -L skin/frontend -name 'opcheckout.js' \
    | xargs grep -L form_key \
  5. aadmathijssen revised this gist Jun 1, 2017. 1 changed file with 7 additions and 5 deletions.
    12 changes: 7 additions & 5 deletions add-checkout-form-key.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,7 @@
    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'
    find -L app/design/frontend -name 'shipping.phtml' -or -name 'billing.phtml' -or -name 'shipping_method.phtml' -or -name 'payment.phtml' \
    | xargs grep -L formkey \
    | xargs perl -i -pe 's/<\/form>/<?php echo \$this->getBlockHtml("formkey") ?><\/form>/g'

    find -L skin/frontend -name 'opcheckout.js' \
    | xargs grep -L form_key \
    | xargs perl -i -pe 's/if \(elements\[i\]\.name=='\''payment\[method\]'\''\) {/if (elements[i].name=='\''payment[method]'\'' || elements[i].name == '\''form_key'\'') {/g'
  6. Fabian Schmengler / revised this gist Jun 1, 2017. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions add-checkout-form-key.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    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'
    | 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'
  7. Fabian Schmengler / revised this gist Jun 1, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion add-checkout-form-key.sh
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,3 @@
    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'
    | 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'
  8. Fabian Schmengler / revised this gist Jun 1, 2017. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion add-checkout-form-key.sh
    Original file line number Diff line number Diff line change
    @@ -1 +1,2 @@
    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 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'
  9. Fabian Schmengler / created this gist Jun 1, 2017.
    1 change: 1 addition & 0 deletions add-checkout-form-key.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    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'