-
- Karl456

-
Total Posts: 28
Joined: 2013-01-10
|
Hello,
I’ve created a new block called topcart in order to change the way the cart is in the header, however I’ve come across an issue in the way Magento calculates the items in the basket and the total price.
Here’s my code:
<?php if ($this->getIsNeedToDisplaySideBar()):?> <?php $_cartQty = $this->getSummaryCount(); $url = $this->getUrl('checkout/cart'); ?> <a href="<?php echo $url; ?>"> <span class="topcart"> <span class="basket"> <p class="amount"> <?php if($_cartQty == 0) { echo '0'; } else { echo $this->__('%s', $_cartQty); } ?> </p> </span> <span class="subtotal"> <span class="label"><?php echo $this->__('Your Cart') ?> (<?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()) ?>)</span> </span> </span> </a> <?php endif;?>
The problem starts on the homepage and all other pages excluding the checkout page.
With extreme values, let’s say 99999999 Ottoman’s from the sample data at £299.99 each, the total price is £29,998,999,700.01.
These two values are displayed correctly in the top cart, however, when I go to the homepage the values change, for no reason.
The Cart Quantity stays the same, but the total price becomes £100,000,000.00.
Then, if you add another item, let’s say a chair for £129.99, the total price and quantity is correct on the cart page. But on the homepage and other pages the quantity becomes 99999999.9999 and the total price becomes £100,000,000.00. which are not correct.
Has anyone else experienced an issue like this with extreme variables?
Regards,
Karl
|