Forums / Templates, Stylesheets, Page Layout / Hide product prices if item is priced by attributes (php help)

Hide product prices if item is priced by attributes (php help)

Views: 636

Results 1 to 3 of 3
24 Jun 2012, 1:59 PM
#1
mi16chap avatar

mi16chap

New Zenner

Join Date:
Oct 2011
Location:
West Yorkshire - England
Posts:
38
Plugin Contributions:
0

Hide product prices if item is priced by attributes (php help)

Afternoon all

I have a handful of products which are priced by attributes. I dont like how the default behaviour displays the products base price plus the cost of attributes on top of that.
To work around I made the product cost £0 but then the attributes were priced fully.
The store still shows the price on the product listing as

<h2 id="productPrices" class="productGeneral">
£30.00</h2>

I still want to display this element of the page if the product IS NOT priced by attributes

I think I have identified where I should insert some code to do this..

includes/templates/<mytheme>/templates/tpl_product_info_display.php

and I think I need a php statement to say

if product_priced_by_attribute = 1 then dont display element

Im just unsure how to write this in php, any attempts I try just cause the rest of the page not to render.

Does anyone know how to write what I am after?

Feel free to look at this link for an example

http://test.italianhampers.co.uk/index.php?main_page=product_info&cPath=2&products_id=55

Any help greatly appreciated.

Regards
Andy

24 Jun 2012, 3:22 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Hide product prices if item is priced by attributes (php help)

mi16chap:

Afternoon all

To work around I made the product cost £0 but then the attributes were priced fully.

I'm not sure what this means. To price a product by attributes, the base price of the product should be set to 0.00.

24 Jun 2012, 3:37 PM
#3
mi16chap avatar

mi16chap

New Zenner

Join Date:
Oct 2011
Location:
West Yorkshire - England
Posts:
38
Plugin Contributions:
0

Re: Hide product prices if item is priced by attributes (php help)

I have managed to do this without any code changes.

  1. set the products price to 0.00
  2. set the product to product is free =NO
  3. set the product is priced by attributes=NO
  4. add your attributes to your product, including additional price for each attribute

This will then hide the master price on the product listing, and display the attribute drop down menu instead.
All non attribute products will display their prices as normal.