[ Index ] |
|
Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1 |
1 <?php 2 /** 3 * product_music_info main_template_vars 4 * 5 * @package productTypes 6 * @copyright Copyright 2003-2006 Zen Cart Development Team 7 * @copyright Portions Copyright 2003 osCommerce 8 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 9 * @version $Id: main_template_vars.php 5369 2006-12-23 10:55:52Z drbyte $ 10 */ 11 /* 12 * Extracts and constructs the data to be used in the product-type template tpl_TYPEHANDLER_info_display.php 13 */ 14 15 // This should be first line of the script: 16 $zco_notifier->notify('NOTIFY_MAIN_TEMPLATE_VARS_START_PRODUCT_MUSIC_INFO'); 17 18 $module_show_categories = PRODUCT_INFO_CATEGORIES; 19 20 $sql = "select count(*) as total 21 from " . TABLE_PRODUCTS . " p, " . 22 TABLE_PRODUCTS_DESCRIPTION . " pd 23 where p.products_status = '1' 24 and p.products_id = '" . (int)$_GET['products_id'] . "' 25 and pd.products_id = p.products_id 26 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'"; 27 28 29 $res = $db->Execute($sql); 30 31 if ( $res->fields['total'] < 1 ) { 32 33 $tpl_page_body = '/tpl_product_info_noproduct.php'; 34 35 } else { 36 37 $tpl_page_body = '/tpl_product_music_info_display.php'; 38 39 40 $sql = "update " . TABLE_PRODUCTS_DESCRIPTION . " 41 set products_viewed = products_viewed+1 42 where products_id = '" . (int)$_GET['products_id'] . "' 43 and language_id = '" . (int)$_SESSION['languages_id'] . "'"; 44 45 $res = $db->Execute($sql); 46 47 $sql = "select p.products_id, pd.products_name, 48 pd.products_description, p.products_model, 49 p.products_quantity, p.products_image, 50 pd.products_url, p.products_price, 51 p.products_tax_class_id, p.products_date_added, 52 p.products_date_available, p.manufacturers_id, p.products_quantity, 53 p.products_weight, p.products_priced_by_attribute, p.product_is_free, 54 p.products_qty_box_status, 55 p.products_quantity_order_max, 56 p.products_discount_type, p.products_discount_type_from, p.products_sort_order, p.products_price_sorter 57 from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd 58 where p.products_status = '1' 59 and p.products_id = '" . (int)$_GET['products_id'] . "' 60 and pd.products_id = p.products_id 61 and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'"; 62 63 $product_info = $db->Execute($sql); 64 65 $products_price_sorter = $product_info->fields['products_price_sorter']; 66 67 $products_price = $currencies->display_price($product_info->fields['products_price'], 68 zen_get_tax_rate($product_info->fields['products_tax_class_id'])); 69 70 $manufacturers_name = zen_get_products_manufacturers_name((int)$_GET['products_id']); 71 72 if ($new_price = zen_get_products_special_price($product_info->fields['products_id'])) { 73 74 $specials_price = $currencies->display_price($new_price, 75 zen_get_tax_rate($product_info->fields['products_tax_class_id'])); 76 77 } 78 79 // set flag for attributes module usage: 80 $flag_show_weight_attrib_for_this_prod_type = SHOW_PRODUCT_MUSIC_INFO_WEIGHT_ATTRIBUTES; 81 // get attributes 82 require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_ATTRIBUTES)); 83 84 // if review must be approved or disabled do not show review 85 $review_status = " and r.status = '1'"; 86 87 $reviews_query = "select count(*) as count from " . TABLE_REVIEWS . " r, " 88 . TABLE_REVIEWS_DESCRIPTION . " rd 89 where r.products_id = '" . (int)$_GET['products_id'] . "' 90 and r.reviews_id = rd.reviews_id 91 and rd.languages_id = '" . (int)$_SESSION['languages_id'] . "'" . 92 $review_status; 93 94 $reviews = $db->Execute($reviews_query); 95 96 } 97 98 require(DIR_WS_MODULES . zen_get_module_directory('product_prev_next.php')); 99 100 $products_name = $product_info->fields['products_name']; 101 $products_model = $product_info->fields['products_model']; 102 $products_description = $product_info->fields['products_description']; 103 104 if ($product_info->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == '1') { 105 $products_image = PRODUCTS_IMAGE_NO_IMAGE; 106 } else { 107 $products_image = $product_info->fields['products_image']; 108 } 109 110 $products_url = $product_info->fields['products_url']; 111 $products_date_available = $product_info->fields['products_date_available']; 112 $products_date_added = $product_info->fields['products_date_added']; 113 $products_manufacturer = $manufacturers_name; 114 $products_weight = $product_info->fields['products_weight']; 115 $products_quantity = $product_info->fields['products_quantity']; 116 117 $products_qty_box_status = $product_info->fields['products_qty_box_status']; 118 $products_quantity_order_max = $product_info->fields['products_quantity_order_max']; 119 120 $products_base_price = $currencies->display_price(zen_get_products_base_price((int)$_GET['products_id']), 121 zen_get_tax_rate($product_info->fields['products_tax_class_id'])); 122 123 $product_is_free = $product_info->fields['product_is_free']; 124 125 $products_tax_class_id = $product_info->fields['products_tax_class_id']; 126 127 $module_show_categories = PRODUCT_INFO_CATEGORIES; 128 $module_next_previous = PRODUCT_INFO_PREVIOUS_NEXT; 129 130 $products_id_current = (int)$_GET['products_id']; 131 $products_discount_type = $product_info->fields['products_discount_type']; 132 $products_discount_type_from = $product_info->fields['products_discount_type_from']; 133 134 /** 135 * Load product-type-specific main_template_vars 136 */ 137 $prod_type_specific_vars_info = DIR_WS_MODULES . 'pages/' . $current_page_base . '/main_template_vars_product_type.php'; 138 if (file_exists($prod_type_specific_vars_info)) { 139 include_once($prod_type_specific_vars_info); 140 } 141 $zco_notifier->notify('NOTIFY_MAIN_TEMPLATE_VARS_PRODUCT_TYPE_VARS_PRODUCT_MUSIC_INFO'); 142 143 144 /** 145 * Load all *.PHP files from the /includes/templates/MYTEMPLATE/PAGENAME/extra_main_template_vars 146 */ 147 $extras_dir = $template->get_template_dir('.php', DIR_WS_TEMPLATE, $current_page_base . 'extra_main_template_vars', $current_page_base . '/' . 'extra_main_template_vars'); 148 if ($dir = @dir($extras_dir)) { 149 while ($file = $dir->read()) { 150 if (!is_dir($extras_dir . '/' . $file)) { 151 if (preg_match('/\.php$/', $file) > 0) { 152 $directory_array[] = '/' . $file; 153 } 154 } 155 } 156 $dir->close(); 157 } 158 if (sizeof($directory_array)) sort($directory_array); 159 160 for ($i = 0, $n = sizeof($directory_array); $i < $n; $i++) { 161 if (file_exists($extras_dir . $directory_array[$i])) include($extras_dir . $directory_array[$i]); 162 } 163 164 // build show flags from product type layout settings 165 $flag_show_product_info_starting_at = zen_get_show_product_switch($_GET['products_id'], 'starting_at'); 166 $flag_show_product_info_model = zen_get_show_product_switch($_GET['products_id'], 'model'); 167 $flag_show_product_info_weight = zen_get_show_product_switch($_GET['products_id'], 'weight'); 168 $flag_show_product_info_quantity = zen_get_show_product_switch($_GET['products_id'], 'quantity'); 169 $flag_show_product_info_manufacturer = zen_get_show_product_switch($_GET['products_id'], 'manufacturer'); 170 $flag_show_product_info_in_cart_qty = zen_get_show_product_switch($_GET['products_id'], 'in_cart_qty'); 171 $flag_show_product_info_tell_a_friend = zen_get_show_product_switch($_GET['products_id'], 'tell_a_friend'); 172 $flag_show_product_info_reviews = zen_get_show_product_switch($_GET['products_id'], 'reviews'); 173 $flag_show_product_info_reviews_count = zen_get_show_product_switch($_GET['products_id'], 'reviews_count'); 174 $flag_show_product_info_date_available = zen_get_show_product_switch($_GET['products_id'], 'date_available'); 175 $flag_show_product_info_date_added = zen_get_show_product_switch($_GET['products_id'], 'date_added'); 176 $flag_show_product_info_url = zen_get_show_product_switch($_GET['products_id'], 'url'); 177 $flag_show_product_info_additional_images = zen_get_show_product_switch($_GET['products_id'], 'additional_images'); 178 $flag_show_product_info_free_shipping = zen_get_show_product_switch($_GET['products_id'], 'always_free_shipping_image_switch'); 179 180 $flag_show_product_music_info_artist = zen_get_show_product_switch($_GET['products_id'], 'artist'); 181 $flag_show_product_music_info_genre = zen_get_show_product_switch($_GET['products_id'], 'genre'); 182 $flag_show_product_music_info_record_company = zen_get_show_product_switch($_GET['products_id'], 'record_company'); 183 require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_PRODUCTS_QUANTITY_DISCOUNTS)); 184 185 $zco_notifier->notify('NOTIFY_MAIN_TEMPLATE_VARS_EXTRA_PRODUCT_MUSIC_INFO'); 186 187 188 require($template->get_template_dir($tpl_page_body,DIR_WS_TEMPLATE, $current_page_base,'templates'). $tpl_page_body); 189 190 //require(DIR_WS_MODULES . zen_get_module_directory(FILENAME_ALSO_PURCHASED_PRODUCTS)); 191 192 // This should be last line of the script: 193 $zco_notifier->notify('NOTIFY_MAIN_TEMPLATE_VARS_END_PRODUCT_MUSIC_INFO'); 194 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 16:45:43 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |