1

I wanted to remove the price of products from appearing anywhere on my site. I bought and installed a hide price extension which worked for the catalog and products pages but some products appeared on the home page still with the price. This was because the theme had a "product tabs" feature which displayed some products on the home page.

I went into various files in the following path "app/design/frontend/mytheme/template" and commented out the PHP code which things such as the price and the stock. Here is an example:

 <div class="actions">
                            <div class="link-actions">
                                <?php if($quick_view):?><a data-toggle="tooltip" href="<?php echo $this->getUrl('arexworks/quickview/index',array('product_id'=>$_product->getId()));?>" class="button link-quickview" title="<?php echo $this->__('Quick View') ?>"><span class="fa fa-search"></span></a><?php endif;?><?php /*
    */?><?php if ($_compareUrl = $this->getAddToCompareUrl($_product)): ?><a data-toggle="tooltip" href="<?php echo $_compareUrl ?>" class="button link-compare" title="<?php echo $this->__('Add to Compare') ?>"><span class="fa fa-retweet"></span></a><?php endif; ?><?php /*
    */?><?php if ($this->helper('wishlist')->isAllow()) : ?><a data-toggle="tooltip" href="<?php echo $this->getAddToWishlistUrl($_product) ?>" class="button link-wishlist" title="<?php echo $this->__('Add to Wishlist') ?>"><span class="fa fa-heart-o"></span></a><?php endif; ?>
                            </div>
                            <?php /*if($_product->isSaleable()): ?>
                                <button onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')" class="button btn-cart" title="<?php echo $this->__('Add to Cart') ?>"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button>
                            <?php else: ?>
                                <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
                            <?php endif; ?>
                            <?php if($_product->getRatingSummary()):?>
                                <?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
                            <?php else:?>
                                <div class="ratings">
                                    <div class="rating-box">
                                        <div class="rating" style="width:0%"></div>
                                    </div>
                                </div>
                            <?php endif;*/?>
                        </div>

My question is will doing this break my site if I perform Magento updates, say, a year from now? If so, is there a better way to prevent prices from appearing anywhere on my site?

I have seen various comments saying "never modify the core code" but I don't know if that extends to simply commenting out some PHP.

Any help would be appreciated!

0

Copying files from base/default into your own theme is like copying a file to code/local/Mage.

The old file is no longer used.

Compared to a rewrite this means, that you not only pin a single method to your own implementation but the complete file.

The implication is in frontend not that bad, and what you are doing is best practice! The only thin I can think of which was really bad about this was the introduction of form_keys which were added to the base templates, but not to your own (how should they ;-)).

Therefore: No worries, but keep an eye on the changelogs!

An alternative to this would be to copy price.phtml (the smallest part possible) and just clean it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.