Skip to content

Instantly share code, notes, and snippets.

@speedupmate
Created April 25, 2012 18:59
Show Gist options
  • Save speedupmate/5f8b1c20f88b0bbfcc61 to your computer and use it in GitHub Desktop.
Save speedupmate/5f8b1c20f88b0bbfcc61 to your computer and use it in GitHub Desktop.
original totals
<?php
$_coreHelper = $this->helper('core');
$checkoutHelper = Mage::helper('onestepcheckout/checkout');
?>
<table class="onestepcheckout-summary">
<thead>
<tr>
<th class="name"><?php echo $this->__('Product'); ?></th>
<th class="qty"><?php echo $this->__('Qty'); ?></th>
<th class="total"><?php echo $this->__('Subtotal'); ?></th>
</tr>
</thead>
<?php foreach($this->getItems() as $item): ?>
<tr>
<td class="name">
<?php echo $item->getName(); ?>
<?php if($checkoutHelper->settings['show_custom_options']): ?>
<?php $options = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct()); ?>
<?php if(isset($options['options']) && count($options['options']) > 0): ?>
<ul class="onestepcheckout-custom-options">
<?php foreach($options['options'] as $option): ?>
<li><b><?php echo $option['label'] . ':</b> ' . $option['value']; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if($item->getProduct()->isConfigurable()): ?>
<?php
$configurable_options = $item->getProduct()->getTypeInstance(true)->getSelectedAttributesInfo($item->getProduct());
?>
<?php if(is_array($configurable_options) && count($configurable_options) > 0): ?>
<ul class="onestepcheckout-custom-options">
<?php foreach($configurable_options as $option): ?>
<li><b><?php echo $option['label']; ?>:</b> <?php echo $option['value']; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</td>
<td class="qty"><?php echo $item->getQty(); ?></td>
<td class="total">
<?php if($checkoutHelper->settings['display_tax_included']): ?>
<?php echo $this->helper('checkout')->formatPrice($this->helper('checkout')->getSubtotalInclTax($item)); ?>
<?php else: ?>
<?php echo $this->helper('checkout')->formatPrice($item->getRowTotal()); ?>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<table class="onestepcheckout-totals">
<?php echo $this->renderTotals(); ?>
<?php echo $this->renderTotals('footer'); ?>
</table>
<script type="text/javascript">
//<![CDATA[
var total = <?php echo $this->getGrandTotal();?>;
if(payment.reloadcallback){
var url = '<?php echo $this->getUrl('onestepcheckout/ajax/paymentrefresh', array('_secure'=>true)); ?>';
paymentrefresh(url);
payment.countreload = 0;
payment.reloadcallback = false;
}
//]]>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment