<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    I'm working on a site requirement where products in Ubercart with a
    0 price show a text message instead of an 'add to cart' form.<br>
    <br>
    The product list is being generated by views and presented in table
    layout. Some of the products selected by the view have a price (view
    is using 'sell price'), some do not.<br>
    <br>
    The current code works for the 'form_alter' for non-0 price. The
    current code works for replacing the form with text. <b>It does not
      work in determining which products (rows) in the table are 0
      price.</b><br>
    <br>
    I have not been able to nail down whether the issue is the reference
    to the 'price' field in the view record or if it is my comparison
    value (is it already formatted for display at this point).<br>
    <br>
    Any suggestions welcomed an appreciated.<br>
    <br>
    Here is my current code:<br>
    <blockquote type="cite">
      <pre><font color="#3333ff">&lt;?php
// $Id$

<font color="#000000">/**
* Implementation of hook_form_alter().
*/</font>
function clientname_cart_form_alter(&amp;$form, $form_state, $form_id) {
<font color="#000000">&nbsp; //only 'add to cart forms'</font>
&nbsp; if(substr($form_id, 0, 28) == 'uc_product_add_to_cart_form_')&nbsp; {
&nbsp;&nbsp;&nbsp; if($node-&gt;sell_price == 0) {
<font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // if 0.00 price, show 'call for quote' text</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $form['qty'] = array(
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#type'&nbsp;&nbsp; =&gt; 'markup',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#value' =&gt; '&lt;div&gt;Call for Quote&lt;/div&gt;',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $form['submit'] = array(
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#type' =&gt; 'markup',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#value' =&gt; '',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );
&nbsp;&nbsp;&nbsp; }
&nbsp;&nbsp;&nbsp; else {
<font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // if &gt;0.00 price alter the form</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $form['qty'] = array(
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#type'&nbsp;&nbsp; =&gt; 'textfield',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#default_value' =&gt; '1',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#description' =&gt; '',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#size' =&gt; '1',
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '#maxlength' =&gt; 4,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );
&nbsp;&nbsp;&nbsp; }
&nbsp; }
}
</font></pre>
    </blockquote>
    <pre></pre>
    Ron D.<br>
  </body>
</html>