I have a product collection called using the following (set to show 6 items):
$_testproductCollection = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('*')
->setPageSize(6);
$_testproductCollection->load();
then i get the 6 products details with a foreach:
foreach($_testproductCollection as $_testproduct){
echo "Price is ".$this->htmlEscape($this->getPriceHtml($_product, true))."<br/>";
};
this works ok until I set my store to show prices inclusive of tax. Instead of showing 2 different prices, for example:
Excl. Tax: $138.56
Incl. Tax: $149.99
it shows the same price for both. If I add a call to the loaded product collection again immediately after it’s loaded:
$_productCollection=$this->getLoadedProductCollection();
…it works fine, the prices are correct, but then it’s skipping the setPageSize function and returning the full store collection of products.
How can I get the correct tax prices to show, and what is it in the getLoadedProductCollection that corrects this? The function is in Mage/Catalog/Block/Product/List.php
See
Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection::addTaxPercentsAlso, the
getLoadedProductCollectioncalls (via a catalog layer) theaddMinimalPriceandaddFinalPricemethods. From those docs you can see there are methods for adding tiered pricing and URL rewrites. That is nice to know.