I have just modified the getPrice function in app/code/core/Mage/Catalog/Model/Product/Type/Price.php to:
/**
* Default action to get price of product
*
* @return decimal
*/
public function getPrice($product)
{
$product = Mage::getModel('catalog/product')->load($product->getId());
return $product->getData('cost') * $product->getMarkup();
}
However in my category pages the price displayed is still the old price as entered in the Price attribute in the admin section.
Could someone please help me work out what I need to edit to get both prices displaying the same value again please?
Thanks.
EDIT:
Looks like it might be an issue with this code from my product/price.phtml file. Can anyone spot anything in this that might mean it isnt working?
Thanks again for any help!
<?php else: ?>
<?php if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, array(0, 1))): // including ?>
<?php $weeeAmountToDisplay = $_taxHelper->displayPriceIncludingTax() ? $_weeeTaxAmountInclTaxes : $_weeeTaxAmount ?>
<span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_price + $weeeAmountToDisplay, true, true) ?>
</span>
<?php if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 1)): // show description ?>
<span class="weee">(
<?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
<?php echo $_weeeSeparator; ?>
<?php echo $_weeeTaxAttribute->getName(); ?>
: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount() + ($_taxHelper->displayPriceIncludingTax() ? $_weeeTaxAttribute->getTaxAmount() : 0), true, true); ?>
<?php $_weeeSeparator = ' + '; ?>
<?php endforeach; ?>
)</span>
<?php endif; ?>
<?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 4)): // incl. + weee ?>
<span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->formatPrice($_price + $_weeeTaxAmount, true) ?>
</span>
<span class="weee">(
<?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
<?php echo $_weeeSeparator; ?>
<?php echo $_weeeTaxAttribute->getName(); ?>: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount() + $_weeeTaxAttribute->getTaxAmount(), true, true); ?>
<?php $_weeeSeparator = ' + '; ?>
<?php endforeach; ?>
)</span>
<?php elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 2)): // excl. + weee + final ?>
<span class="regular-price"><?php echo $_coreHelper->formatPrice($_price, true) ?></span><br/>
<?php $weeeAmountToDisplay = $_taxHelper->displayPriceIncludingTax() ? $_weeeTaxAmountInclTaxes : $_weeeTaxAmount ?>
<?php foreach ($_weeeTaxAttributes as $_weeeTaxAttribute): ?>
<span class="weee">
<?php echo $_weeeTaxAttribute->getName(); ?>
: <?php echo $_coreHelper->currency($_weeeTaxAttribute->getAmount() + ($_taxHelper->displayPriceIncludingTax() ? $_weeeTaxAttribute->getTaxAmount() : 0), true, true); ?>
</span>
<?php endforeach; ?>
<span class="regular-price"id="product-price-weee-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php echo $_coreHelper->currency($_price + $weeeAmountToDisplay, true, true) ?>
</span>
<?php else: ?>
<span class="regular-price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
<?php if ($_finalPrice == $_price): ?>
<?php echo $_coreHelper->formatPrice($_price, true) ?>
<?php else: ?>
<?php echo $_coreHelper->formatPrice($_finalPrice, true) ?>
<?php endif; ?>
</span>
<?php endif; ?>
<?php endif; ?>