ฉันกำลังดำเนินการเพิ่มส่วนต่างๆ ลงใน Magento Onepage Checkout และหลังจากพบปัญหาต่างๆ มากมาย ฉันก็กลับไปและลบโมดูลทั้งหมดและไฟล์ทั้งหมดที่แนบมาด้วย ฉันกลับไปที่การชำระเงิน และตอนนี้ทุกอย่างทำงานได้ตามปกติ ยกเว้นปุ่ม "ดำเนินการต่อ" ค้างอยู่ที่ส่วนการเรียกเก็บเงินเมื่อฉันเข้าสู่ระบบ ฉันเชื่อว่าปุ่มนี้เชื่อมต่อกับ onclick="billing.save()< /strong> ฟังก์ชันอินไลน์ ฉันยังใหม่กับ Magento และใหม่กับ Stack Overflow ดังนั้นนี่คือโค้ดของฉันสำหรับ billing.phtml แจ้งให้เราทราบหากต้องการข้อมูลเพิ่มเติมหรือหากฉันพลาดรายละเอียดบางอย่างในนี้ โพสต์ ฉันกระตือรือร้นที่จะเรียนรู้วิธีถามคำถามอย่างถูกต้องใน StackOverflow เพื่อให้ได้ประโยชน์สูงสุดจากไซต์นี้
*****
<div class="buttons-set" id="billing-buttons-container">
<p class="required"><?php echo $this->__('* Required Fields') ?></p>
<button type="button" title="<?php echo $this->__('Continue') ?>" class="button" onclick="billing.save()"><span><span><?php echo $this->__('Continue') ?></span></span></button>
<span class="please-wait" id="billing-please-wait" style="display:none;">
<img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
</span>
</div>
*****
<script type="text/javascript">
//<![CDATA[
var billing = new Billing('co-billing-form', '<?php echo $this->getUrl('checkout/onepage/getAddress') ?>address/', '<?php echo $this->getUrl('checkout/onepage/saveBilling') ?>');
var billingForm = new VarienForm('co-billing-form');
//billingForm.setElementsRelation('billing:country_id', 'billing:region', '<?php echo $this->getUrl('directory/json/childRegion') ?>', '<?php echo $this->__('Select State/Province...') ?>');
$('billing-address-select') && billing.newAddress(!$('billing-address-select').value);
var billingRegionUpdater = new RegionUpdater('billing:country_id', 'billing:region', 'billing:region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'billing:postcode');
//]]>
</script>
ความช่วยเหลือใด ๆ ที่ชื่นชมมาก ขอบคุณล่วงหน้า!
Type Error: "checkout" is undefined onclick()
ฉันถือว่าสิ่งนี้เกี่ยวข้องกับเมื่อมีการโหลดไฟล์ JS ถ้าฉันเข้าใจ ไฟล์ JS ควรจะโหลดอยู่ในส่วนหัว ในขณะที่โค้ดอินไลน์นี้ควรอยู่ในเนื้อหา ซึ่งหมายความว่าควรเข้าใจฟังก์ชัน onclick แบบอินไลน์ ฉันขาดสิ่งอื่นไปหรือเปล่า? - person jonullberg   schedule 20.03.2013