Jump to content

Delete price etc in Products


Recommended Posts

Hi there, I'm not an expert on this so maybe wait for one of the other guys:)

If in doubt, just comment out (I rarely ever delete anything, always comment out).

Also it's good practice to setup a test site. It's saved me a lot of headache in the past.

Link to comment
Share on other sites

Basically it's a way to say "don't use this in the code"

There are a few ways to do this:

<!-- don't show this -->

// don't show this

/* don't show this */

Only some of them work depending on the code you're working with. To be honest I've never really understood the rule here (when to best use each style).

Rocky recommends /* */ but like I said it doesn't seem to work in all types of code!!


Also the first type sometimes causes problems in Firefox so just be careful.

Link to comment
Share on other sites

I tried to delete in product.tpl It worked to a degree. The price etc. has gone from the product page. However, it is still on the index page. under the image. Also on the product page is the "add to cart" button.
Can anyone help me go further.
Here is the URL http://www.the-restaurant-guide.info/index.php. I have a simple intro page on the html index.

Link to comment
Share on other sites

The site is looking OK apart from the cart showing here http://www.the-restaurant-guide.info/product.php?id_product=5
if I can stop this showing here and on other pages I will be delighted.
I also need to remove the price and buy now button from the index page http://www.the-restaurant-guide.info/index.php
help greatly appreciated an rewarded by free advertising on one of my websites.

Link to comment
Share on other sites

You need to edit all the following files to remove or comment out add-to-cart and prices etc.

modules/homefeatured/homefeatured.tpl line 21-24

                         {l s='Add to cart' mod='homefeatured'}
                       {else}
{l s='Add to cart' mod='homefeatured'}
                       {/if}


themes/youtheme/product.tpl 176-177

        <!-- add to cart form-->
       <form id="buy_block" action="{$base_dir}cart.php" method="post">



187-234

            <!-- prices -->


               {if $product->on_sale}

{l s='On sale!'}
               {elseif ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product->reduction_from))}
{l s='Price lowered!'}
               {/if}



               {if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPrice(true, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax incl.'}{/if}
               {/if}
               {if $priceDisplay == 1}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}
                       {if $tax_enabled}{l s='tax excl.'}{/if}
               {/if}

               {if $priceDisplay == 2}


{convertPrice price=$product->getPrice(false, $smarty.const.NULL)} {l s='tax excl.'}
               {/if}



           {if ($product->reduction_price != 0 || $product->reduction_percent != 0) && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product->reduction_from))}


               {if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPriceWithoutReduct()}
                       {if $tax_enabled}{l s='tax incl.'}{/if}
               {/if}
               {if $priceDisplay == 1}
{convertPrice price=$product->getPriceWithoutReduct(true)}
                       {if $tax_enabled}{l s='tax excl.'}{/if}
               {/if}


           {/if}
           {if $product->reduction_percent != 0 && ($product->reduction_from == $product->reduction_to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $product->reduction_to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $product->reduction_from))}

{l s='(price reduced by'} {$product->reduction_percent|floatval} %{l s=')'}
           {/if}
           {if $packItems|@count}

{l s='instead of'} {convertPrice price=$product->getNoPackPrice()}


           {/if}
           {if $product->ecotax != 0}

{l s='include'} {convertPrice price=$product->ecotax} {l s='for green tax'}
           {/if}


themes/yourtheme/product-list.tpl Line 22-25

           
{l s='Add to cart'}
               {else}
{l s='Add to cart'}
               {/if}



You might also have to fiddle with the css styling of the pages that you remove the code from as everything will move around when the code isnt being used.

Link to comment
Share on other sites

I replaced all of the deleted code that you said to remove...
I did this step by step. Iy seems as though it was the change in modules/homefeatured/homefeatured.tpl line 21-24 that caused the products to disappear from the index page. It is now back toi the way it was.
After removing the codes above, the add to cart and price were still to be seen on the category page and on the product details.
I don't thnk this was the ricght code to remove.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...