我正在使用Magento ver。 1.9.0.1
我用lotusbreath一页结帐扩展版。 3.2.1但是当我选择了访客用户时,在完成所有步骤后,当我点击“下订单”按钮时,ajax for post正在调用,但它没有进入成功页面并显示错误ReferenceError: Review is not defined
但它对于注册工作正常用户。
请参阅以下代码:
/app/design/frontend/base/default/template/lotusbreath/onestepcheckout/onepage/review/info.phtml
<?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; ?>
如果有任何人知道,请帮助我。 谢谢!
答案 0 :(得分:0)
将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>
答案 1 :(得分:0)
在以下文件中添加脚本。
app / design / frontend / base / default / template / checkout / onepage / review.phtml
tqdm
在下面的链接中找到了修复程序。
https://github.com/EBSCOSoftwareDev/siegeldisplay/commit/baa87eb796491b21e719f5e30f594c50131d45f2