Jquery “下订单”按钮在一页签出页magento中不起作用
我正在使用Magento ver。1.9.0.1 我使用了lotusbreath单页签出扩展版本。3.2.1但当我选择guest user时,当我单击Place Order按钮完成所有步骤后,ajax for post正在调用,但它不会进入成功页面,并显示错误引用error:Review未定义,但它对注册用户来说运行良好 请参阅下面的代码: /app/design/frontend/base/default/template/lotusbreath/onestepcheckout/onepage/review/info.phtmlJquery “下订单”按钮在一页签出页magento中不起作用,jquery,magento,magento-1.9,magento-1.9.1,Jquery,Magento,Magento 1.9,Magento 1.9.1,我正在使用Magento ver。1.9.0.1 我使用了lotusbreath单页签出扩展版本。3.2.1但当我选择guest user时,当我单击Place Order按钮完成所有步骤后,ajax for post正在调用,但它不会进入成功页面,并显示错误引用error:Review未定义,但它对注册用户来说运行良好 请参阅下面的代码: /app/design/frontend/base/default/template/lotusbreath/onestepcheckout/onepage
<?php echo $this->getChildHtml('items_before'); ?>
<div id="checkout-review-table-wrapper">
<table class="table data-table" id="checkout-review-table">
<?php if ($this->helper('tax')->displayCartBothPrices()): $colspan = $rowspan = 2; else: $colspan = $rowspan = 1; endif; ?>
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
<?php endif; ?>
<thead>
<tr>
<th rowspan="<?php echo $rowspan ?>"><?php echo $this->__('PHOTO') ?></th>
<?php /*?> <th colspan="<?php echo $colspan ?>" class="a-center"><?php echo $this->__('Price') ?></th><?php */?>
<th colspan="<?php echo $colspan ?>" class="a-center"><?php echo $this->__('Size') ?></th>
<th rowspan="<?php echo $rowspan ?>" wrap="wrap" class="a-center"><?php echo $this->__('Qty') ?></th>
<th colspan="<?php echo $colspan ?>" class="a-center"><?php echo $this->__('Price') ?></th>
<!--<th colspan="<?php echo $colspan ?>" class="a-center remove-item-diplay" style="display: none;"></th> -->
</tr>
<?php if ($this->helper('tax')->displayCartBothPrices()): ?>
<tr>
<th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
<th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
<th class="a-right"><?php echo $this->helper('tax')->getIncExcTaxLabel(false) ?></th>
<th><?php echo $this->helper('tax')->getIncExcTaxLabel(true) ?></th>
<!--<th></th> -->
</tr>
<?php endif; ?>
</thead>
<?php echo $this->getChildHtml('totals'); ?>
<tbody>
<?php foreach ($this->getItems() as $_item): ?>
<?php echo $this->getItemHtml($_item) ?>
<?php endforeach ?>
</tbody>
</table>
</div>
<?php echo $this->getChildHtml('items_after'); ?>
<script type="text/javascript">//jQuery('#checkout-review-table').decorate('table');</script>
<div id="checkout-review-submit">
</div>
<div id="checkout-paypaliframe-load" class="authentication white-popup mfp-hide"></div>
<div class="clearfix"></div>
<script type="text/javascript">
//<![CDATA[
review = new Review();
//]]>
</script>
/app/design/frontend/base/default/template/lotusbreath/onestepcheckout/onepage/review/totals.phtml
<?php
$isNewsletter = Mage::getStoreConfig('lotusbreath_onestepcheckout/general/allowsubscribe');
if ($isNewsletter){
if(Mage::getSingleton('customer/session')->isLoggedIn()){
$subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail(
Mage::getSingleton('customer/session')->getCustomer()->getEmail());
if($subscriber && $subscriber->getId())
{
$isNewsletter = false;
}
}
}
?>
<?php if ($this->getTotals()): ?>
<tfoot>
<?php $_colspan = $this->helper('tax')->displayCartBothPrices() ? 5 : 3; ?>
<?php echo $this->renderTotals(null, $_colspan); ?>
<!--<tr>
<td class="a-right" colspan="4" style="height: 10px;"></td>
</tr>
!-->
<?php echo $this->renderTotals('footer', $_colspan); ?>
<?php if ($this->needDisplayBaseGrandtotal()):?>
<tr>
<td class="a-right" colspan="<?php echo $_colspan; ?>">
<small><?php echo $this->helper('sales')->__('Your credit card will be charged for') ?></small>
</td>
<td class="a-right">
<small><?php echo $this->displayBaseGrandtotal() ?></small>
</td>
</tr>
<?php endif?>
<tr>
<td class="a-right" colspan="<?php echo $_colspan+ 1;?>">
<div class="row edit-cart-review">
<?php if (Mage::getStoreConfig('lotusbreath_onestepcheckout/revieworder/show_link_cart')):?>
<div class="forgot-link">
<span> <?php echo $this->__('Forgot an Item?') ?> <a
href="<?php echo $this->getUrl('checkout/cart') ?>"><?php echo $this->__('Edit Your Cart') ?>
</a>
</span>
</div>
<?php endif;?>
<?php
$canEditCart = Mage::getStoreConfig('lotusbreath_onestepcheckout/revieworder/can_edit_cart');
?>
<?php if ($canEditCart):?>
<div class="lt-buttons-set right" id="review-buttons-container">
<button type="button" name="edit_cart_action" id="edit_cart_action"
value="update_qty" title="<?php echo $this->__('Edit Your Cart') ?>" class="button btn-update">
<span><span><?php echo $this->__('Edit Your Cart') ?></span></span></button>
<button type="button" name="edit_cart_action" id="update_cart_action"
value="update_qty" title="<?php echo $this->__('Update') ?>" class="button btn-update" style="display: none;">
<span><span><?php echo $this->__('Update') ?></span></span></button>
<button type="button" name="edit_cart_action" id="cancel_cart_action"
value="update_qty" title="<?php echo $this->__('Cancel') ?>" class="button btn-close" style="display: none;"m>
<span><span><?php echo $this->__('Cancel') ?></span></span></button>
</div>
<?php endif;?>
</div>
<?php if ($isNewsletter):?>
<p class="newsletter">
<input type="checkbox" id="newsletter-signup" name="newsletter" value="1"
title="<?php echo Mage::helper('newsletter')->__('Sign up for our newsletter') ?>"
class="checkbox"
<?php
echo Mage::getStoreConfig('lotusbreath_onestepcheckout/general/autochecksubscriber') ? 'checked="checked"' : '';
?>
/>
<label for="newsletter-signup">
<?php echo Mage::helper('newsletter')->__('Sign up for our newsletter') ?>
</label>
</p>
<?php endif;?>
<?php echo $this->getChildHtml('agreements') ?>
<div id="saveOder-error" class="error"></div>
<button role='review-save' type="submit"
title="<?php echo Mage::helper('checkout')->__('Place Order') ?>" name="submitbtn"
id="lbonepage-place-order-btn" class="button btn-checkout">
<span><span><?php echo Mage::helper('checkout')->__('Place Order') ?></span></span>
</button>
</td>
</tr>
</tfoot>
<?php endif; ?>
如果有人知道,请帮帮我。
谢谢 将lotusbreath/onestepcheckout/onepage/review/info.phtml中的脚本更改为:
<script type="text/javascript">
//<![CDATA[
review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder', array('form_key' => Mage::getSingleton('core/session')->getFormKey())) ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements'));
//]]>
</script>
在下面的文件中添加脚本 app/design/frontend/base/default/template/checkout/onepage/review.phtml 在下面的链接中找到修复程序
如果这确实是review初始化的方式,那么它的构造函数中缺少一些数据。查看默认模板base/default/template/checkout/onepage/review/info.phml。另外,页面中是否包含正确的javascript文件?否,我试过了,但没用。有人能帮我找到解决方案吗?我已经试过了,但问题没有在JSON中解决。它显示成功错误为真为什么我不知道var/report文件夹中没有任何页面,但在响应部分,它在结果数组中显示:错误消息:请检查发货地址信息。请输入电话号码。电话号码在结帐页上是必需的。您必须在客户端进行验证,这在magento中是默认的。发生此错误是因为需要电话号码,并且它也会在服务器端进行验证,这是由于错误造成的。您能为我提供站点的链接吗对不起,实际上站点位于本地服务器中,因此我无法为您提供站点链接…是的,我已经在电话中输入了验证否,它也工作正常,但当我单击下订单按钮时,响应数据将显示此错误
<script type="text/javascript">
//<![CDATA[
review = new Review('<?php echo $this->getUrl('checkout/onepage/saveOrder', array('form_key' => Mage::getSingleton('core/session')->getFormKey())) ?>', '<?php echo $this->getUrl('checkout/onepage/success') ?>', $('checkout-agreements'));
//]]>