Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Hide blank fields


Guest

Recommended Posts

I have hard coded product fields on a site I am building. Different products use different fields. How can I hide fields that do not have a value in the product listing?

 

Here is an example:

http://seocorp.com/osctesting/index.php?cPath=12

 

I know I must create an if() statement in index.php, but everything I have tried gives me a blank white screen.

 

Here is the code for my index.php:

http://www.seocorp.com/example_index.htm

 

 

On line 131, when I remove instances from the "$define_list array()", the removed fields are removed in the product listing. However I do not think I can apply an if() statement inside an array, if I can let me know how.

 

line 131-153 (index.php)

// create column list
$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
'PRODUCT_LIST_HOUSING_LENGTH' => PRODUCT_LIST_HOUSING_LENGTH,
'PRODUCT_LIST_TRAVEL_LENGTH' => PRODUCT_LIST_TRAVEL_LENGTH,
'PRODUCT_LIST_TUBE_BEND' => PRODUCT_LIST_TUBE_BEND,
'PRODUCT_LIST_END_STYLE' => PRODUCT_LIST_END_STYLE,
'PRODUCT_LIST_TAIL_PIECE' => PRODUCT_LIST_TAIL_PIECE,
'PRODUCT_LIST_STYLE' => PRODUCT_LIST_STYLE,
'PRODUCT_LIST_BCABLE_LENGTH' => PRODUCT_LIST_BCABLE_LENGTH,
'PRODUCT_LIST_TOTAL_LENGTH' => PRODUCT_LIST_TOTAL_LENGTH,
'PRODUCT_LIST_LENGTH' => PRODUCT_LIST_LENGTH,
'PRODUCT_LIST_END_1_FITTINGS' => PRODUCT_LIST_END_1_FITTINGS,
'PRODUCT_LIST_END_2_FITTINGS' => PRODUCT_LIST_END_2_FITTINGS,
'PRODUCT_LIST_COIL_END_BOOT' => PRODUCT_LIST_COIL_END_BOOT,
'PRODUCT_LIST_COLOR' => PRODUCT_LIST_COLOR,
'PRODUCT_LIST_LENGTH_WIRE_1' => PRODUCT_LIST_LENGTH_WIRE_1,
'PRODUCT_LIST_LENGTH_WIRE_2' => PRODUCT_LIST_LENGTH_WIRE_2,
'PRODUCT_LIST_SPARK_PLUG_BOOT' => PRODUCT_LIST_SPARK_PLUG_BOOT,
'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE,
'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW);

 

Hopefully somebody can help me with this. I just need a push in the right direction. Thanks in advance...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...