Advertisement
Guest User

John

a guest
Jul 17th, 2009
727
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 16.60 KB | None | 0 0
  1. <?php $_item = $this->getItem()?>
  2. <tr>
  3.     <td class="a-center"><a href="<?php echo $this->getDeleteUrl() ?>"><img src="<?php echo $this->getSkinUrl('images/btn_trash.gif') ?>" alt="<?php echo $this->__('Remove item')?>" title="<?php echo $this->__('Remove item')?>" /></a></td>
  4.     <td><a href="<?php echo $this->getProductUrl() ?>" class="product-image"><img src="<?php echo $this->getProductThumbnail()->resize(75); ?>" width="75" alt="<?php echo $this->htmlEscape($this->getProductName()) ?>" title="<?php echo $this->htmlEscape($this->getProductName()) ?>" /></a></td>
  5.     <td>
  6.         <h3 class="product-name"><a href="<?php echo $this->getProductUrl() ?>"><?php echo $this->getProductName() ?></a></h3>
  7.         <?php if ($_options = $this->getOptionList()):?>
  8.         <? /* Code Pasted from Inchoo.net starts here */?>
  9.             <?php
  10.                 if($this->getProduct()->isConfigurable()){
  11.                 $_product = Mage::getModel('catalog/product')->load($this->getProduct()->getId());
  12.                 Mage::getBlockSingleton('catalog/product_view_type_configurable')->unsetData();
  13.                 $_configurable = Mage::getBlockSingleton('catalog/product_view_type_configurable')->setData('product', $_product);
  14.                 $_cdata = json_decode($_configurable->getJsonConfig());
  15.                 $_current = array();
  16.                 foreach((array)$this->getOptionList() as $_option) {
  17.                 $_current[$_option['label']]=$_option['value'];
  18.                 }
  19.                 foreach($_cdata->attributes as $attribute) {
  20.         ?>
  21.        
  22.         <strong><?php echo $attribute->label; ?></strong>
  23.             <select style="width:150px;" name="cart[<?php echo $_item->getId() ?>][option][< ?php echo $attribute->id ?>]">
  24.                 <?php foreach($attribute->options as $option) { ?>
  25.                     <option <?php echo ($_current[$attribute->label]==$option->label) ? ' selected' : '' ?> value="< ?php echo $option->id ?>"><?php echo $option->label ?> <?php echo $this->helper('checkout')->formatPrice($option->price+$_item->getProduct()->getPrice()) ?></option>
  26.                 <?php } ?>
  27.             </select>
  28.     <?php } } else { } ?> <!--UNSURE ABOUT THIS -->
  29.     <? /* Code Pasted from Inchoo.net starts here */?>
  30.         <!-- ORIGINAL CODE FROM THIS POINT FORWARD -->
  31.         <dl class="item-options">
  32.             <?php foreach ($_options as $_option) : ?>
  33.             <?php $_formatedOptionValue = $this->getFormatedOptionValue($_option['value']) ?>
  34.             <dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
  35.             <dd<?php if (isset($_formatedOptionValue['full_view'])): ?> class="truncated"<?php endif; ?>><?php echo $_formatedOptionValue['value'] ?>
  36.                 <?php if (isset($_formatedOptionValue['full_view'])): ?>
  37.                 <div class="truncated_full_value">
  38.                     <dl class="item-options">
  39.                         <dt><?php echo $this->htmlEscape($_option['label']) ?></dt>
  40.                         <dd><?php echo $_formatedOptionValue['full_view'] ?></dd>
  41.                     </dl>
  42.                 </div>
  43.                 <?php endif; ?>
  44.             </dd>
  45.             <?php endforeach; ?>
  46.         </dl>
  47.         <?php endif;?>
  48.         <?php if ($messages = $this->getMessages()): ?>
  49.         <?php foreach ($messages as $message): ?>
  50.             <p class="item-msg <?php echo $message['type'] ?>">* <?php echo $message['text'] ?></p>
  51.         <?php endforeach; ?>
  52.         <?php endif; ?>
  53.     </td>
  54.     <?php if ($this->helper('wishlist')->isAllowInCart()) : ?>
  55.     <td class="a-center">
  56.         <input type="checkbox" value="1" name="cart[<?php echo $_item->getId() ?>][wishlist]" class="checkbox" />
  57.     </td>
  58.     <?php endif ?>
  59.     <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
  60.     <td class="a-right">
  61.         <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  62.             <div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
  63.         <?php else: ?>
  64.             <div class="cart-price">
  65.         <?php endif; ?>
  66.  
  67.             <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  68.                 <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?>
  69.             <?php else: ?>
  70.                 <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()) ?>
  71.             <?php endif; ?>
  72.  
  73.         </div>
  74.  
  75.  
  76.         <?php if (Mage::helper('weee')->getApplied($_item)): ?>
  77.  
  78.             <div class="cart-tax-info" id="eunit-item-tax-details<?php echo $_item->getId(); ?>" style="display: none;">
  79.                 <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  80.                     <small>
  81.                     <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
  82.                         <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
  83.                     <?php endforeach; ?>
  84.                     </small>
  85.                 <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  86.                     <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
  87.                         <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
  88.                     <?php endforeach; ?>
  89.                 <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  90.                     <small>
  91.                     <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
  92.                         <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
  93.                     <?php endforeach; ?>
  94.                     </small>
  95.                 <?php endif; ?>
  96.             </div>
  97.  
  98.             <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  99.                 <div class="cart-tax-total" onclick="taxToggle('eunit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
  100.                     <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getCalculationPrice()+$_item->getWeeeTaxAppliedAmount()+$_item->getWeeeTaxDisposition()); ?></span>
  101.                 </div>
  102.             <?php endif; ?>
  103.         <?php endif; ?>
  104.     </td>
  105.     <?php endif; ?>
  106.     <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
  107.     <td class="a-right">
  108.         <?php $_incl = $this->helper('checkout')->getPriceInclTax($_item); ?>
  109.         <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  110.             <div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
  111.         <?php else: ?>
  112.             <div class="cart-price">
  113.         <?php endif; ?>
  114.  
  115.             <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  116.                 <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?>
  117.             <?php else: ?>
  118.                 <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxDisposition()) ?>
  119.             <?php endif; ?>
  120.  
  121.         </div>
  122.         <?php if (Mage::helper('weee')->getApplied($_item)): ?>
  123.  
  124.             <div class="cart-tax-info" id="unit-item-tax-details<?php echo $_item->getId(); ?>" style="display: none;">
  125.                 <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  126.                     <small>
  127.                     <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
  128.                         <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount'],true,true); ?></span><br />
  129.                     <?php endforeach; ?>
  130.                     </small>
  131.                 <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  132.                     <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
  133.                         <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></small></span><br />
  134.                     <?php endforeach; ?>
  135.                 <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  136.                     <small>
  137.                     <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
  138.                         <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['amount_incl_tax'],true,true); ?></span><br />
  139.                     <?php endforeach; ?>
  140.                     </small>
  141.                 <?php endif; ?>
  142.             </div>
  143.  
  144.             <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  145.                 <div class="cart-tax-total" onclick="taxToggle('unit-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
  146.                     <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedAmount()); ?></span>
  147.                 </div>
  148.             <?php endif; ?>
  149.         <?php endif; ?>
  150.     </td>
  151.     <?php endif; ?>
  152.     <td class="a-center">
  153.         <input name="cart[<?php echo $_item->getId() ?>][qty]" value="<?php echo $this->getQty() ?>" size="4" class="input-text qty" maxlength="8" />
  154.     </td>
  155.     <?php if ($this->helper('tax')->displayCartPriceExclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
  156.     <td class="a-right">
  157.         <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  158.             <div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
  159.         <?php else: ?>
  160.             <div class="cart-price">
  161.         <?php endif; ?>
  162.  
  163.             <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  164.                 <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?>
  165.             <?php else: ?>
  166.                 <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()) ?>
  167.             <?php endif; ?>
  168.  
  169.         </div>
  170.         <?php if (Mage::helper('weee')->getApplied($_item)): ?>
  171.  
  172.             <div class="cart-tax-info" id="esubtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display: none;">
  173.                 <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  174.                     <small>
  175.                     <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
  176.                         <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span><br />
  177.                     <?php endforeach; ?>
  178.                     </small>
  179.                 <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  180.                     <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
  181.                         <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
  182.                     <?php endforeach; ?>
  183.                 <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  184.                     <small>
  185.                     <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
  186.                         <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
  187.                     <?php endforeach; ?>
  188.                     </small>
  189.                 <?php endif; ?>
  190.             </div>
  191.  
  192.             <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  193.                 <div class="cart-tax-total" onclick="taxToggle('esubtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
  194.                     <span class="nobr"><?php echo Mage::helper('weee')->__('Total'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_item->getRowTotal()+$_item->getWeeeTaxAppliedRowAmount()+$_item->getWeeeTaxRowDisposition()); ?></span>
  195.                 </div>
  196.             <?php endif; ?>
  197.         <?php endif; ?>
  198.     </td>
  199.     <?php endif; ?>
  200.     <?php if ($this->helper('tax')->displayCartPriceInclTax() || $this->helper('tax')->displayCartBothPrices()): ?>
  201.     <td class="a-right">
  202.         <?php $_incl = $this->helper('checkout')->getSubtotalInclTax($_item); ?>
  203.         <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  204.             <div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
  205.         <?php else: ?>
  206.             <div class="cart-price">
  207.         <?php endif; ?>
  208.  
  209.             <?php if (Mage::helper('weee')->typeOfDisplay($_item, array(0, 1, 4), 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  210.                 <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?>
  211.             <?php else: ?>
  212.                 <?php echo $this->helper('checkout')->formatPrice($_incl-$_item->getWeeeTaxRowDisposition()) ?>
  213.             <?php endif; ?>
  214.  
  215.         </div>
  216.  
  217.  
  218.         <?php if (Mage::helper('weee')->getApplied($_item)): ?>
  219.  
  220.             <div class="cart-tax-info" id="subtotal-item-tax-details<?php echo $_item->getId(); ?>" style="display: none;">
  221.                 <?php if (Mage::helper('weee')->typeOfDisplay($_item, 1, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  222.                     <small>
  223.                     <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
  224.                         <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount'],true,true); ?></span><br />
  225.                     <?php endforeach; ?>
  226.                     </small>
  227.                 <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  228.                     <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
  229.                         <span class="nobr"><small><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></small></span><br />
  230.                     <?php endforeach; ?>
  231.                 <?php elseif (Mage::helper('weee')->typeOfDisplay($_item, 4, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  232.                     <small>
  233.                     <?php foreach (Mage::helper('weee')->getApplied($_item) as $tax): ?>
  234.                         <span class="nobr"><?php echo $tax['title']; ?>: <?php echo Mage::helper('checkout')->formatPrice($tax['row_amount_incl_tax'],true,true); ?></span><br />
  235.                     <?php endforeach; ?>
  236.                     </small>
  237.                 <?php endif; ?>
  238.             </div>
  239.  
  240.             <?php if (Mage::helper('weee')->typeOfDisplay($_item, 2, 'sales') && $_item->getWeeeTaxAppliedAmount()): ?>
  241.                 <div class="cart-tax-total" onclick="taxToggle('subtotal-item-tax-details<?php echo $_item->getId(); ?>', this, 'cart-tax-total-expanded');">
  242.                     <span class="nobr"><?php echo Mage::helper('weee')->__('Total incl. tax'); ?>:<br /> <?php echo $this->helper('checkout')->formatPrice($_incl+$_item->getWeeeTaxAppliedRowAmount()); ?></span>
  243.                 </div>
  244.             <?php endif; ?>
  245.         <?php endif; ?>
  246.     </td>
  247.     <?php endif; ?>
  248. </tr>
  249.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement