Magento

Die Zusammenfassung der Mehrwertsteuer ausblenden

Magento rechnet die verschiedenen Mehrwertsteuersätze einer Bestellung zusammen und zeigt diese unter anderem auch in der Bestellbestätigung. Nun ist es aber in Duetschland so, dass die sehr viele Shops nur Artikel mit dem vollen Mehrtwertsteuersatz vertreiben. Die Aufzählung des einen Satzes, zusammen mit der Summe der MwSt. wirkt dann wie eine unnötige doppelte Angabe. Einfach fehlerhaft. Und dass möchte der erfahrene Magento Programmierer ja nicht...

Das Template das zu ändern ist wäre in diesem Falle tax/order/tax.phtml. Die erste foreach Schleife, die über die Variable $rate iteriert ist zu deaktivieren. Dann wird auf die Zusammenfassung verzichtet. Alternativ könnte man auch fragen ob mehr als eine Rate hinterlegt, aber eigenlicht sollte Magento diese Logik von Haus aus beherrschen. Hier mal der vollständigkeit halber das komplette Template.

  1.  
  2.  
  3. <?php
  4. /**
  5.  * Magento
  6.  *
  7.  * NOTICE OF LICENSE
  8.  *
  9.  * This source file is subject to the Academic Free License (AFL 3.0)
  10.  * that is bundled with this package in the file LICENSE_AFL.txt.
  11.  * It is also available through the world-wide-web at this URL:
  12.  * http://opensource.org/licenses/afl-3.0.php
  13.  * If you did not receive a copy of the license and are unable to
  14.  * obtain it through the world-wide-web, please send an email
  15.  * to license@magentocommerce.com so we can send you a copy immediately.
  16.  *
  17.  * DISCLAIMER
  18.  *
  19.  * Do not edit or add to this file if you wish to upgrade Magento to newer
  20.  * versions in the future. If you wish to customize Magento for your
  21.  * needs please refer to http://www.magentocommerce.com for more information.
  22.  *
  23.  * @category design
  24.  * @package base_default
  25.  * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
  26.  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
  27.  */
  28. ?>
  29. <?php
  30. $_order = $this->getOrder();
  31. $_source = $this->getSource();
  32. $_fullInfo = $_source->getFullTaxInfo();
  33. global $taxIter; $taxIter++;
  34. ?>
  35. <?php ?>
  36.  
  37. <?php if ($this->displayFullSummary()): ?>
  38. <?php $isTop = 1; ?>
  39. <?php if ($_fullInfo) foreach ($_fullInfo as $info): ?>
  40. <?php if (isset($info['hidden']) && $info['hidden']) continue; ?>
  41. <?php
  42. $percent = $info['percent'];
  43. $amount = $info['amount'];
  44. $rates = $info['rates'];
  45. $isFirst = 1;
  46. ?>
  47. <?php foreach ($rates as $rate): ?>
  48.  
  49. <!-- the summary of each tax rate is not required in this shop -->
  50. <?php continue; # DISABLED BY RK ?>
  51.  
  52. <tr class="summary-details-<?php echo $taxIter; ?> summary-details<?php if ($isTop): echo ' summary-details-first'; endif; ?>"<?php if (!$this->getIsPlaneMode()):?> style="display:none;"<?php endif;?>>
  53. <td <?php echo $this->getLabelProperties()?>>
  54. <?php echo $rate['title']; ?>
  55. <?php if ($rate['percent']): ?>
  56. (<?php echo $rate['percent']; ?>%)
  57. <?php endif; ?>
  58.  
  59.  
  60. </td>
  61. <?php if ($isFirst): ?>
  62. <td <?php echo $this->getValueProperties()?> rowspan="<?php echo count($rates); ?>">
  63. <?php echo $_order->formatPrice($amount); ?>
  64. </td>
  65. <?php endif; ?>
  66. </tr>
  67. <?php $isFirst = 0; ?>
  68. <?php $isTop = 0; ?>
  69. <?php endforeach; ?>
  70. <?php endforeach; ?>
  71. <?php endif;?>
  72.  
  73. <?php if ($this->displayFullSummary() && $_fullInfo && !$this->getIsPlaneMode()): ?>
  74. <tr class="summary-total" onclick="expandDetails(this, '.summary-details-<?php echo $taxIter;?>')">
  75. <?php elseif ($this->displayFullSummary() && $_fullInfo && $this->getIsPlaneMode()): ?>
  76. <tr class="show-details">
  77. <?php else: ?>
  78. <tr>
  79. <?php endif; ?>
  80. <td <?php echo $this->getLabelProperties()?>>
  81. <?php if ($this->displayFullSummary()): ?>
  82. <div class="summary-collapse"><?php echo $this->__('Tax'); ?> <?php echo $rates[0]['percent'] ?>%</div>
  83. <?php else: ?>
  84. <?php echo $this->__('Tax'); ?>
  85. <?php endif;?>
  86. </td>
  87. <td <?php echo $this->getValueProperties()?>><?php echo $_order->formatPrice($_source->getTaxAmount()) ?></td>
  88. </tr>
  89.  
  90.  
  91.