$product_data['number_of_rows'] = $number_of_rows; // Send the page start $display = open_list_top($product_data, $unique_data); // Start over and cycle through the data $this_row = 0; while ($this_row++ < $number_of_rows) { $product_data['this_row'] = $this_row; // Grab the *unique* producer_fee_percent from the product data (otherwise not available) if (isset($product_data[$this_row]['producer_fee_percent'])) { // NOTE this will give bogus values if the producer_fee_percent is not the same for // every product during the ordering cycle $unique_data['producer_fee_percent'] = $product_data[$this_row]['producer_fee_percent']; } $product_data[$this_row]['random_weight_display'] = random_weight_display_calc($product_data, $unique_data); $product_data[$this_row]['business_name_display'] = business_name_display_calc($product_data, $unique_data); $product_data[$this_row]['pricing_display'] = pricing_display_calc($product_data, $unique_data); // $product_data['total_display'] = total_display_calc($product_data); $product_data[$this_row]['total_display'] = $product_data['amount']; $product_data[$this_row]['inventory_display'] = inventory_display_calc($product_data, $unique_data); // New major division if ($product_data[$this_row][$major_product] != $product_data[$this_row - 1][$major_product] && $show_major_product == true) { if ($listing_is_open) { if ($show_minor_product) { $display .= minor_product_close($product_data, $unique_data); } $display .= major_product_close($product_data, $unique_data); $listing_is_open = 0; } $display .= major_product_open($product_data, $unique_data); // New major division will force a new minor division ${$minor_product_prior} = -1;
} else { $row['is_wholesale_item'] = false; } // Get the availability for this product at this member's chosen site_id // Two conditions will allow products to be purchased (availability = true): // 1. No availibility set for the producer means the product is available everywhere // 2. Customer's site is in the set of availabile locations for the producer if ($row['availability_list'] == '' || in_array($row['site_id_you'], $row['availability_array'])) { $row['availability'] = true; } else { $row['availability'] = false; } $row['row_activity_link'] = row_activity_link_calc($row, $pager, $unique); $row['random_weight_display'] = random_weight_display_calc($row); $row['business_name_display'] = business_name_display_calc($row); $row['pricing_display'] = pricing_display_calc($row); $row['total_display'] = total_display_calc($row, $unique); $row['ordering_unit_display'] = ordering_unit_display_calc($row); $row['image_display'] = image_display_calc($row); $row['prodtype_display'] = prodtype_display_calc($row); $row['inventory_display'] = inventory_display_calc($row); // New major division if ($row[$major_division] != ${$major_division_prior} && $show_major_division == true) { if ($listing_is_open) { if ($show_minor_division) { $display .= minor_division_close($row, $unique); } $display .= major_division_close($row); $listing_is_open = 0; } $display .= major_division_open($row, $major_division);