Skip to content

Instantly share code, notes, and snippets.

@moqada
Created November 14, 2012 02:43
Show Gist options
  • Save moqada/4069971 to your computer and use it in GitHub Desktop.
Save moqada/4069971 to your computer and use it in GitHub Desktop.
bookmarklet for eccube
(function() {
var i, payment_id;
if (/^\/shopping\/index\.php/.test(location.pathname)) {
// 非会員選択
if (document.getElementById('member_form2')) {
document.member_form2.submit();
return false;
}
// お届け先入力
document.form1.order_name01.value = '山田';
document.form1.order_name02.value = '太郎';
document.form1.order_kana01.value = 'ヤマダ';
document.form1.order_kana02.value = 'タロウ';
document.form1.order_zip01.value = '123';
document.form1.order_zip02.value = '0000';
document.form1.order_pref.value = '13';
document.form1.order_addr01.value = '千代田区神田神保町';
document.form1.order_addr02.value = '1-3-5';
document.form1.order_tel01.value = '03';
document.form1.order_tel02.value = '1234';
document.form1.order_tel03.value = '5678';
document.form1.order_email.value = 'customer@example.com';
document.form1.order_email_check.value = 'customer@example.com';
document.form1.order_sex[0].checked = true;
} else if (/^\/shopping\/payment\.php/.test(location.pathname)) {
// 支払い方法
payment_id = document.form1.payment_id;
if(payment_id.length === undefined && payment_id.checked) {
document.form1.submit();
return false;
}
for (i = 0; payment_id.length > i; i++) {
if (payment_id[i].checked) {
document.form1.submit();
return false;
}
}
if(payment_id.length > 1) {
payment_id = payment_id[0];
}
payment_id.click();
return false;
}
document.form1.submit();
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment