function add_to_cart_form($prop1_list, $prop1_array, $prop1_prices, $prop1_name, $prop2_list, $prop2_array, $prop2_prices, $prop2_name, $prop3_list, $prop3_array, $prop3_prices, $prop3_name, $prop4_list, $prop4_array, $prop4_prices, $prop4_name, $prop5_list, $prop5_array, $prop5_prices, $prop5_name, $prop6_list, $prop6_array, $prop6_prices, $prop6_name, $unicode_character_before, $unicode_character_after, $item_price, $discount_id, $discount_class, $discount_valid_from, $discount_valid_till, $discount_code, $discount_flag, $discount_percentage, $discount_price, $property_prices, $unicode_character_before, $unicode_character_after, $print_discount_icons, $item_id, $item_name, $sku_number, $shipping_first_item, $shipping_additional_item, $handling_override, $category_id, $item_instock, $item_track_stock, $enable_ipn, $db_id, $category_order_class, $enable_number_input, $fill_basket) { $text .= "\r\n\t\t\t<br />\r\n\t\t\t<form method='post' action='easyshop_basket.php'>\r\n\t\t\t\t<div>"; // Include selected properties in the product form // Function include_prop returns an array! [0] is for $text and [1] is for $property_prices! $temp_array = Shop::include_prop($prop1_list, $prop1_array, $prop1_prices, $prop1_name, $prop2_list, $prop2_array, $prop2_prices, $prop2_name, $prop3_list, $prop3_array, $prop3_prices, $prop3_name, $prop4_list, $prop4_array, $prop4_prices, $prop4_name, $prop5_list, $prop5_array, $prop5_prices, $prop5_name, $prop6_list, $prop6_array, $prop6_prices, $prop6_name, $unicode_character_before, $unicode_character_after, $item_price); $text .= $temp_array[0]; $property_prices = $temp_array[1]; unset($temp_array); // Include selected discount in the product form // Function include_disc returns an array! [0] is for $text and [1] is for $item_price! $temp_array = Shop::include_disc($discount_id, $discount_class, $discount_valid_from, $discount_valid_till, $discount_code, $item_price, $discount_flag, $discount_percentage, $discount_price, $property_prices, $unicode_character_before, $unicode_character_after, $print_discount_icons); $text .= $temp_array[0]; // $item_price = $temp_array[1]; // Bugfix #75 unset($temp_array); // Include also currency sign to send it to the basket // Send the product data to the basket $text .= "\r\n\t\t\t\t<input type='hidden' name='unicode_character_before' value='" . $unicode_character_before . "'/>\r\n\t\t\t\t<input type='hidden' name='unicode_character_after' value='" . $unicode_character_after . "'/>\r\n\t\t\t\t<input type='hidden' name='item_id' value='" . $item_id . "'/>\r\n\t\t\t\t<input type='hidden' name='item_name' value='" . $item_name . "'/>\r\n\t\t\t\t<input type='hidden' name='sku_number' value='" . $sku_number . "'/>\r\n\t\t\t\t<input type='hidden' name='item_price' value='" . number_format($item_price, 2, '.', '') . "'/>\r\n\t\t\t\t<input type='hidden' name='shipping' value='" . number_format($shipping_first_item, 2, '.', '') . "'/>\r\n\t\t\t\t<input type='hidden' name='shipping2' value='" . number_format($shipping_additional_item, 2, '.', '') . "'/>\r\n\t\t\t\t<input type='hidden' name='handling' value='" . number_format($handling_override, 2, '.', '') . "'/>\r\n\t\t\t\t<input type='hidden' name='category_id' value='" . $category_id . "'/>"; // IPN addition to include stock tracking option if ($item_track_stock == 2 && $enable_ipn == 2) { $text .= "\r\n\t\t\t\t<input type='hidden' name='item_instock' value='" . $item_instock . "'>\r\n\t\t\t\t<input type='hidden' name='item_track_stock' value='" . $item_track_stock . "'>"; } // IPN addition to include Item's database ID into session variable $text .= "\r\n\t\t\t\t<input type='hidden' name='db_id' value='" . $db_id . "'>\r\n\t\t\t\t<input type='hidden' name='fill_basket' value='" . $fill_basket . "'/>"; // Include properties lists hidden in the form for ($n = 1; $n < 6; $n++) { $propname = "prop" . $n . "_name"; $proplist = "prop" . $n . "_list"; $propprices = "prop" . $n . "_prices"; $text .= "\r\n\t\t\t\t<input type='hidden' name='{$propname}' value='" . ${"prop" . $n . "_name"} . "'/>\r\n\t\t\t\t<input type='hidden' name='{$proplist}' value='" . ${"prop" . $n . "_list"} . "'/>\r\n\t\t\t\t<input type='hidden' name='{$propprices}' value='" . ${"prop" . $n . "_prices"} . "'/>"; } // Include user id if user is logged in if (USER) { $text .= "\r\n\t\t\t\t<input type='hidden' name='custom' value='" . USERID . "'/>"; } if (check_class($category_order_class)) { // Only display number and checkout button if user is member of order_class if ($enable_number_input == '1') { // Shop visitor can specify number of products $text .= "\r\n\t\t\t\t<div class='easyshop_nr_of_prod'>\r\n\t\t\t\t\t" . EASYSHOP_SHOP_80 . ": <input name='item_qty' type='text' value='1' size='2' />\r\n\t\t\t\t</div>"; } else { // Shop adds one product at each click on add button $text .= "\r\n\t\t\t\t<input type='hidden' name='item_qty' value='1' />"; } $text .= "\r\n\t\t\t\t<input type='hidden' name='return_url' value='" . e_SELF . (e_QUERY ? '?' . e_QUERY : '') . "'/>\r\n\t\t\t\t<input class='button' type='submit' value='" . EASYSHOP_SHOP_08 . "'/>"; } $text .= "\r\n\t\t\t\t</div>\r\n\t\t\t</form>"; return $text; }
} $item_image = explode(",", $item_image); shuffle($item_image); // A random image of a product will be displayed if there are multiple images // NOTE: image directories are always supposed to be a folder under the easyshop directory (!) if ($item_image[0] != '' or $item_image[0] != NULL) { // Only display images when we have them $prodlink = "<img style='border-style:none;' src='" . e_PLUGIN . "easyshop/" . $store_image_path . $item_image[0] . "' alt='{$item_description}' title='{$item_description}'/>"; } else { // Show the description when there are no images $prodlink = $item_description; } $urllink = e_PLUGIN . "easyshop/easyshop.php?prod.{$item_id}"; // got rid of long urls"; // Function include_disc returns an array! [0] is for $text and [1] is for $item_price! $temp_array = Shop::include_disc($discount_id, $discount_class, $discount_valid_from, $discount_valid_till, $discount_code, $item_price, $discount_flag, $discount_percentage, $discount_price, $property_prices, $unicode_character_before, $unicode_character_after, $print_discount_icons); //$discount_text .= $temp_array[0]; $new_item_price = $temp_array[1]; unset($temp_array); $text = "\n <table style='text-align:center;'>\n <tr>\n <td class='forumheader3' style='colspan:2; text-align:center;'>{$item_name}</td>\n </tr>\n <tr>\n <td class='forumheader3' style='colspan:2; text-align:center;'><a href='{$urllink}' title='{$item_description}'>{$prodlink}</a></td>\n </tr>\n <tr>\n <td class='forumheader3' style='colspan:2; text-align:center;'>" . EASYSHOP_PUBLICMENU_09 . $unicode_character_before . "<span style='text-decoration: line-through;'>" . number_format($item_price, 2, '.', '') . "</span> " . $unicode_character_after . " " . $unicode_character_before . number_format($new_item_price, 2, '.', '') . "{$unicode_character_after}</td>\n </tr>"; if ($discount_valid_till > 0) { $text .= "\n <tr>\n <td class='forumheader3' style='colspan:2; text-align:center;'>" . EASYSHOP_PUBLICMENU3_11 . ": " . date("d-m-Y", $discount_valid_till) . "</td>\n </tr>"; } $text .= "\n </table>\n "; } else { // End of if check on fetched category_id // Inform about no access to any category $text = "\n <table style='text-align:center;'>\n <tr><td>\n " . EASYSHOP_PUBLICMENU3_10 . "\n </td></tr>\n </table>\n "; } $caption = EASYSHOP_PUBLICMENU3_01; $ns->tablerender($caption, $text);