【问题标题】:How to add two shipping methods at checkout in Magento?如何在 Magento 结帐时添加两种运输方式?
【发布时间】:2014-12-11 14:02:07
【问题描述】:
我无法将送货方式作为复选框。我有单选按钮。
实际上,我需要为 UPS、USPS 2nd air 和 USPS next day air 等运输方式添加一个单选按钮,但我需要在复选框中添加其他方式,以便任何人都可以选择我的 UPS 方式 + 选择我的自定义附加运输方式及其添加到小计的最终价格中。所以请任何人帮助我尝试解决这个问题......
提前致谢。
【问题讨论】:
标签:
php
jquery
magento
shipping
ups
【解决方案2】:
感谢您的建议,实际上我们已经为此制作了自定义模块,但问题是在选择该方法后,属于该运输方式的价格并未添加到购物车最终价格中。那么应该是什么错误。我的代码如下所示
<?php $mechtronicsAdditonal = Mage::getModel('mechtronicsShipment/carrier_additional'); ?>
<?php $additonalOptions = $mechtronicsAdditonal->getShippingRates() ?>
<?php if ($additonalOptions): ?>
<dt><?php echo $this->__('Additional Options') ?></dt>
<dd>
<ul class="mechtronicsCustom">
<?php foreach($additonalOptions as $_rate): ?>
<li>
<input name="shipping_additional_method[<?php echo $_rate->getCode() ?>]" type="checkbox" value="<?php echo $_rate->getCode() ?>" class="radio<?php if ($_rate->getTermsActive()): ?> terms-active <?php endif ?>"/>
<label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $_rate->getMethodTitle() ?></label>
</li>
<?php endforeach; ?>
</ul>
</dd>
<?php endif ?>
</dl>
<div id="shipping-terms" class="no-display">
<div class="title">
<?php echo $mechtronicsShipment->getTermsTitle() ?>
</div>
<div class="content">
<?php echo $mechtronicsShipment->getTermsContent() ?>
<div class="terms-check-content"><input type="checkbox" class="terms-check" /> By checking this box you understand and agree to the terms and conditions noted above.</div>
</div>
</div>