######################################################################### # # # Copyright (c) 2005 Internet Express Products # # All Rights Reserved. # # # # This software is the confidential and proprietary information of # # Internet Express Products. You shall not disclose such Confidential # # Information and shall use it only in accordance with the terms of # # the license agreement you entered into with Internet Express # # Products. # # # # Internet Express Products MAKES NO REPRESENTATIONS OR WARRANTIES # # ABOUT # THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESSED OR # # IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF # # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR # # NON-INFRINGEMENT. # # # # INTERNET EXPRESS PRODUCTS SHALL NOT BE LIABLE FOR ANY DAMAGES # # SUFFERED BY LICENSEE AS A RESULT OF USE. # # # # DISTRIBUTION OF THIS SOFTWARE OR ITS DERIVATIVES IS STRICTLY # # PROHIBITED # # # # Larry Wagar # # http://expressproducts.net # # lwagar@expressproducts.net # # # ######################################################################### ############################################################ # Sub rand_products # # This will create link to 3 random products # from your store data.file. ############################################################ if ($form_data{'order_form_button'} || $form_data{'order_form_button.x'} || $form_data{'submit_order_form_button'} || $form_data{'submit_order_form_button'} || $form_data{'viewOrder'} || $form_data{'viewOrder.x'} || $form_data{$process_variable{$gateway}}) { $random_products = ""; } else { $imageURL = "$URL_of_images_directory"; open(DATAFILE, "$sc_log_file_directory_path/products.txt") || &errorcode(__FILE__, __LINE__, "$sc_log_file_directory_path/products.txt", "$!", "print", "FILE OPEN ERROR", "0"); @line=; close (DATAFILE); srand; $array1 = $line[int rand(@line)]; $array2 = $array1; $d_counter = 0; while ($array2 eq $array1 || $d_counter eq 20) { $array2 = $line[int rand(@line)]; $d_counter++; } @special1 = split (/\|/, $array1); @special2 = split (/\|/, $array2); $image1 = $special1[4]; $image2 = $special2[4]; $special1[2] = &display_price(&format_price($special1[2])); $special2[2] = &display_price(&format_price($special2[2])); $random_products .= qq~


$special1[3]
Only: $special1[2]

< More Info >


$special2[3]
Only: $special2[2]

< More Info >

~; } 1;