Community Forums 

Main Content

New WEb Site Design

    Mar 30 2012 17:04:38

    #1

    Yahweh's Alive & Well

    Join date : 2008-10-01      Posts : 123

    this file won't display buy buttons

    <?php
    if (file_exists("openinfo.php") OR isset($_REQUEST['dblink']) OR empty($dblink))
    die("Cannot open file.");

    require_once(SB_INC_DIR ."/products_variables.php");

    // START TABLE
    echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" ";
    if ($Line_Color)
    echo "class=\"linetable\" ";
    echo "style=\"width: 100%\">";

    if ($Item_Columns > 0)
    $tcwidth = floor(100/$Item_Columns);

    // CREATE ITEM BOXES
    if (($page == "_all" OR $page == "all") AND $totalsearchnum > 0)
    $totscount = $totalsearchnum;
    else
    $totscount = $Item_Columns * $Item_Rows;

    for ($scount = 1; $searchrow = mysql_fetch_array($searchresult), $scount <= $totscount; ++$scount)
    {
    $totalinvcount = 0;

    // ATTRIBUTE QUERY
    $chkoptsquery = "SELECT Attributes FROM " .SB_DB_PREFIX ."_options WHERE ItemID='" .(int)$searchrow[ID] ."' AND Active='Yes' AND OptionNum='1' AND Attributes LIKE '%:%' LIMIT 1";
    $chkoptsresult = mysql_query($chkoptsquery, $dblink) or die ("Unable to access database.");
    $chkoptsnum = mysql_num_rows($chkoptsresult);
    $chkoptsarray = array();
    if ($chkoptsnum == 1)
    {
    $chkoptsrow = mysql_fetch_row($chkoptsresult);
    $chkoptsarray = explode("~", $chkoptsrow[0]);
    }

    // CREATE VARS
    $display_outofstock = var_oos($searchrow[OutOfStock], $searchrow[Inventory], $inventorycheck);
    $priceset = var_optchk($display_outofstock, $chkoptsnum);
    $stripitem = var_item($searchrow[Item]);
    $stripalt = var_alt($stripitem, $searchrow[Keywords], $use_alt_kw);
    $multitemlink = doItemLink (stripslashes($searchrow[Item]), $searchrow[0], "auto");
    $display_imglink1 = var_imglink($searchrow[SmImage], $multitemlink, $stripitem, $stripalt, "smalllinkimage1");
    $display_imglink2 = var_imglink($searchrow[SmImage2], $multitemlink, $stripitem, $stripalt, "smalllinkimage2");
    $display_imglink3 = var_imglink($searchrow[SmImage3], $multitemlink, $stripitem, $stripalt, "smalllinkimage3");
    $display_itemlink = "<a href=\"$multitemlink\" class=\"itemcolor\">" .stripslashes($searchrow[Item]) ."</a>";
    $display_pricerange = var_pricerange($chkoptsarray, $searchrow[RegPrice], $searchrow[SalePrice]);
    $display_priceoos = var_showoos($searchrow[OutOfStock], $searchrow[Inventory], $display_pricerange);

    // BREAK IF FINISHED
    if ($scount % $Item_Columns == 1 AND $scount > $searchnum)
    break;

    // START TABLE ROWS
    if ($scount % $Item_Columns == 1)
    echo "<tr>";
    echo "<td align=\"center\" valign=\"top\" ";
    if ($Line_Color)
    echo "class=\"linecell\" ";
    echo "style=\"width: $tcwidth%\">";

    // DISPLAY PRODUCT DETAILS ONLY IF A PRODUCT EXISTS
    if (!empty($searchrow[0]))
    {

    // DISPLAY PRODUCT IMAGES
    if (!empty($display_imglink1))
    echo $display_imglink1;

    // DISPLAY PRODUCT NAME
    if (!empty($display_itemlink))
    echo $display_itemlink ."<br />";

    // DISPLAY PRODUCT PRICE RANGES
    if (!empty($display_pricerange) AND $show_prices == "yes")
    echo $display_priceoos ."<br />";

    }
    // END PRODUCT

    echo "</td>";
    if ($scount % $Item_Columns == 0)
    echo "</tr>";
    }
    // END TABLE ROWS

    // EMAIL FRIEND LINK
    if (!empty($display_emailpg))
    echo "<tr><td class=\"accent\" align=\"center\" colspan=\"$Item_Columns\">$display_emailpg</td></tr>";
    echo "</table>";
    ?>

    this one does

    <?php
    if (file_exists("openinfo.php") OR isset($_REQUEST['dblink']) OR empty($dblink))
    die("Cannot open file.");

    // Display one item
    $searchrow = mysql_fetch_array($searchresult);
    require_once(SB_INC_DIR ."/products_variables.php");
    $totalinvcount = 0;

    // ATTRIBUTE QUERY
    $chkoptsquery = "SELECT Attributes FROM " .SB_DB_PREFIX ."_options WHERE ItemID='" .(int)$searchrow[ID] ."' AND Active='Yes' AND OptionNum='1' AND Attributes LIKE '%:%' LIMIT 1";
    $chkoptsresult = mysql_query($chkoptsquery, $dblink) or die ("Unable to access database.");
    $chkoptsnum = mysql_num_rows($chkoptsresult);
    $chkoptsarray = array();
    if ($chkoptsnum == 1)
    {
    $chkoptsrow = mysql_fetch_row($chkoptsresult);
    $chkoptsarray = explode("~", $chkoptsrow[0]);
    }

    // OPTION QUERY
    $display_outofstock = var_oos($searchrow[OutOfStock], $searchrow[Inventory], $inventorycheck);
    $optquery = "SELECT * FROM " .SB_DB_PREFIX ."_options WHERE ItemID = '" .(int)$searchrow[ID] ."' ORDER BY OptionNum";
    $optresult = mysql_query($optquery, $dblink) or die ("Unable to access database.");
    $optnum = mysql_num_rows($optresult);
    if ($Show_Ord_Button == "No" OR !empty($display_outofstock))
    $optnum = 0;

    // RELATED QUERY
    $relquery = "SELECT " .SB_DB_PREFIX ."_related.RelatedID, " .SB_DB_PREFIX ."_items.Item, " .SB_DB_PREFIX ."_items.SmImage, " .SB_DB_PREFIX ."_items.Keywords FROM " .SB_DB_PREFIX ."_related, " .SB_DB_PREFIX ."_items WHERE ";
    $relquery .= SB_DB_PREFIX ."_related.RelatedID = " .SB_DB_PREFIX ."_items.ID AND " .SB_DB_PREFIX ."_related.ProductID = '" .(int)$searchrow[ID] ."' AND " .SB_DB_PREFIX ."_items.Active='Yes'";
    if ($Show_OOS == "No")
    $relquery .= " AND " .SB_DB_PREFIX ."_items.OutOfStock='No' AND (" .SB_DB_PREFIX ."_items.Inventory > 0 OR " .SB_DB_PREFIX ."_items.Inventory IS NULL)";
    $relresult = mysql_query($relquery, $dblink) or die ("Unable to view related items.");
    $relnum = mysql_num_rows($relresult);

    // CREATE VARS
    $priceset = var_optchk($display_outofstock, $chkoptsnum);
    $stripitem = var_item($searchrow[Item]);
    $stripalt = var_alt($stripitem, $searchrow[Keywords], $use_alt_kw);
    $unitprice = var_mainprice($searchrow[RegPrice], $searchrow[SalePrice]);
    $Show_Ord_Button = var_showorder($unitprice, $chkoptsnum, $Set_Ord_Button, $show_prices);
    $unitinfo = var_catnum($searchrow[Catalog]);
    $display_item = var_dispitem($stripitem, $unitinfo);
    $display_description = var_description($searchrow[Description], $URL, $Image_Dir, $ThumbnailImage_Dir, $LgImage_Dir, $CatImage_Dir, "n");
    $display_descriptiondiv = var_description($searchrow[Description], $Image_Dir, $ThumbnailImage_Dir, $LgImage_Dir, $CatImage_Dir, "y");
    $display_discounts = var_discounts($searchrow[DiscountPr], $membersonly_showprices, $membercode, $memdisc);
    $display_formflds = var_formfields($pgnm_noext, $searchrow[ID], $Return_URL, $stripitem, $unitinfo, $unitprice, $searchrow[Units], $searchrow[TaxPercent], $searchrow[Wholesale], $display_description);
    $display_smimage1 = var_smallimage($searchrow[SmImage], $searchrow[LgImage], "smallimage1", $stripitem, $stripalt);
    $display_smimage2 = var_smallimage($searchrow[SmImage2], $searchrow[LgImage2], "smallimage2", $stripitem, $stripalt);
    $display_smimage3 = var_smallimage($searchrow[SmImage3], $searchrow[LgImage3], "smallimage3", $stripitem, $stripalt);
    $display_zoom = var_zoom($searchrow[SmImage], $searchrow[SmImage2], $searchrow[SmImage3], $searchrow[LgImage], $searchrow[LgImage2], $searchrow[LgImage3]);
    $display_lgimage1 = var_largeimage($searchrow[LgImage], "largeimage1", $stripitem, $stripalt);
    $display_lgimage2 = var_largeimage($searchrow[LgImage2], "largeimage2", $stripitem, $stripalt);
    $display_lgimage3 = var_largeimage($searchrow[LgImage3], "largeimage3", $stripitem, $stripalt);
    $display_popup = var_popups($searchrow[PopUpPg]);
    $display_popup2 = var_popups($searchrow[PopUpPg2]);
    $display_popup3 = var_popups($searchrow[PopUpPg3]);
    $display_popup4 = var_popups($searchrow[PopUpPg4]);
    $display_popup5 = var_popups($searchrow[PopUpPg5]);
    $display_limited = var_limited($searchrow[Inventory], $searchrow[OutOfStock], $searchrow[ID]);
    $display_inventory = var_invcheck($err, $emsg, $itm, $searchrow[ID], $inv, $opt);
    $display_price = var_showprice($searchrow[RegPrice], $searchrow[SalePrice], $unitprice);
    $display_wholesale = var_wholesale($searchrow[Wholesale], $searchrow[WSOnly], $display_outofstock);
    $display_coupon = var_member($display_outofstock, $display_wholesale);
    $display_orderbutton = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "button");
    $display_showqty = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "show");
    $display_hiddenqty = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "hide");
    $display_registrybutton = var_regbutton($Show_Ord_Button, $display_outofstock);
    $display_emaillink = var_emailfriend($searchrow[ID], $searchrow[Wholesale], "link");
    $display_emailpg = var_emailfriend($searchrow[ID], $searchrow[Wholesale], "page");
    $multitemlink = doItemLink (stripslashes($searchrow[Item]), $searchrow[0], "auto");
    $display_itemlink = "<a href=\"$multitemlink\" class=\"itemcolor\">" .stripslashes($searchrow[Item]) ."</a>";
    $display_moreinfo = "<a href=\"$multitemlink\" class=\"itemcolor\">$label_moreinfo</a>";
    $display_imglink1 = var_imglink($searchrow[SmImage], $multitemlink, $stripitem, $stripalt, "smalllinkimage1");
    $display_imglink2 = var_imglink($searchrow[SmImage2], $multitemlink, $stripitem, $stripalt, "smalllinkimage2");
    $display_imglink3 = var_imglink($searchrow[SmImage3], $multitemlink, $stripitem, $stripalt, "smalllinkimage3");
    $display_oos = var_oos($searchrow[OutOfStock], $searchrow[Inventory]);
    $display_morecat1 = var_showcatlink($searchrow[Category1]);
    $display_morecat2 = var_showcatlink($searchrow[Category2]);
    $display_morecat3 = var_showcatlink($searchrow[Category3]);
    $display_outofstock = var_overrideoos($searchrow[Inventory], $display_outofstock);
    $display_gtin = var_item($searchrow[GTIN]);
    $label_gtin = $searchrow[GID];
    $display_mpn = var_item($searchrow[MPN]);
    $display_brand = var_item($searchrow[Brand]);

    if (!empty($display_formflds))
    echo "<form method=\"post\" action=\"$URL/" .SB_GO_DIR ."/order.php\">";

    echo "<a name=\"$searchrow[0]\"></a>";
    echo "<div align=\"center\">";

    // DISPLAY FORM FIELDS
    if (!empty($display_formflds))
    echo $display_formflds;

    echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\">";

    // LARGE IMAGES
    if (!empty($display_lgimage1))
    echo "<tr><td align=\"center\" colspan=\"2\">$display_lgimage1</td></tr>";
    if (!empty($display_lgimage2))
    echo "<tr><td align=\"center\" colspan=\"2\">$display_lgimage2</td></tr>";
    if (!empty($display_lgimage3))
    echo "<tr><td align=\"center\" colspan=\"2\">$display_lgimage3</td></tr>";

    // PRODUCT NAME
    if (!empty($display_item))
    echo "<tr><td align=\"center\" colspan=\"2\" class=\"boldtext\">$display_item</td></tr>";

    // SHOW POP UPS
    if (!empty($display_popup))
    echo "<tr><td align=\"left\" colspan=\"2\">$display_popup</td></tr>";
    if (!empty($display_popup2))
    echo "<tr><td align=\"left\" colspan=\"2\">$display_popup2</td></tr>";
    if (!empty($display_popup3))
    echo "<tr><td align=\"left\" colspan=\"2\">$display_popup3</td></tr>";
    if (!empty($display_popup4))
    echo "<tr><td align=\"left\" colspan=\"2\">$display_popup4</td></tr>";
    if (!empty($display_popup5))
    echo "<tr><td align=\"left\" colspan=\"2\">$display_popup5</td></tr>";

    // LIMITED ITEMS MESSAGE
    if (!empty($display_limited))
    echo "<tr><td align=\"center\" colspan=\"2\" class=\"accent\">$display_limited</td></tr>";

    // INVENTORY CHECK
    if (!empty($display_inventory))
    echo "<tr><td align=\"center\" colspan=\"2\" class=\"salecolor\">$display_inventory</td></tr>";

    // DISCOUNT PRICES
    if (!empty($display_discounts))
    echo "<tr><td valign=\"top\" align=\"left\" colspan=\"2\">$display_discounts</td></tr>";

    // PRODUCT IDENTIFIERS
    if (!empty($display_gtin))
    echo "<tr><td valign=\"top\" align=\"right\" class=\"accent\">$label_gtin</td><td valign=\"top\" align=\"left\">$display_gtin</td></tr>";
    if (!empty($display_mpn))
    echo "<tr><td valign=\"top\" align=\"right\" class=\"accent\">$label_mpn</td><td valign=\"top\" align=\"left\">$display_mpn</td></tr>";
    if (!empty($display_brand))
    echo "<tr><td valign=\"top\" align=\"right\" class=\"accent\">$label_brand</td><td valign=\"top\" align=\"left\">$display_brand</td></tr>";

    // ITEM PRICE
    if (!empty($display_price))
    echo "<tr><td valign=\"top\" align=\"right\" class=\"accent\">$label_price</td><td valign=\"top\" align=\"left\">$display_price</td></tr>";

    // OUT OF STOCK
    if (!empty($display_outofstock))
    echo "<tr><td valign=\"top\" align=\"center\" colspan=\"2\" class=\"accent\">$display_outofstock</td></tr>";

    // DISPLAY OPTIONS
    if ($optnum > 0 AND $show_prices == "yes")
    {
    for ($optcount = 1; $optrow = mysql_fetch_array($optresult); ++$optcount)
    {
    if ($optrow[Active] == "Yes")
    {
    $optionname = stripslashes($optrow[3]);
    $attributes = stripslashes($optrow[5]);
    $attributes = str_replace("\"", "&quot;", $attributes);
    $product_id = $searchrow[0];
    echo "<tr><td valign=\"top\" align=\"right\" class=\"accent\">" .optionnames($optionname) .":</td>";
    echo "<td valign=\"top\" align=\"left\">";
    echo "<input type=\"hidden\" name=\"opttype$optcount\" value=\"$optrow[4]\" />";
    echo "<input type=\"hidden\" name=\"optname$optcount\" value=\"$optionname\" />";
    include (SB_INC_DIR ."/products_options.php");
    echo "</td></tr>";
    }
    }
    }

    // WHOLESALE DISCOUNTS
    if (!empty($display_wholesale))
    echo "<tr><td valign=\"top\" align=\"right\" class=\"accent\">$label_wholesale</td><td valign=\"top\" align=\"left\">$display_wholesale</td></tr>";

    // MEMBER DISCOUNTS
    if (!empty($display_coupon))
    echo "<tr><td valign=\"top\" align=\"right\" class=\"accent\">$label_coupon</td><td valign=\"top\" align=\"left\">$display_coupon</td></tr>";

    // START ORDER DETAILS W/ BUTTON
    if (!empty($display_orderbutton))
    echo "<tr><td valign=\"top\" align=\"right\" class=\"accent\">$label_qty</td><td valign=\"top\" align=\"left\">$display_showqty &nbsp; $display_orderbutton $display_registrybutton</td></tr>";
    else if (!empty($display_registrybutton))
    echo "<tr><td valign=\"top\" colspan=\"2\">$display_registrybutton</td></tr>";

    // DESCRIPTION
    if (!empty($display_description))
    echo "<tr><td align=\"left\" colspan=\"2\">$display_description</td></tr>";

    echo "</table>";
    echo "</div>";
    if (!empty($display_formflds))
    echo "</form>";

    // EMAIL FRIEND LINK
    if (!empty($display_emaillink))
    echo "<p align=\"center\">$display_emaillink</p>";

    // RELATED ITEMS
    if ($relnum > 0)
    {
    echo "<div class=\"accent\" align=\"center\">";
    echo "<div>$relatedmsg</div>";
    echo "<div style=\"display:inline-block; text-align: left;\">";
    include (SB_INC_DIR ."/products_related.php");
    echo "</div>";
    echo "</div>";
    }

    // RETURN TO CATALOG LINK
    $retlink = "";
    if (!empty($ref_page) OR !empty($ref_catid) OR !empty($ref_new) OR !empty($ref_all) OR !empty($ref_sale) OR !empty($ref_feat))
    {
    if (!empty($ref_catid))
    {
    $rcatquery = "SELECT Category FROM " .SB_DB_PREFIX ."_categories WHERE ID='" .(int)$ref_catid ."' LIMIT 1";
    $rcatresult = mysql_query($rcatquery, $dblink);
    if (mysql_num_rows($rcatresult) == 1)
    {
    $rcatrow = mysql_fetch_row($rcatresult);
    $retlink = doCatLink (stripslashes($rcatrow[0]), $ref_catid, $ref_page);
    }
    }
    else if (!empty($ref_all))
    $retlink = doCatLink ("all", "", $ref_page);
    else if (!empty($ref_new))
    $retlink = doCatLink ("new", "", $ref_page);
    else if (!empty($ref_sale))
    $retlink = doCatLink ("sale", "", $ref_page);
    else if (!empty($ref_feat))
    $retlink = doCatLink ("featured", "", $ref_page);
    }
    if (!empty($retlink))
    echo "<p align=\"center\"><a href=\"$retlink\">$label_return</a></p>";
    ?>

    Can anyone help me with the code to make the buy buttons display using the first one?



    Apr 01 2012 15:27:41

    #2

    anon

    Join date : 2008-09-18      Posts : 488

    With that much code, it is tough to tell just by looking at it (and we don't know the contents of products_variables.php).

    Some general advice: Add print_r and echo debug statements to your code to check variable values and logic conditions. That should lead you to your problem.

    Hint: If you use print_r to look at array values, make a function like this to make the output more readable:
    function print_debug($var, $name=null) {
    echo("<br />");
    if(!empty($name)) echo("$" . $name . ":\r");
    echo("<pre>\r");
    print_r($var);
    echo("</pre>\r");
    return;
    }



    Apr 01 2012 16:53:25

    #3

    Yahweh's Alive & Well

    Join date : 2008-10-01      Posts : 123

    anon,

    thank you for responding! I am new with php and don't understand enough to edit files and make it come out right like I can with html files. So I really don' t understand what you you are suggesting I do.

    Maybe this will help?

    The section to display the button in the first file is this

    // START ORDER DETAILS W/ BUTTON
    if (!empty($display_orderbutton))
    echo "<tr><td valign=\"top\" align=\"right\" class=\"accent\">$label_qty</td><td valign=\"top\" align=\"left\">$display_showqty   $display_orderbutton $display_registrybutton</td></tr>";
    else if (!empty($display_registrybutton))
    echo "<tr><td valign=\"top\" colspan=\"2\">$display_registrybutton</td></tr>";

    // DESCRIPTION
    if (!empty($display_description))
    echo "<tr><td align=\"left\" colspan=\"2\">$display_description</td></tr>";

    echo "</table>";
    echo "</div>";
    if (!empty($display_formflds))
    echo "</form>";

    (which has the product description inserted below the button and they are within the same form) I figured this out because the buy button was below the description at first and moving it here put the button above it.

    I tried putting this code minus the DESCRIPTION into the first file's code in place of

    // DISPLAY PRODUCT PRICE RANGES
    if (!empty($display_pricerange) AND $show_prices == "yes")
    echo $display_priceoos ."<br />";

    then in the same file under
    // CREATE VARS

    I made it
    // CREATE VARS
    $display_outofstock = var_oos($searchrow[OutOfStock], $searchrow[Inventory], $inventorycheck);
    $priceset = var_optchk($display_outofstock, $chkoptsnum);
    $stripitem = var_item($searchrow[Item]);
    $stripalt = var_alt($stripitem, $searchrow[Keywords], $use_alt_kw);
    $Show_Ord_Button = var_showorder($unitprice, $chkoptsnum, $Set_Ord_Button, $show_prices);
    $multitemlink = doItemLink (stripslashes($searchrow[Item]), $searchrow[0], "auto");
    $display_imglink1 = var_imglink($searchrow[SmImage], $multitemlink, $stripitem, $stripalt, "smalllinkimage1");
    $display_imglink2 = var_imglink($searchrow[SmImage2], $multitemlink, $stripitem, $stripalt, "smalllinkimage2");
    $display_imglink3 = var_imglink($searchrow[SmImage3], $multitemlink, $stripitem, $stripalt, "smalllinkimage3");
    $display_itemlink = "<a href=\"$multitemlink\" class=\"itemcolor\">" .stripslashes($searchrow[Item]) ."</a>";
    $display_orderbutton = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "button");
    $display_showqty = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "show");
    $display_hiddenqty = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "hide");

    So this is what I ended up with

    <?php
    if (file_exists("openinfo.php") OR isset($_REQUEST['dblink']) OR empty($dblink))
    die("Cannot open file.");

    require_once(SB_INC_DIR ."/products_variables.php");

    // START TABLE
    echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"0\" ";
    if ($Line_Color)
    echo "class=\"linetable\" ";
    echo "style=\"width: 100%\">";

    if ($Item_Columns > 0)
    $tcwidth = floor(100/$Item_Columns);

    // CREATE ITEM BOXES
    if (($page == "_all" OR $page == "all") AND $totalsearchnum > 0)
    $totscount = $totalsearchnum;
    else
    $totscount = $Item_Columns * $Item_Rows;

    for ($scount = 1; $searchrow = mysql_fetch_array($searchresult), $scount <= $totscount; ++$scount)
    {
    $totalinvcount = 0;

    // ATTRIBUTE QUERY
    $chkoptsquery = "SELECT Attributes FROM " .SB_DB_PREFIX ."_options WHERE ItemID='" .(int)$searchrow[ID] ."' AND Active='Yes' AND OptionNum='1' AND Attributes LIKE '%:%' LIMIT 1";
    $chkoptsresult = mysql_query($chkoptsquery, $dblink) or die ("Unable to access database.");
    $chkoptsnum = mysql_num_rows($chkoptsresult);
    $chkoptsarray = array();
    if ($chkoptsnum == 1)
    {
    $chkoptsrow = mysql_fetch_row($chkoptsresult);
    $chkoptsarray = explode("~", $chkoptsrow[0]);
    }

    // CREATE VARS
    $display_outofstock = var_oos($searchrow[OutOfStock], $searchrow[Inventory], $inventorycheck);
    $priceset = var_optchk($display_outofstock, $chkoptsnum);
    $stripitem = var_item($searchrow[Item]);
    $stripalt = var_alt($stripitem, $searchrow[Keywords], $use_alt_kw);
    $Show_Ord_Button = var_showorder($unitprice, $chkoptsnum, $Set_Ord_Button, $show_prices);
    $multitemlink = doItemLink (stripslashes($searchrow[Item]), $searchrow[0], "auto");
    $display_imglink1 = var_imglink($searchrow[SmImage], $multitemlink, $stripitem, $stripalt, "smalllinkimage1");
    $display_imglink2 = var_imglink($searchrow[SmImage2], $multitemlink, $stripitem, $stripalt, "smalllinkimage2");
    $display_imglink3 = var_imglink($searchrow[SmImage3], $multitemlink, $stripitem, $stripalt, "smalllinkimage3");
    $display_itemlink = "<a href=\"$multitemlink\" class=\"itemcolor\">" .stripslashes($searchrow[Item]) ."</a>";
    $display_orderbutton = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "button");
    $display_showqty = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "show");
    $display_hiddenqty = var_qtyordbutton($display_outofstock, $Show_Ord_Button, $Order_Button, "hide");

    // BREAK IF FINISHED
    if ($scount % $Item_Columns == 1 AND $scount > $searchnum)
    break;

    // START TABLE ROWS
    if ($scount % $Item_Columns == 1)
    echo "<tr>";
    echo "<td align=\"center\" valign=\"top\" ";
    if ($Line_Color)
    echo "class=\"linecell\" ";
    echo "style=\"width: $tcwidth%\">";

    // DISPLAY PRODUCT DETAILS ONLY IF A PRODUCT EXISTS
    if (!empty($searchrow[0]))
    {

    // DISPLAY PRODUCT IMAGES
    if (!empty($display_imglink1))
    echo $display_imglink1;

    // DISPLAY PRODUCT NAME
    if (!empty($display_itemlink))
    echo $display_itemlink ."<br />";

    // START ORDER DETAILS W/ BUTTON
    if (!empty($display_orderbutton))
    echo "<tr><td valign=\"top\" align=\"right\" class=\"accent\">$label_qty</td><td valign=\"top\" align=\"left\">$display_showqty   $display_orderbutton $display_registrybutton</td></tr>";
    else if (!empty($display_registrybutton))
    echo "<tr><td valign=\"top\" colspan=\"2\">$display_registrybutton</td></tr>";

    echo "</table>";
    echo "</div>";
    if (!empty($display_formflds))
    echo "</form>";

    }
    // END PRODUCT

    echo "</td>";
    if ($scount % $Item_Columns == 0)
    echo "</tr>";
    }
    // END TABLE ROWS

    // EMAIL FRIEND LINK
    if (!empty($display_emailpg))
    echo "<tr><td class=\"accent\" align=\"center\" colspan=\"$Item_Columns\">$display_emailpg</td></tr>";
    echo "</table>";
    ?>

    If you would like I will post the product_variables.php

    Will it help if I post links to the pages being displayed?



    Apr 01 2012 18:29:18

    #4

    anon

    Join date : 2008-09-18      Posts : 488

    Say you want to see the value of $scount in your loop. You would add the line:

    echo("scount=" . $scount . "<br />");

    inside your loop. Upload the page, then browse to it. You will see the value of scount each time it increments.

    If you want to see the value of an array, like $searchrow, you would use the function I gave you and add the line:

    print_debug($searchrow, "searchrow");

    to your script inside the loop.

    BTW, I don't see where you are running a query to populate the mysql result set $searchresult. It may be in populated in product_variables.php. If not, that may be your problem. Although your for statement should throw an error if $searchresult isn't a valid mysql result set.



    Apr 06 2012 17:52:33

    #5

    Yahweh's Alive & Well

    Join date : 2008-10-01      Posts : 123

    anon,

    Thank you for all your help. I will let you know when I figure it all out. I'm not familiar enough with all these processes yet. I did check the product_variables file though think it might be something there too. I'll keep you posted.



    May 10 2012 17:59:11

    #6

    Yahweh's Alive & Well

    Join date : 2008-10-01      Posts : 123

    Staredt with another file that displays what I wanted and edited out what I didn't want in it, renamed it the file name I needed and now it works beautifully.



    May 12 2012 14:48:27

    #7

    anon

    Join date : 2008-09-18      Posts : 488

    Great!