PageRenderTime 65ms CodeModel.GetById 26ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/wp-shopping-cart/options.php

https://github.com/alx/barceloneta
PHP | 1731 lines | 1466 code | 239 blank | 26 comment | 250 complexity | e5eece5ebaf4e0669757870648f19273 MD5 | raw file
  1. <?php
  2. if(preg_match("/[a-zA-Z]{2,4}/",$_GET['isocode'])) {
  3. include('tax_and_shipping.php');
  4. } else {
  5. if($_POST != null) {
  6. if($_POST['product_list_url'] != null) {
  7. update_option('product_list_url', $_POST['product_list_url']);
  8. }
  9. if($_POST['shopping_cart_url'] != null) {
  10. update_option('shopping_cart_url', $_POST['shopping_cart_url']);
  11. }
  12. if($_POST['checkout_url'] != null) {
  13. update_option('checkout_url', $_POST['checkout_url']);
  14. }
  15. if($_POST['transact_url'] != null) {
  16. update_option('transact_url', $_POST['transact_url']);
  17. }
  18. if($_POST['user_account_url'] != null) {
  19. update_option('user_account_url', $_POST['user_account_url']);
  20. }
  21. if($_POST['gst_rate'] != null) {
  22. $gst_rate = ($_POST['gst_rate']/100) + 1;
  23. update_option('gst_rate', $gst_rate);
  24. }
  25. if($_POST['wpsc_theme_list'] != '') {
  26. update_option('wpsc_selected_theme', $_POST['wpsc_theme_list']);
  27. }
  28. if($_POST['purch_log_email'] != null) {
  29. update_option('purch_log_email', $_POST['purch_log_email']);
  30. }
  31. if($_POST['return_email'] != null) {
  32. update_option('return_email', $_POST['return_email']);
  33. }
  34. if($_POST['terms_and_conditions'] != get_option('terms_and_conditions')) {
  35. update_option('terms_and_conditions', $_POST['terms_and_conditions']);
  36. }
  37. if($_POST['product_image_height'] != get_option('product_image_height')) {
  38. update_option('product_image_height', $_POST['product_image_height']);
  39. }
  40. if($_POST['product_image_width'] != get_option('product_image_width')) {
  41. update_option('product_image_width', $_POST['product_image_width']);
  42. }
  43. if($_POST['category_image_height'] != get_option('category_image_height')) {
  44. update_option('category_image_height', $_POST['category_image_height']);
  45. }
  46. if($_POST['category_image_width'] != get_option('category_image_width')) {
  47. update_option('category_image_width', $_POST['category_image_width']);
  48. }
  49. if($_POST['single_view_image_height'] != get_option('single_view_image_height')) {
  50. update_option('single_view_image_height', $_POST['single_view_image_height']);
  51. }
  52. if($_POST['single_view_image_width'] != get_option('single_view_image_width')) {
  53. update_option('single_view_image_width', $_POST['single_view_image_width']);
  54. }
  55. if(is_numeric($_POST['max_downloads'])) {
  56. update_option('max_downloads', $_POST['max_downloads']);
  57. }
  58. if(is_numeric($_POST['postage_and_packaging'])) {
  59. update_option('postage_and_packaging', $_POST['postage_and_packaging']);
  60. }
  61. if(is_numeric($_POST['currency_type'])) {
  62. update_option('currency_type', $_POST['currency_type']);
  63. }
  64. if(is_numeric($_POST['currency_sign_location'])) {
  65. update_option('currency_sign_location', $_POST['currency_sign_location']);
  66. }
  67. if(is_numeric($_POST['cart_location'])) {
  68. update_option('cart_location', $_POST['cart_location']);
  69. }
  70. if(is_numeric($_POST['show_gallery'])) {
  71. update_option('show_gallery', $_POST['show_gallery']);
  72. }
  73. // pe.{
  74. if(is_numeric($_POST['cat_brand_loc'])) {
  75. update_option('cat_brand_loc', $_POST['cat_brand_loc']);
  76. }
  77. if(is_numeric($_POST['show_categorybrands'])) {
  78. update_option('show_categorybrands', $_POST['show_categorybrands']);
  79. }
  80. if( isset($_POST['wpsc_default_category']) && ($_POST['wpsc_default_category'] != get_option('wpsc_default_category'))) {
  81. //echo $_POST['wpsc_default_category'];
  82. delete_option('wpsc_default_category');
  83. update_option('wpsc_default_category', (string)$_POST['wpsc_default_category']);
  84. //echo get_option('wpsc_default_category');
  85. }
  86. if($_POST['product_view'] != get_option('product_view')) {
  87. update_option('product_view', $_POST['product_view']);
  88. }
  89. if($_POST['show_thumbnails'] == 1) {
  90. update_option('show_thumbnails', 1);
  91. } else {
  92. update_option('show_thumbnails', 0);
  93. }
  94. if($_POST['wpsc_also_bought'] == 1) {
  95. update_option('wpsc_also_bought', 1);
  96. } else {
  97. update_option('wpsc_also_bought', 0);
  98. }
  99. if($_POST['show_category_thumbnails'] == 1) {
  100. update_option('show_category_thumbnails', 1);
  101. } else {
  102. update_option('show_category_thumbnails', 0);
  103. }
  104. if($_POST['addtocart_or_buynow'] == 1) {
  105. update_option('addtocart_or_buynow', 1);
  106. } else {
  107. update_option('addtocart_or_buynow', 0);
  108. }
  109. if($_POST['hide_name_link'] == 1) {
  110. update_option('hide_name_link', 1);
  111. } else {
  112. update_option('hide_name_link', 0);
  113. }
  114. if($_POST['display_pnp'] == 1) {
  115. update_option('display_pnp', 1);
  116. } else {
  117. update_option('display_pnp', 0);
  118. }
  119. if($_POST['wpsc_dropshop_display'] != get_option('dropshop_display')) {
  120. update_option('dropshop_display', $_POST['wpsc_dropshop_display']);
  121. }
  122. if($_POST['wpsc_dropshop_theme'] != get_option('wpsc_dropshop_theme')) {
  123. update_option('wpsc_dropshop_theme', $_POST['wpsc_dropshop_theme']);
  124. }
  125. if($_POST['hide_addtocart_button'] == 1) {
  126. update_option('hide_addtocart_button', 1);
  127. } else {
  128. update_option('hide_addtocart_button', 0);
  129. }
  130. if($_POST['checkbox_variations'] == 1) {
  131. update_option('checkbox_variations', 1);
  132. } else {
  133. update_option('checkbox_variations', 0);
  134. }
  135. if(isset($_POST['usps_user_id'])) {
  136. update_option('usps_user_id', $_POST['usps_user_id']);
  137. }
  138. if(isset($_POST['usps_user_password'])) {
  139. update_option('usps_user_password', $_POST['usps_user_password']);
  140. }
  141. if($_POST['use_pagination'] == 1) {
  142. update_option('use_pagination', $_POST['use_pagination']);
  143. } else {
  144. update_option('use_pagination', 0);
  145. }
  146. if(is_numeric($_POST['wpsc_products_per_page'])) {
  147. update_option('wpsc_products_per_page', $_POST['wpsc_products_per_page']);
  148. } else {
  149. update_option('wpsc_products_per_page', 0);
  150. }
  151. if($_POST['show_sliding_cart'] == 1) {
  152. update_option('show_sliding_cart', 1);
  153. } else {
  154. update_option('show_sliding_cart', 0);
  155. }
  156. if($_POST['fancy_notifications'] == 1) {
  157. update_option('fancy_notifications', 1);
  158. } else {
  159. update_option('fancy_notifications', 0);
  160. }
  161. if($_POST['add_plustax'] == 1) {
  162. update_option('add_plustax', 1);
  163. } else {
  164. update_option('add_plustax', 0);
  165. }
  166. // Adrian - used for displaying product count next to categories
  167. if($_POST['show_category_count'] == 1) {
  168. update_option('show_category_count', 1);
  169. } else {
  170. update_option('show_category_count', 0);
  171. }
  172. // Adrian - used for storing the category display type, just categories and multiple products per page, or a sliding menu with all products listed under each category and one (1) product per page
  173. if($_POST['catsprods_display_type'] == 0) {
  174. update_option('catsprods_display_type', 0);
  175. } else {
  176. update_option('catsprods_display_type', 1);
  177. }
  178. if($_POST['require_register'] == 1) {
  179. update_option('require_register', 1);
  180. } else {
  181. update_option('require_register', 0);
  182. }
  183. if($_POST['do_not_use_shipping'] == 1) {
  184. update_option('do_not_use_shipping', 1);
  185. } else {
  186. update_option('do_not_use_shipping', 0);
  187. }
  188. // End of Adrian's additions - more further down page
  189. if(is_numeric($_POST['product_ratings'])) {
  190. update_option('product_ratings', $_POST['product_ratings']);
  191. }
  192. if(isset($_POST['language_setting'])) {
  193. update_option('language_setting', $_POST['language_setting']);
  194. }
  195. if(isset($_POST['base_local_shipping'])) {
  196. update_option('base_local_shipping', $_POST['base_local_shipping']);
  197. }
  198. if(isset($_POST['base_international_shipping'])) {
  199. update_option('base_international_shipping', $_POST['base_international_shipping']);
  200. }
  201. if(isset($_POST['base_country'])) {
  202. update_option('base_country', $_POST['base_country']);
  203. }
  204. if(is_numeric($_POST['country_id']) && is_numeric($_POST['country_tax'])) {
  205. $wpdb->query("UPDATE `".$wpdb->prefix."currency_list` SET `tax` = '".$_POST['country_tax']."' WHERE `id` = '".$_POST['country_id']."' LIMIT 1 ;");
  206. }
  207. if(isset($_POST['base_region'])) {
  208. update_option('base_region', $_POST['base_region']);
  209. }
  210. if(isset($_POST['usps_user_id'])) {
  211. update_option('usps_user_id', $_POST['usps_user_id']);
  212. }
  213. if(is_numeric($_POST['country_form_field'])) {
  214. update_option('country_form_field', $_POST['country_form_field']);
  215. }
  216. if(is_numeric($_POST['email_form_field'])) {
  217. update_option('email_form_field', $_POST['email_form_field']);
  218. }
  219. if($_POST['list_view_quantity'] == 1) {
  220. update_option('list_view_quantity', 1);
  221. } else {
  222. update_option('list_view_quantity', 0);
  223. }
  224. if($_POST['show_breadcrumbs'] == 1) {
  225. update_option('show_breadcrumbs', 1);
  226. } else {
  227. update_option('show_breadcrumbs', 0);
  228. }
  229. if($_POST['display_variations'] == 1) {
  230. update_option('display_variations', 1);
  231. } else {
  232. update_option('display_variations', 0);
  233. }
  234. if($_POST['show_images_only'] == 1) {
  235. update_option('show_images_only', 1);
  236. } else {
  237. update_option('show_images_only', 0);
  238. }
  239. if($_POST['show_search'] == 1) {
  240. update_option('show_search', 1);
  241. } else {
  242. update_option('show_search', 0);
  243. }
  244. if($_POST['show_advanced_search'] == 'on') {
  245. update_option('show_advanced_search', 1);
  246. } else {
  247. update_option('show_advanced_search', 0);
  248. }
  249. if($_POST['show_live_search'] == 'on') {
  250. update_option('show_live_search', 1);
  251. } else {
  252. update_option('show_live_search', 0);
  253. }
  254. if($_POST['googleStoreLocator'] == 1) {
  255. update_option('googleStoreLocator', 1);
  256. } else {
  257. update_option('googleStoreLocator', 0);
  258. }
  259. if($_POST['wpsc_category_description'] == 1) {
  260. update_option('wpsc_category_description', 'true');
  261. } else {
  262. update_option('wpsc_category_description', 'false');
  263. }
  264. if(is_numeric($_POST['wpsc_page_number_position'])) {
  265. update_option('wpsc_page_number_position', (int)$_POST['wpsc_page_number_position']);
  266. } else {
  267. update_option('wpsc_page_number_position', 1);
  268. }
  269. if($_POST['shipwire'] == 1) {
  270. update_option('shipwire', 1);
  271. } else {
  272. update_option('shipwire', 0);
  273. }
  274. if($_POST['wpsc_ip_lock_downloads'] == 1) {
  275. update_option('wpsc_ip_lock_downloads', 1);
  276. } else {
  277. update_option('wpsc_ip_lock_downloads', 0);
  278. }
  279. if($_POST['shipwireemail'] != null) {
  280. update_option('shipwireemail', $_POST['shipwireemail']);
  281. }
  282. if($_POST['shipwirepassword'] != null) {
  283. update_option('shipwirepassword', $_POST['shipwirepassword']);
  284. }
  285. echo "<div class='updated'><p align='center'>".TXT_WPSC_THANKSAPPLIED."</p></div>";
  286. }
  287. if(get_option('nzshpcrt_first_load') == 0) {
  288. echo "<div class='updated'><p align='center'>".TXT_WPSC_INITIAL_SETUP."</p></div>";
  289. update_option('nzshpcrt_first_load', 1);
  290. }
  291. if($_GET['update_page_urls'] == 'true') {
  292. $wpsc_pageurl_option['product_list_url'] = '[productspage]';
  293. $wpsc_pageurl_option['shopping_cart_url'] = '[shoppingcart]';
  294. $check_chekout = $wpdb->get_var("SELECT `guid` FROM `".$wpdb->prefix."posts` WHERE `post_content` LIKE '%[checkout]%' LIMIT 1");
  295. if($check_chekout != null) {
  296. $wpsc_pageurl_option['checkout_url'] = '[checkout]';
  297. } else {
  298. $wpsc_pageurl_option['checkout_url'] = '[checkout]';
  299. }
  300. $wpsc_pageurl_option['transact_url'] = '[transactionresults]';
  301. $wpsc_pageurl_option['user_account_url'] = '[userlog]';
  302. $changes_made = false;
  303. foreach($wpsc_pageurl_option as $option_key => $page_string) {
  304. $post_id = $wpdb->get_var("SELECT `ID` FROM `".$wpdb->prefix."posts` WHERE `post_type` IN('page','post') AND `post_content` LIKE '%$page_string%' LIMIT 1");
  305. $the_new_link = get_permalink($post_id);
  306. if(stristr(get_option($option_key), "https://")) {
  307. $the_new_link = str_replace('http://', "https://",$the_new_link);
  308. }
  309. update_option($option_key, $the_new_link);
  310. }
  311. if($changes_made === true) {
  312. echo "<div class='updated'><p align='center'>".TXT_WPSC_THANKSAPPLIED."</p></div>";
  313. }
  314. }
  315. if($_GET['clean_categories'] == 'true') {
  316. //exit("<pre>".print_r($check_category_names,true)."</pre>");
  317. $sql_query = "SELECT `id`, `name`, `active` FROM `".$wpdb->prefix."product_categories`";
  318. $sql_data = $wpdb->get_results($sql_query,ARRAY_A);
  319. foreach((array)$sql_data as $datarow) {
  320. if($datarow['active'] == 1) {
  321. $tidied_name = trim($datarow['name']);
  322. $tidied_name = strtolower($tidied_name);
  323. $url_name = preg_replace(array("/(\s)+/","/[^\w-]+/"), array("-", ''), $tidied_name);
  324. $similar_names = $wpdb->get_row("SELECT COUNT(*) AS `count`, MAX(REPLACE(`nice-name`, '$url_name', '')) AS `max_number` FROM `{$wpdb->prefix}product_categories` WHERE `nice-name` REGEXP '^($url_name){1}(\d)*$' AND `id` NOT IN ('{$datarow['id']}') ",ARRAY_A);
  325. $extension_number = '';
  326. if($similar_names['count'] > 0) {
  327. $extension_number = (int)$similar_names['max_number']+2;
  328. }
  329. $url_name .= $extension_number;
  330. $wpdb->query("UPDATE `{$wpdb->prefix}product_categories` SET `nice-name` = '$url_name' WHERE `id` = '{$datarow['id']}' LIMIT 1 ;");
  331. } else if($datarow['active'] == 0) {
  332. $wpdb->query("UPDATE `{$wpdb->prefix}product_categories` SET `nice-name` = '' WHERE `id` = '{$datarow['id']}' LIMIT 1 ;");
  333. }
  334. }
  335. $wp_rewrite->flush_rules();
  336. }
  337. function options_categorylist() {
  338. global $wpdb;
  339. $current_default = get_option('wpsc_default_category');
  340. $group_sql = "SELECT * FROM `".$wpdb->prefix."wpsc_categorisation_groups` WHERE `active`='1'";
  341. $group_data = $wpdb->get_results($group_sql,ARRAY_A);
  342. $categorylist .= "<select name='wpsc_default_category'>";
  343. $categorylist .= "<option value='none' ".$selected." >".TXT_WPSC_SELECTACATEGORY."</option>";
  344. if(get_option('wpsc_default_category') == 'all') {
  345. $selected = "selected='true'";
  346. }
  347. $categorylist .= "<option value='all' ".$selected." >".TXT_WPSC_SELECTALLCATEGORIES."</option>";
  348. foreach($group_data as $group) {
  349. $cat_sql = "SELECT * FROM `".$wpdb->prefix."product_categories` WHERE `group_id` IN ({$group['id']}) AND `active`='1'";
  350. $category_data = $wpdb->get_results($cat_sql,ARRAY_A);
  351. if($category_data != null) {
  352. $categorylist .= "<optgroup label='{$group['name']}'>";;
  353. foreach((array)$category_data as $category) {
  354. if(get_option('wpsc_default_category') == $category['id']) {
  355. $selected = "selected='true'";
  356. } else {
  357. $selected = "";
  358. }
  359. $categorylist .= "<option value='".$category['id']."' ".$selected." >".$category['name']."</option>";
  360. }
  361. $categorylist .= "</optgroup>";
  362. }
  363. }
  364. $categorylist .= "</select>";
  365. return $categorylist;
  366. }
  367. function country_list($selected_country = null) {
  368. global $wpdb;
  369. $output = "";
  370. $output .= "<option value=''></option>";
  371. $country_data = $wpdb->get_results("SELECT * FROM `".$wpdb->prefix."currency_list` ORDER BY `country` ASC",ARRAY_A);
  372. foreach ((array)$country_data as $country) {
  373. $selected ='';
  374. if($selected_country == $country['isocode']) {
  375. $selected = "selected='true'";
  376. }
  377. $output .= "<option value='".$country['isocode']."' $selected>".$country['country']."</option>";
  378. }
  379. return $output;
  380. }
  381. ?>
  382. <form name='cart_options' id='cart_options' method='POST' action='admin.php?page=<?php echo WPSC_DIR_NAME; ?>/options.php'>
  383. <div id="wpsc_options" class="wrap">
  384. <ul id="tabs">
  385. <li><a href="#options_general"><?php echo TXT_WPSC_OPTIONS_GENERAL_TAB; ?></a></li>
  386. <li><a href="#options_presentation"><?php echo TXT_WPSC_OPTIONS_PRESENTATION_TAB; ?></a></li>
  387. <li><a href="#options_shipping"><?php echo TXT_WPSC_OPTIONS_SHIPPING_TAB; ?></a></li>
  388. <!-- <li><a href="#wpsc_options_payment"><?php echo TXT_WPSC_OPTIONS_PAYMENT_TAB; ?></a></li> -->
  389. <li><a href="#options_admin"><?php echo TXT_WPSC_OPTIONS_ADMIN_TAB; ?></a></li>
  390. <!-- <li><a href="#wpsc_options_marketing"><?php echo TXT_WPSC_OPTIONS_MARKETING_TAB; ?></a></li> -->
  391. </ul>
  392. <div id="options_general">
  393. <h2><?php echo TXT_WPSC_OPTIONS_GENERAL_HEADER; ?></h2>
  394. <?php
  395. /* here start the general options */
  396. ?>
  397. <table class='wpsc_options form-table'>
  398. <tr>
  399. <th scope="row">
  400. <?php echo TXT_WPSC_BASE_COUNTRY;?>:
  401. </th>
  402. <td>
  403. <select name='base_country' onChange='submit_change_country();'>
  404. <?php echo country_list(get_option('base_country')); ?>
  405. </select>
  406. <span id='options_region'>
  407. <?php
  408. $region_list = $wpdb->get_results("SELECT `".$wpdb->prefix."region_tax`.* FROM `".$wpdb->prefix."region_tax`, `".$wpdb->prefix."currency_list` WHERE `".$wpdb->prefix."currency_list`.`isocode` IN('".get_option('base_country')."') AND `".$wpdb->prefix."currency_list`.`id` = `".$wpdb->prefix."region_tax`.`country_id`",ARRAY_A) ;
  409. if($region_list != null) {
  410. echo "<select name='base_region'>\n\r";
  411. foreach($region_list as $region) {
  412. if(get_option('base_region') == $region['id']) {
  413. $selected = "selected='true'";
  414. } else {
  415. $selected = "";
  416. }
  417. echo "<option value='".$region['id']."' $selected>".$region['name']."</option>\n\r";
  418. }
  419. echo "</select>\n\r";
  420. }
  421. ?>
  422. </span>
  423. </td>
  424. </tr>
  425. <tr>
  426. <th scope="row">
  427. <?php echo TXT_WPSC_TAX_SETTINGS;?>:
  428. </th>
  429. <td>
  430. <span id='options_region'>
  431. <?php
  432. $country_data = $wpdb->get_row("SELECT * FROM `".$wpdb->prefix."currency_list` WHERE `isocode`='".get_option('base_country')."' LIMIT 1",ARRAY_A);
  433. echo $country_data['country'];
  434. $region_count = $wpdb->get_var("SELECT COUNT(*) AS `count` FROM `".$wpdb->prefix."region_tax`, `".$wpdb->prefix."currency_list` WHERE `".$wpdb->prefix."currency_list`.`isocode` IN('".get_option('base_country')."') AND `".$wpdb->prefix."currency_list`.`id` = `".$wpdb->prefix."region_tax`.`country_id`") ;
  435. if($country_data['has_regions'] == 1) {
  436. echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href='?page=".WPSC_DIR_NAME."/options.php&isocode=".get_option('base_country')."'>".$region_count." Regions</a>";
  437. } else {
  438. echo "<input type='hidden' name='country_id' value='".$country_data['id']."'>";
  439. echo "&nbsp;&nbsp;&nbsp;&nbsp;<input type='text' name='country_tax' class='tax_forms' maxlength='5' size='5' value='".$country_data['tax']."'>%";
  440. }
  441. ?>
  442. </span>
  443. </td>
  444. </tr>
  445. <tr>
  446. <th scope="row">
  447. <?php echo TXT_WPSC_LANGUAGE;?>:
  448. </th>
  449. <td>
  450. <select name='language_setting'>
  451. <?php
  452. if(get_option('language_setting') != '') {
  453. $language_setting = get_option('language_setting');
  454. } else {
  455. $language_setting = "EN_en.php";
  456. }
  457. $languages_directory = WPSC_FILE_PATH.'/languages';
  458. $language_files = nzshpcrt_listdir($languages_directory);
  459. //echo "<pre>".print_r($language_files,true)."</pre>";
  460. foreach($language_files as $language_file) {
  461. switch($language_file) {
  462. case "EN_en.php";
  463. $language = "English";
  464. break;
  465. case "DE_de.php";
  466. $language = "Deutsch";
  467. break;
  468. case "FR_fr.php";
  469. $language = "Français";
  470. break;
  471. case "IT_it.php";
  472. $language = "Italian";
  473. break;
  474. case "BG_bg.php";
  475. $language = 'български';
  476. break;
  477. case "JP_jp.php";
  478. $language = "日本語";
  479. break;
  480. case "pt_BR.php";
  481. $language = "Brazilian Portuguese";
  482. break;
  483. case "RU_ru.php";
  484. $language = "Russian";
  485. break;
  486. case "SP_sp.php";
  487. $language = "Spanish";
  488. break;
  489. case "HU_hu.php";
  490. $language = "Hungarian";
  491. break;
  492. case "SV_sv.php";
  493. $language = "Swedish";
  494. break;
  495. case "TR_tr.php";
  496. $language = "Türkçe";
  497. break;
  498. case "EL_el.php";
  499. $language = "Ελληνικά";
  500. break;
  501. case "KO_ko.php";
  502. $language = "Korean";
  503. break;
  504. case "ZH_zh.php";
  505. $language = "Chinese";
  506. break;
  507. case "DK_da.php";
  508. $language = "Danish";
  509. break;
  510. case "DK_da.php";
  511. $language = "Danish";
  512. break;
  513. case "nn_NO.php";
  514. $language = "Norwegian";
  515. break;
  516. default:
  517. continue 2;
  518. break;
  519. }
  520. if($language_setting == $language_file) {
  521. echo "<option selected='true' value='".$language_file."'>".$language."</option>";
  522. } else {
  523. echo "<option value='".$language_file."'>".$language."</option>";
  524. }
  525. }
  526. ?>
  527. </select>
  528. </td>
  529. </tr>
  530. <tr>
  531. <th scope="row">
  532. <?php echo TXT_WPSC_HIDEADDTOCARTBUTTON;?>:
  533. </th>
  534. <td>
  535. <?php
  536. $hide_addtocart_button = get_option('hide_addtocart_button');
  537. $hide_addtocart_button1 = "";
  538. $hide_addtocart_button2 = "";
  539. switch($hide_addtocart_button) {
  540. case 0:
  541. $hide_addtocart_button2 = "checked ='checked'";
  542. break;
  543. case 1:
  544. $hide_addtocart_button1 = "checked ='checked'";
  545. break;
  546. }
  547. ?>
  548. <input type='radio' value='1' name='hide_addtocart_button' id='hide_addtocart_button1' <?php echo $hide_addtocart_button1; ?> /> <label for='hide_addtocart_button1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  549. <input type='radio' value='0' name='hide_addtocart_button' id='hide_addtocart_button2' <?php echo $hide_addtocart_button2; ?> /> <label for='hide_addtocart_button2'><?php echo TXT_WPSC_NO;?></label>
  550. </td>
  551. </tr>
  552. <tr>
  553. <th scope="row">
  554. <?php echo TXT_WPSC_HIDEADDNAMELINK;?>:
  555. </th>
  556. <td>
  557. <?php
  558. $hide_name_link = get_option('hide_name_link');
  559. $hide_name_link1 = "";
  560. $hide_name_link2 = "";
  561. switch($hide_name_link) {
  562. case 0:
  563. $hide_name_link2 = "checked ='checked'";
  564. break;
  565. case 1:
  566. $hide_name_link1 = "checked ='checked'";
  567. break;
  568. }
  569. ?>
  570. <input type='radio' value='1' name='hide_name_link' id='hide_name_link1' <?php echo $hide_name_link1; ?> /> <label for='hide_name_link1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  571. <input type='radio' value='0' name='hide_name_link' id='hide_name_link2' <?php echo $hide_name_link2; ?> /> <label for='hide_name_link2'><?php echo TXT_WPSC_NO;?></label>
  572. </td>
  573. </tr>
  574. <tr>
  575. <th scope="row">
  576. <?php echo TXT_WPSC_BUTTONTYPE;?>:
  577. </th>
  578. <td>
  579. <?php
  580. $addtocart_or_buynow = get_option('addtocart_or_buynow');
  581. $addtocart_or_buynow1 = "";
  582. $addtocart_or_buynow2 = "";
  583. switch($addtocart_or_buynow) {
  584. case 0:
  585. $addtocart_or_buynow1 = "checked ='checked'";
  586. break;
  587. case 1:
  588. $addtocart_or_buynow2 = "checked ='checked'";
  589. break;
  590. }
  591. ?>
  592. <input type='radio' value='0' name='addtocart_or_buynow' id='addtocart_or_buynow1' <?php echo $addtocart_or_buynow1; ?> /> <label for='addtocart_or_buynow1'><?php echo TXT_WPSC_ADDTOCART;?></label> &nbsp;
  593. <input type='radio' value='1' name='addtocart_or_buynow' id='addtocart_or_buynow2' <?php echo $addtocart_or_buynow2; ?> /> <label for='addtocart_or_buynow2'><?php echo TXT_WPSC_BUYNOW;?></label>
  594. </td>
  595. </tr>
  596. </table>
  597. <h3 class="form_group"><?php echo TXT_WPSC_CURRENCYSETTINGS;?>:</h3>
  598. <table class='wpsc_options form-table'>
  599. <tr>
  600. <th scope="row">
  601. <?php echo TXT_WPSC_CURRENCYTYPE;?>:
  602. </th>
  603. <td>
  604. <select name='currency_type' onChange='getcurrency(this.options[this.selectedIndex].value);'>
  605. <?php
  606. $currency_data = $wpdb->get_results("SELECT * FROM `".$wpdb->prefix."currency_list` ORDER BY `country` ASC",ARRAY_A);
  607. foreach($currency_data as $currency) {
  608. if(get_option('currency_type') == $currency['id']) {
  609. $selected = "selected='true'";
  610. } else {
  611. $selected = "";
  612. }
  613. echo " <option value='".$currency['id']."' ".$selected." >".$currency['country']." (".$currency['currency'].")</option>";
  614. }
  615. $currency_data = $wpdb->get_row("SELECT `symbol`,`symbol_html`,`code` FROM `".$wpdb->prefix."currency_list` WHERE `id`='".get_option('currency_type')."' LIMIT 1",ARRAY_A) ;
  616. if($currency_data['symbol'] != '') {
  617. $currency_sign = $currency_data['symbol_html'];
  618. } else {
  619. $currency_sign = $currency_data['code'];
  620. }
  621. ?>
  622. </select>
  623. </td>
  624. </tr>
  625. <tr>
  626. <th scope="row">
  627. <?php echo TXT_WPSC_CURRENCYSIGNLOCATION;?>:
  628. </th>
  629. <td>
  630. <?php
  631. $currency_sign_location = get_option('currency_sign_location');
  632. $csl1 = "";
  633. $csl2 = "";
  634. $csl3 = "";
  635. $csl4 = "";
  636. switch($currency_sign_location) {
  637. case 1:
  638. $csl1 = "checked ='true'";
  639. break;
  640. case 2:
  641. $csl2 = "checked ='true'";
  642. break;
  643. case 3:
  644. $csl3 = "checked ='true'";
  645. break;
  646. case 4:
  647. $csl4 = "checked ='true'";
  648. break;
  649. }
  650. ?>
  651. <input type='radio' value='1' name='currency_sign_location' id='csl1' <?php echo $csl1; ?> /> <span for='csl1'>100<span id=cslchar1><?php echo $currency_sign; ?></span></label> &nbsp;
  652. <input type='radio' value='2' name='currency_sign_location' id='csl2' <?php echo $csl2; ?> /> <label for='csl2'>100 <span id=cslchar2><?php echo $currency_sign; ?></span></label> &nbsp;
  653. <input type='radio' value='3' name='currency_sign_location' id='csl3' <?php echo $csl3; ?> /> <label for='csl3'><span id=cslchar3><?php echo $currency_sign; ?></span>100</label> &nbsp;
  654. <input type='radio' value='4' name='currency_sign_location' id='csl4' <?php echo $csl4; ?> /> <label for='csl4'><span id=cslchar4><?php echo $currency_sign; ?></span> 100</label>
  655. </td>
  656. </tr>
  657. </table>
  658. <?php
  659. /* here end the general options */
  660. ?>
  661. <div class="submit">
  662. <input type="submit" value="Update »" name="updateoption"/>
  663. </div>
  664. </div>
  665. <div id="options_presentation">
  666. <h2><?php echo TXT_WPSC_OPTIONS_PRESENTATION_HEADER; ?></h2>
  667. <?php
  668. /* here start the presentation options */
  669. ?>
  670. <table class='wpsc_options form-table'>
  671. <?php
  672. // if(function_exists('product_display_list') || function_exists('product_display_grid')) {
  673. ?>
  674. <tr>
  675. <th scope="row">
  676. <?php echo TXT_WPSC_PRODUCT_DISPLAY;?>:
  677. </th>
  678. <td>
  679. <?php
  680. $display_pnp = get_option('product_view');
  681. $product_view1 = null;
  682. $product_view2 = null;
  683. $product_view3 = null;
  684. switch($display_pnp) {
  685. case "grid":
  686. if(function_exists('product_display_grid')) {
  687. $product_view3 = "selected ='true'";
  688. break;
  689. }
  690. case "list":
  691. if(function_exists('product_display_list')) {
  692. $product_view2 = "selected ='true'";
  693. break;
  694. }
  695. default:
  696. $product_view1 = "selected ='true'";
  697. break;
  698. }
  699. if(get_option('list_view_quantity') == 1) {
  700. $list_view_quantity_value = "checked='true'";
  701. } else {
  702. $list_view_quantity_value = '';
  703. }
  704. if(get_option('show_images_only') == 1) {
  705. $show_images_only_value = "checked='true'";
  706. } else {
  707. $show_images_only_value = '';
  708. }
  709. if(get_option('display_variations') == 1) {
  710. $display_variations = "checked='true'";
  711. } else {
  712. $display_variations = '';
  713. }
  714. ?>
  715. <select name='product_view' onchange="toggle_display_options(this.options[this.selectedIndex].value)">
  716. <option value='default' <?php echo $product_view1; ?>><?php echo TXT_WPSC_DEFAULT;?></option>
  717. <?php
  718. if(function_exists('product_display_list')) {
  719. ?>
  720. <option value='list' <?php echo $product_view2; ?>><?php echo TXT_WPSC_LIST;?></option>
  721. <?php
  722. } else {
  723. ?>
  724. <option value='list' disabled='disabled' <?php echo $product_view2; ?>><?php echo TXT_WPSC_LIST;?></option>
  725. <?php
  726. }
  727. if(function_exists('product_display_grid')) {
  728. ?>
  729. <option value='grid' <?php echo $product_view3; ?>><?php echo TXT_WPSC_GRID;?></option>
  730. <?php
  731. } else {
  732. ?>
  733. <option value='grid' disabled='disabled' <?php echo $product_view3; ?>><?php echo TXT_WPSC_GRID;?></option>
  734. <?php
  735. }
  736. ?>
  737. </select>
  738. <?php
  739. if(!function_exists('product_display_grid')) {
  740. ?><a href='http://www.instinct.co.nz/e-commerce/shop/'><?php echo TXT_WPSC_PURCHASE_UNAVAILABLE; ?></a> <?php
  741. }
  742. ?>
  743. <div id='list_view_options' <?php if(is_null($product_view2)) { echo "style='display:none;'";} ?> >
  744. <input type='checkbox' value='1' name='list_view_quantity' id='list_view_quantity' <?php echo $list_view_quantity_value;?> />
  745. <label for='list_view_options'><?php echo TXT_WPSC_ADJUSTABLE_QUANTITY;?></label>
  746. </div>
  747. <div id='grid_view_options' <?php echo $list_view_quantity_style;?> <?php if(is_null($product_view3)) { echo "style='display:none;'";} ?>>
  748. <input type='checkbox' value='1' name='show_images_only' id='show_images_only' <?php echo $show_images_only_value;?> />
  749. <label for='show_images_only'><?php echo TXT_SHOW_IMAGES_ONLY;?></label><br />
  750. <input type='checkbox' value='1' name='display_variations' id='display_variations' <?php echo $display_variations;?> />
  751. <label for='display_variations'><?php echo TXT_DISPLAY_VARIATIONS;?></label>
  752. </div>
  753. </td>
  754. </tr>
  755. <?php
  756. // }
  757. ?>
  758. <tr>
  759. <th scope="row">
  760. <?php echo TXT_WPSC_SELECT_THEME;?>:
  761. </th>
  762. <td>
  763. <?php
  764. echo wpsc_list_product_themes();
  765. ?>
  766. </td>
  767. </tr>
  768. <tr>
  769. <th scope="row">
  770. <?php echo TXT_WPSC_CARTLOCATION;?>:
  771. </th>
  772. <td>
  773. <?php
  774. $cart_location = get_option('cart_location');
  775. $cart1 = "";
  776. $cart2 = "";
  777. switch($cart_location) {
  778. case 1:
  779. $cart1 = "checked ='true'";
  780. break;
  781. case 2:
  782. $cart2 = "checked ='true'";
  783. break;
  784. case 3:
  785. $cart3 = "checked ='true'";
  786. break;
  787. case 4:
  788. $cart4 = "checked ='true'";
  789. break;
  790. case 5:
  791. $cart5 = "checked ='true'";
  792. break;
  793. }
  794. if(function_exists('register_sidebar_widget')) {
  795. ?>
  796. <input type='radio' value='1' onclick='hideelement1("dropshop_option", this.value)' disabled='true' name='cart_location' id='cart1' <?php echo $cart1; ?> /> <label style='color: #666666;' for='cart1'><?php echo TXT_WPSC_SIDEBAR;?></label> &nbsp;
  797. <?php
  798. } else {
  799. ?>
  800. <input type='radio' value='1' name='cart_location' id='cart1' <?php echo $cart1; ?> /> <label for='cart1'><?php echo TXT_WPSC_SIDEBAR;?></label> &nbsp;
  801. <?php
  802. }
  803. ?>
  804. <input type='radio' onclick='hideelement1("dropshop_option", this.value)' value='2' name='cart_location' id='cart2' <?php echo $cart2; ?> /> <label for='cart2'><?php echo TXT_WPSC_PAGE;?></label> &nbsp;
  805. <?php
  806. if(function_exists('register_sidebar_widget')) {
  807. ?>
  808. <input type='radio' value='4' onclick='hideelement1("dropshop_option", this.value)' name='cart_location' id='cart4' <?php echo $cart4; ?> /> <label for='cart4'><?php echo TXT_WPSC_WIDGET;?></label> &nbsp;
  809. <?php
  810. } else {
  811. ?>
  812. <input type='radio' disabled='true' value='4' name='cart_location' id='cart4' alt='<?php echo TXT_WPSC_NEEDTOENABLEWIDGET;?>' title='<?php echo TXT_WPSC_NEEDTOENABLEWIDGET;?>' <?php echo $cart4; ?> /> <label style='color: #666666;' for='cart4' title='<?php echo TXT_WPSC_NEEDTOENABLEWIDGET;?>'><?php echo TXT_WPSC_WIDGET;?></label> &nbsp;
  813. <?php
  814. }
  815. if(function_exists('drag_and_drop_cart')) {
  816. ?>
  817. <input type='radio' onclick='hideelement1("dropshop_option", this.value)' value='5' name='cart_location' id='cart5' <?php echo $cart5; ?> /> <label for='cart5'><?php echo TXT_WPSC_GOLD_DROPSHOP;?></label> &nbsp;
  818. <?php
  819. } else {
  820. ?>
  821. <input type='radio' disabled='true' value='5' name='cart_location' id='cart5' alt='<?php echo TXT_WPSC_NEEDTOENABLEWIDGET;?>' title='<?php echo TXT_WPSC_NEEDTOENABLEDROPSHOP;?>' <?php echo $cart5; ?> /> <label style='color: #666666;' for='cart5' title='<?php echo TXT_WPSC_NEEDTOENABLEDROPSHOP;?>'><?php echo TXT_WPSC_GOLD_DROPSHOP;?></label> &nbsp;
  822. <?php
  823. }
  824. ?>
  825. <input type='radio' onclick='hideelement1("dropshop_option", this.value)' value='3' name='cart_location' id='cart3' <?php echo $cart3; ?> /> <label for='cart3'><?php echo TXT_WPSC_MANUAL;?> <span style='font-size: 7pt;'>(PHP code: &lt;?php echo nzshpcrt_shopping_basket(); ?&gt; )</span></label>
  826. <div style='display: <?php if (isset($cart5)) { echo "block"; } else { echo "none"; } ?>;' id='dropshop_option'>
  827. <p>
  828. <input type="radio" id="drop1" value="all" <?php if (get_option('dropshop_display') == 'all') { echo "checked='checked'"; } ?> name="wpsc_dropshop_display" /><label for="drop1"><?php echo TXT_WPSC_SHOW_DROPSHOP_ALL;?></label>
  829. <input type="radio" id="drop2" value="product" <?php if (get_option('dropshop_display') == 'product') { echo "checked='checked'"; } ?> name="wpsc_dropshop_display"/><label for="drop2"><?php echo TXT_WPSC_SHOW_DROPSHOP_PRODUCT;?></label>
  830. </p>
  831. <p>
  832. <input type="radio" id="wpsc_dropshop_theme1" value="light" <?php if (get_option('wpsc_dropshop_theme') != 'dark') { echo "checked='checked'"; } ?> name="wpsc_dropshop_theme" /><label for="wpsc_dropshop_theme1"><?php echo TXT_WPSC_DROPSHOP_LIGHT;?></label>
  833. <input type="radio" id="wpsc_dropshop_theme2" value="dark" <?php if (get_option('wpsc_dropshop_theme') == 'dark') { echo "checked='checked'"; } ?> name="wpsc_dropshop_theme"/><label for="wpsc_dropshop_theme2"><?php echo TXT_WPSC_DROPSHOP_DARK;?></label>
  834. </p>
  835. </div>
  836. </td>
  837. </tr>
  838. <tr>
  839. <th scope="row">
  840. <?php echo TXT_WPSC_DEFAULTCATEGORY; ?>:
  841. </th>
  842. <td>
  843. <?php echo options_categorylist(); ?>
  844. </td>
  845. </tr>
  846. <tr>
  847. <th scope="row">
  848. <?php echo TXT_WPSC_SHOW_CATEGORY_DESCRIPTION;?>:
  849. </th>
  850. <td>
  851. <?php
  852. $wpsc_category_description = get_option('wpsc_category_description');
  853. $wpsc_category_description1 = "";
  854. $wpsc_category_description2 = "";
  855. switch($wpsc_category_description) {
  856. case 'true':
  857. $wpsc_category_description1 = "checked ='true'";
  858. break;
  859. case 'false':
  860. default:
  861. $wpsc_category_description2 = "checked ='true'";
  862. break;
  863. }
  864. ?>
  865. <input type='radio' value='1' name='wpsc_category_description' id='wpsc_category_description1' <?php echo $wpsc_category_description1; ?> /> <label for='wpsc_category_description1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  866. <input type='radio' value='0' name='wpsc_category_description' id='wpsc_category_description2' <?php echo $wpsc_category_description2; ?> /> <label for='wpsc_category_description2'><?php echo TXT_WPSC_NO;?></label>
  867. </td>
  868. </tr>
  869. <tr>
  870. <th scope="row">
  871. <?php echo TXT_WPSC_SHOWPOSTAGEANDPACKAGING;?>:
  872. </th>
  873. <td>
  874. <?php
  875. $display_pnp = get_option('display_pnp');
  876. $display_pnp1 = "";
  877. $display_pnp2 = "";
  878. switch($display_pnp) {
  879. case 0:
  880. $display_pnp2 = "checked ='true'";
  881. break;
  882. case 1:
  883. $display_pnp1 = "checked ='true'";
  884. break;
  885. }
  886. ?>
  887. <input type='radio' value='1' name='display_pnp' id='display_pnp1' <?php echo $display_pnp1; ?> /> <label for='display_pnp1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  888. <input type='radio' value='0' name='display_pnp' id='display_pnp2' <?php echo $display_pnp2; ?> /> <label for='display_pnp2'><?php echo TXT_WPSC_NO;?></label>
  889. </td>
  890. </tr>
  891. <tr>
  892. <th scope="row">
  893. <?php echo TXT_WPSC_SHOW_BREADCRUMBS;?>:
  894. </th>
  895. <td>
  896. <?php
  897. $show_breadcrumbs = get_option('show_breadcrumbs');
  898. $show_breadcrumbs1 = "";
  899. $show_breadcrumbs2 = "";
  900. switch($show_breadcrumbs) {
  901. case 0:
  902. $show_breadcrumbs2 = "checked ='true'";
  903. break;
  904. case 1:
  905. $show_breadcrumbs1 = "checked ='true'";
  906. break;
  907. }
  908. ?>
  909. <input type='radio' value='1' name='show_breadcrumbs' id='show_breadcrumbs1' <?php echo $show_breadcrumbs1; ?> /> <label for='show_breadcrumbs1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  910. <input type='radio' value='0' name='show_breadcrumbs' id='show_breadcrumbs2' <?php echo $show_breadcrumbs2; ?> /> <label for='show_breadcrumbs2'><?php echo TXT_WPSC_NO;?></label>
  911. </td>
  912. </tr>
  913. <tr>
  914. <th scope="row">
  915. <?php echo TXT_WPSC_SHOWPRODUCTRATINGS;?>:
  916. </th>
  917. <td>
  918. <?php
  919. $display_pnp = get_option('product_ratings');
  920. $product_ratings1 = "";
  921. $product_ratings2 = "";
  922. switch($display_pnp) {
  923. case 0:
  924. $product_ratings2 = "checked ='true'";
  925. break;
  926. case 1:
  927. $product_ratings1 = "checked ='true'";
  928. break;
  929. }
  930. ?>
  931. <input type='radio' value='1' name='product_ratings' id='product_ratings1' <?php echo $product_ratings1; ?> /> <label for='product_ratings1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  932. <input type='radio' value='0' name='product_ratings' id='product_ratings2' <?php echo $product_ratings2; ?> /> <label for='product_ratings2'><?php echo TXT_WPSC_NO;?></label>
  933. </td>
  934. </tr>
  935. <tr>
  936. <th scope="row">
  937. <?php echo TXT_WPSC_SHOW_SLIDING_CART;?>:
  938. </th>
  939. <td>
  940. <?php
  941. $display_pnp = get_option('show_sliding_cart');
  942. $show_sliding_cart1 = "";
  943. $show_sliding_cart2 = "";
  944. switch($display_pnp) {
  945. case 0:
  946. $show_sliding_cart2 = "checked ='true'";
  947. break;
  948. case 1:
  949. $show_sliding_cart1 = "checked ='true'";
  950. break;
  951. }
  952. ?>
  953. <input type='radio' value='1' name='show_sliding_cart' id='show_sliding_cart1' <?php echo $show_sliding_cart1; ?> /> <label for='show_sliding_cart1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  954. <input type='radio' value='0' name='show_sliding_cart' id='show_sliding_cart2' <?php echo $show_sliding_cart2; ?> /> <label for='show_sliding_cart2'><?php echo TXT_WPSC_NO;?></label>
  955. </td>
  956. </tr>
  957. <!-- // Adrian - options for displaying number of products per category -->
  958. <tr>
  959. <th scope="row">
  960. <?php echo TXT_WPSC_SHOW_CATEGORY_COUNT;?>:
  961. </th>
  962. <td>
  963. <?php
  964. $display_pnp = get_option('show_category_count');
  965. $show_category_count1 = "";
  966. $show_category_count2 = "";
  967. switch($display_pnp) {
  968. case 0:
  969. $show_category_count2 = "checked ='true'";
  970. break;
  971. case 1:
  972. $show_category_count1 = "checked ='true'";
  973. break;
  974. }
  975. ?>
  976. <input type='radio' value='1' name='show_category_count' id='show_category_count1' <?php echo $show_category_count1; ?> /> <label for='show_category_count1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  977. <input type='radio' value='0' name='show_category_count' id='show_category_count2' <?php echo $show_category_count2; ?> /> <label for='show_category_count2'><?php echo TXT_WPSC_NO;?></label>
  978. </td>
  979. </tr>
  980. <!-- // Adrian - options for displaying category display type -->
  981. <tr>
  982. <th scope="row">
  983. <?php echo TXT_WPSC_CATSPRODS_DISPLAY_TYPE;?>:
  984. </th>
  985. <td>
  986. <?php
  987. $display_pnp = get_option('catsprods_display_type');
  988. $catsprods_display_type1 = "";
  989. $catsprods_display_type2 = "";
  990. switch($display_pnp) {
  991. case 0:
  992. $catsprods_display_type1 = "checked ='true'";
  993. break;
  994. case 1:
  995. $catsprods_display_type2 = "checked ='true'";
  996. break;
  997. }
  998. ?>
  999. <input type='radio' value='0' name='catsprods_display_type' id='catsprods_display_type1' <?php echo $catsprods_display_type1; ?> /> <label for='catsprods_display_type1'><?php echo TXT_WPSC_CATSPRODS_TYPE_CATONLY;?></label> &nbsp;
  1000. <input type='radio' value='1' name='catsprods_display_type' id='catsprods_display_type2' <?php echo $catsprods_display_type2; ?> /> <label for='catsprods_display_type2'><?php echo TXT_WPSC_CATSPRODS_TYPE_SLIDEPRODS;?></label>
  1001. </td>
  1002. </tr>
  1003. <?php
  1004. if(function_exists('gold_shpcrt_search_form')) {
  1005. ?>
  1006. <tr>
  1007. <th scope="row">
  1008. <?php echo TXT_WPSC_SHOW_SEARCH;?>:
  1009. </th>
  1010. <td>
  1011. <?php
  1012. $display_pnp = get_option('show_search');
  1013. $show_search1 = "";
  1014. $show_search2 = "";
  1015. switch($display_pnp) {
  1016. case 0:
  1017. $show_search2 = "checked ='true'";
  1018. break;
  1019. case 1:
  1020. $show_search1 = "checked ='true'";
  1021. break;
  1022. }
  1023. $display_ad_pnp = get_option('show_advanced_search');
  1024. $show_advanced_search = "";
  1025. if($display_ad_pnp == 1) {
  1026. $show_advanced_search = "checked ='true'";
  1027. }
  1028. $display_live_pnp = get_option('show_live_search');
  1029. if($display_ad_pnp == 1) {
  1030. $show_live_search = "checked ='true'";
  1031. }
  1032. if ($show_search1 != "checked ='true'") {
  1033. $dis = "style='display:none;'";
  1034. }
  1035. ?>
  1036. <input type='radio' onclick='jQuery("#wpsc_advanced_search").show()' value='1' name='show_search' id='show_search1' <?php echo $show_search1; ?> /> <label for='show_search1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  1037. <input type='radio' onclick='jQuery("#wpsc_advanced_search").hide()' value='0' name='show_search' id='show_search2' <?php echo $show_search2; ?> /> <label for='show_search2'><?php echo TXT_WPSC_NO;?></label>
  1038. <div <?=$dis?> id='wpsc_advanced_search'>
  1039. <input type='checkbox' name='show_advanced_search' id='show_advanced_search' <?php echo $show_advanced_search; ?> />
  1040. <?php echo TXT_WPSC_SHOWADVANCEDSEARCH;?><br>
  1041. <input type='checkbox' name='show_live_search' id='show_live_search' <?php echo $show_live_search; ?> />
  1042. <?php echo TXT_WPSC_SHOWLIVESEARCH;?>
  1043. </div>
  1044. </td>
  1045. </tr>
  1046. <?php
  1047. }
  1048. if(function_exists('gold_shpcrt_display_gallery')) {
  1049. ?>
  1050. <tr>
  1051. <th scope="row">
  1052. <?php echo TXT_WPSC_SHOW_GALLERY;?>:
  1053. </th>
  1054. <td>
  1055. <?php
  1056. $display_pnp = get_option('show_gallery');
  1057. $show_gallery1 = "";
  1058. $show_gallery2 = "";
  1059. switch($display_pnp) {
  1060. case 0:
  1061. $show_gallery2 = "checked ='true'";
  1062. break;
  1063. case 1:
  1064. $show_gallery1 = "checked ='true'";
  1065. break;
  1066. }
  1067. ?>
  1068. <input type='radio' value='1' name='show_gallery' id='show_gallery1' <?php echo $show_gallery1; ?> /> <label for='show_gallery1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  1069. <input type='radio' value='0' name='show_gallery' id='show_gallery2' <?php echo $show_gallery2; ?> /> <label for='show_gallery2'><?php echo TXT_WPSC_NO;?></label>
  1070. </td>
  1071. </tr>
  1072. <?php
  1073. }
  1074. ?>
  1075. <tr>
  1076. <th scope="row">
  1077. <?php echo TXT_WPSC_DISPLAY_FANCY_NOTIFICATIONS;?>:
  1078. </th>
  1079. <td>
  1080. <?php
  1081. $fancy_notifications = get_option('fancy_notifications');
  1082. $fancy_notifications1 = "";
  1083. $fancy_notifications2 = "";
  1084. switch($fancy_notifications)
  1085. {
  1086. case 0:
  1087. $fancy_notifications2 = "checked ='true'";
  1088. break;
  1089. case 1:
  1090. $fancy_notifications1 = "checked ='true'";
  1091. break;
  1092. }
  1093. ?>
  1094. <input type='radio' value='1' name='fancy_notifications' id='fancy_notifications1' <?php echo $fancy_notifications1; ?> /> <label for='fancy_notifications1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  1095. <input type='radio' value='0' name='fancy_notifications' id='fancy_notifications2' <?php echo $fancy_notifications2; ?> /> <label for='fancy_notifications2'><?php echo TXT_WPSC_NO;?></label>
  1096. </td>
  1097. </tr>
  1098. <tr>
  1099. <th scope="row">
  1100. <?php echo TXT_WPSC_DISPLAY_PLUSTAX;?>:
  1101. </th>
  1102. <td>
  1103. <?php
  1104. $add_plustax = get_option('add_plustax');
  1105. $add_plustax1 = "";
  1106. $add_plustax2 = "";
  1107. switch($add_plustax) {
  1108. case 0:
  1109. $add_plustax2 = "checked ='true'";
  1110. break;
  1111. case 1:
  1112. $add_plustax1 = "checked ='true'";
  1113. break;
  1114. }
  1115. ?>
  1116. <input type='radio' value='1' name='add_plustax' id='add_plustax1' <?php echo $add_plustax1; ?> /> <label for='add_plustax1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  1117. <input type='radio' value='0' name='add_plustax' id='add_plustax2' <?php echo $add_plustax2; ?> /> <label for='add_plustax2'><?php echo TXT_WPSC_NO;?></label>
  1118. </td>
  1119. </tr>
  1120. </table>
  1121. <h3 class="form_group"><?php echo TXT_WPSC_THUMBNAILSETTINGS;?></h3>
  1122. <table class='wpsc_options form-table'>
  1123. <?php
  1124. if(function_exists("getimagesize")) {
  1125. ?>
  1126. <tr>
  1127. <th scope="row">
  1128. <?php echo TXT_WPSC_PRODUCTTHUMBNAILSIZE;?>:
  1129. </th>
  1130. <td>
  1131. <?php echo TXT_WPSC_HEIGHT;?>:<input type='text' size='6' name='product_image_height' value='<?php echo get_option('product_image_height'); ?>' /> <?php echo TXT_WPSC_WIDTH;?>:<input type='text' size='6' name='product_image_width' value='<?php echo get_option('product_image_width'); ?>' /> <br /><span class='small'></span>
  1132. Changing this will only set the default size for images uploaded in future, to resize your current images, click <a href='#'>here</a> (this needs to be made to work, and this text needs adding to the language file)</span>
  1133. </td>
  1134. </tr>
  1135. <tr>
  1136. <th scope="row">
  1137. <?php echo TXT_WPSC_CATEGORYTHUMBNAILSIZE;?>:
  1138. </th>
  1139. <td>
  1140. <?php echo TXT_WPSC_HEIGHT;?>:<input type='text' size='6' name='category_image_height' value='<?php echo get_option('category_image_height'); ?>' /> <?php echo TXT_WPSC_WIDTH;?>:<input type='text' size='6' name='category_image_width' value='<?php echo get_option('category_image_width'); ?>' /> <span class='small'></span>
  1141. </td>
  1142. </tr>
  1143. <tr>
  1144. <th scope="row">
  1145. <?php echo TXT_WPSC_SINGLE_PRODUCTTHUMBNAILSIZE;?>:
  1146. </th>
  1147. <td>
  1148. <?php echo TXT_WPSC_HEIGHT;?>:<input type='text' size='6' name='single_view_image_height' value='<?php echo get_option('single_view_image_height'); ?>' /> <?php echo TXT_WPSC_WIDTH;?>:<input type='text' size='6' name='single_view_image_width' value='<?php echo get_option('single_view_image_width'); ?>' /> <span class='small'></span>
  1149. </td>
  1150. </tr>
  1151. <?php
  1152. }
  1153. ?>
  1154. <tr>
  1155. <th scope="row">
  1156. <?php echo TXT_WPSC_SHOWTHUMBNAILS;?>:
  1157. </th>
  1158. <td>
  1159. <?php
  1160. $show_thumbnails = get_option('show_thumbnails');
  1161. $show_thumbnails1 = "";
  1162. $show_thumbnails2 = "";
  1163. switch($show_thumbnails) {
  1164. case 0:
  1165. $show_thumbnails2 = "checked ='true'";
  1166. break;
  1167. case 1:
  1168. $show_thumbnails1 = "checked ='true'";
  1169. break;
  1170. }
  1171. ?>
  1172. <input type='radio' value='1' name='show_thumbnails' id='show_thumbnails1' <?php echo $show_thumbnails1; ?> /> <label for='show_thumbnails1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  1173. <input type='radio' value='0' name='show_thumbnails' id='show_thumbnails2' <?php echo $show_thumbnails2; ?> /> <label for='show_thumbnails2'><?php echo TXT_WPSC_NO;?></label>
  1174. </td>
  1175. </tr>
  1176. <tr>
  1177. <th scope="row">
  1178. <?php echo TXT_WPSC_SHOWCATEGORYTHUMBNAILS;?>:
  1179. </th>
  1180. <td>
  1181. <?php
  1182. $show_category_thumbnails = get_option('show_category_thumbnails');
  1183. $show_category_thumbnails1 = "";
  1184. $show_category_thumbnails2 = "";
  1185. switch($show_category_thumbnails) {
  1186. case 0:
  1187. $show_category_thumbnails2 = "checked ='true'";
  1188. break;
  1189. case 1:
  1190. $show_category_thumbnails1 = "checked ='true'";
  1191. break;
  1192. }
  1193. ?>
  1194. <input type='radio' value='1' name='show_category_thumbnails' id='show_category_thumbnails1' <?php echo $show_category_thumbnails1; ?> /> <label for='show_category_thumbnails1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  1195. <input type='radio' value='0' name='show_category_thumbnails' id='show_category_thumbnails2' <?php echo $show_category_thumbnails2; ?> /> <label for='show_category_thumbnails2'><?php echo TXT_WPSC_NO;?></label>
  1196. </td>
  1197. </tr>
  1198. </table>
  1199. <h3 class="form_group"><?php echo TXT_WPSC_PAGESETTINGS;?></h3>
  1200. <table class='wpsc_options form-table'>
  1201. <tr>
  1202. <th scope="row">
  1203. <?php echo TXT_WPSC_USE_PAGINATION;?>:
  1204. </th>
  1205. <td>
  1206. <?php
  1207. $use_pagination = get_option('use_pagination');
  1208. $use_pagination1 = "";
  1209. $use_pagination2 = "";
  1210. switch($use_pagination) {
  1211. case 0:
  1212. $use_pagination2 = "checked ='true'";
  1213. $page_count_display_state = 'style=\'display: none;\'';
  1214. break;
  1215. case 1:
  1216. $use_pagination1 = "checked ='true'";
  1217. $page_count_display_state = '';
  1218. break;
  1219. }
  1220. ?>
  1221. <input onclick='jQuery("#wpsc_products_per_page").show()' type='radio' value='1' name='use_pagination' id='use_pagination1' <?php echo $use_pagination1; ?> /> <label for='use_pagination1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  1222. <input onclick='jQuery("#wpsc_products_per_page").hide()' type='radio' value='0' name='use_pagination' id='use_pagination2' <?php echo $use_pagination2; ?> /> <label for='use_pagination2'><?php echo TXT_WPSC_NO;?></label><br />
  1223. <div id='wpsc_products_per_page' <?php echo $page_count_display_state; ?> >
  1224. <input type='text' size='6' name='wpsc_products_per_page' value='<?php echo get_option('wpsc_products_per_page'); ?>' /> <?php echo TXT_WPSC_OPTION_PRODUCTS_PER_PAGE; ?>
  1225. </div>
  1226. </td>
  1227. </tr>
  1228. <tr>
  1229. <th scope="row">
  1230. <?php echo TXT_WPSC_PAGE_NUMBER_POSITION;?>:
  1231. </th>
  1232. <td>
  1233. <input type='radio' value='1' name='wpsc_page_number_position' id='wpsc_page_number_position1' <?php if (get_option('wpsc_page_number_position') == 1) { echo "checked='true'"; } ?> /><label for='wpsc_page_number_position1'>Top</label>&nbsp;
  1234. <input type='radio' value='2' name='wpsc_page_number_position' id='wpsc_page_number_position2' <?php if (get_option('wpsc_page_number_position') == 2) { echo "checked='true'"; } ?> /><label for='wpsc_page_number_position2'>Bottom</label>&nbsp;
  1235. <input type='radio' value='3' name='wpsc_page_number_position' id='wpsc_page_number_position3' <?php if (get_option('wpsc_page_number_position') == 3) { echo "checked='true'"; } ?> /><label for='wpsc_page_number_position3'>Both</label>
  1236. <br />
  1237. </td>
  1238. </tr>
  1239. </table>
  1240. <?php
  1241. /* here end the presentation options */
  1242. ?>
  1243. <div class="submit">
  1244. <input type="submit" value="Update »" name="updateoption"/>
  1245. </div>
  1246. </div>
  1247. <div id="options_shipping">
  1248. <h2><?php echo TXT_WPSC_OPTIONS_SHIPPING_HEADER; ?></h2>
  1249. <?php
  1250. /* here start the shipping options */
  1251. ?>
  1252. <table class='wpsc_options form-table'>
  1253. <tr>
  1254. <th scope="row">
  1255. <?php echo TXT_WPSC_USE_SHIPPING;?>:
  1256. </th>
  1257. <td>
  1258. <?php
  1259. $do_not_use_shipping = get_option('do_not_use_shipping');
  1260. $do_not_use_shipping1 = "";
  1261. $do_not_use_shipping2 = "";
  1262. switch($do_not_use_shipping) {
  1263. case 1:
  1264. $do_not_use_shipping1 = "checked ='true'";
  1265. break;
  1266. case 0:
  1267. default:
  1268. $do_not_use_shipping2 = "checked ='true'";
  1269. break;
  1270. }
  1271. ?>
  1272. <input type='radio' value='0' name='do_not_use_shipping' id='do_not_use_shipping2' <?php echo $do_not_use_shipping2; ?> /> <label for='do_not_use_shipping2'><?php echo TXT_WPSC_YES;?></label>&nbsp;
  1273. <input type='radio' value='1' name='do_not_use_shipping' id='do_not_use_shipping1' <?php echo $do_not_use_shipping1; ?> /> <label for='do_not_use_shipping1'><?php echo TXT_WPSC_NO;?></label><br />
  1274. <?php echo TXT_WPSC_USE_SHIPPING_DESCRIPTION;?>
  1275. </td>
  1276. </tr>
  1277. <tr>
  1278. <th scope="row">
  1279. <?php echo TXT_WPSC_BASE_LOCAL;?>:
  1280. </th>
  1281. <td>
  1282. <input type='text' size='10' value='<?php echo number_format(get_option('base_local_shipping'), 2); ?>' name='base_local_shipping' />
  1283. </td>
  1284. </tr>
  1285. <tr>
  1286. <th scope="row">
  1287. <?php echo TXT_WPSC_BASE_INTERNATIONAL;?>:
  1288. </th>
  1289. <td>
  1290. <input type='text' size='10' value='<?php echo number_format(get_option('base_international_shipping'), 2); ?>' name='base_international_shipping' /><br />
  1291. <?php echo TXT_WPSC_SHIPPING_NOTE;?>
  1292. </td>
  1293. </tr>
  1294. <tr>
  1295. <th scope="row">
  1296. <?php echo TXT_WPSC_USPS_USERID;?>:
  1297. </th>
  1298. <td>
  1299. <input type='text' size='20' value='<?php echo get_option('usps_user_id'); ?>' name='usps_user_id' />
  1300. </td>
  1301. </tr>
  1302. <tr>
  1303. <th scope="row">
  1304. <?php echo TXT_WPSC_USPS_PASSWORD;?>:
  1305. </th>
  1306. <td>
  1307. <input type='text' size='20' value='<?php echo get_option('usps_user_password'); ?>' name='usps_user_password' />
  1308. </td>
  1309. </tr>
  1310. <?php
  1311. $shipwire1 = "";
  1312. $shipwire2 = "";
  1313. switch(get_option('shipwire')) {
  1314. case 1:
  1315. $shipwire1 = "checked ='true'";
  1316. $shipwire_settings = 'style=\'display: block;\'';
  1317. break;
  1318. case 0:
  1319. default:
  1320. $shipwire2 = "checked ='true'";
  1321. $shipwire_settings = '';
  1322. break;
  1323. }
  1324. ?>
  1325. <tr>
  1326. <th scope="row">
  1327. <?php echo TXT_WPSC_SHIPWIRESETTINGS;?><span style='color: red;'></span> :
  1328. </th>
  1329. <td>
  1330. <input type='radio' onclick='jQuery("#wpsc_shipwire_setting").show()' value='1' name='shipwire' id='shipwire1' <?php echo $shipwire1; ?> /> <label for='shipwire1'><?php echo TXT_WPSC_YES;?></label> &nbsp;
  1331. <input type='radio' onclick='jQuery("#wpsc_shipwire_setting").hide()' value='0' name='shipwire' id='shipwire2' <?php echo $shipwire2; ?> /> <label for='shipwire2'><?php echo TXT_WPSC_NO;?></label>
  1332. <?php
  1333. $shipwrieemail = get_option("shipwireemail");
  1334. $shipwriepassword = get_option("shipwirepassword");
  1335. ?>
  1336. <div id='wpsc_shipwire_setting' <?php echo $shipwire_settings; ?>>
  1337. <table>
  1338. <tr><td><?=TXT_WPSC_SHIPWIREEMAIL;?> :</td><td> <input type="text" name="shipwireemail" value="<?=$shipwrieemail;?>"></td></tr>
  1339. <tr><td><?=TXT_WPSC_SHIPWIREPASSWORD;?> :</td><td><input type="text" name="shipwirepassword" value="<?=$shipwriepassword;?>"></td></tr>
  1340. <tr><td><a onclick='shipwire_sync()' style="cursor:pointer;">Sync product</a></td></tr>
  1341. </table>
  1342. </div>
  1343. </td>
  1344. </tr>
  1345. </table>
  1346. <?php
  1347. /* here end the shipping options */
  1348. ?>
  1349. <div class="submit">
  1350. <input type="submit" value="Update »" name="updateoption"/>
  1351. </div>
  1352. </div>
  1353. <!--
  1354. <div id="options_payment">
  1355. <h2><?php echo TXT_WPSC_OPTIONS_PAYMENT_HEADER; ?></h2>
  1356. </div>-->
  1357. <div id="options_admin">
  1358. <h2><?php echo TXT_WPSC_OPTIONS_ADMIN_HEADER; ?></h2>
  1359. <?php
  1360. /* here start the admin options */
  1361. ?>
  1362. <table class='wpsc_options form-table'>
  1363. <tr>
  1364. <th scope="row">
  1365. <?php echo TXT_WPSC_MAXDOWNLOADSPERFILE;?>:
  1366. </th>
  1367. <td>
  1368. <input type='text' size='10' value='<?php echo get_option('max_downloads'); ?>' name='max_downloads' />
  1369. </td>
  1370. </tr>
  1371. <?php
  1372. $wpsc_ip_lock_downloads1 = "";
  1373. $wpsc_ip_lock_downloads2 = "";
  1374. switch(get_option('wpsc_ip_lock_downloads')) {
  1375. case 1:
  1376. $wpsc_ip_lock_downloads1 = "checked ='true'";
  1377. break;
  1378. case 0:
  1379. default:
  1380. $wpsc_ip_lock_downloads2 = "checked ='true'";
  1381. break;
  1382. }
  1383. ?>
  1384. <tr>
  1385. <th scope="row">
  1386. <?php echo TXT_WPSC_LOCK_DOWNLOADS_TO_IP;?>:
  1387. </th>
  1388. <td>
  1389. <input type='radio' value='1' name='wpsc_ip_lock_downloads' id='wpsc_ip_lock_downloads2' <?php echo $wpsc_ip_lock_downloads1; ?> /> <label for='wpsc_ip_lock_downloads2'><?php echo TXT_WPSC_YES;?></label>&nbsp;
  1390. <input type='radio' value='0' name='wpsc_ip_lock_downloads' id='wpsc_ip_lock_downloads1' <?php echo $wpsc_ip_lock_downloads2; ?> /> <label for='wpsc_ip_lock_downloads1'><?php echo TXT_WPSC_NO;?></label><br />
  1391. </td>
  1392. </tr>
  1393. <tr>
  1394. <th scope="row">
  1395. <?php echo TXT_WPSC_PURCHASELOGEMAIL;?>:
  1396. </th>
  1397. <td>
  1398. <input class='text' type='text' size='40' value='<?php echo get_option('purch_log_email'); ?>' name='purch_log_email' />
  1399. </td>
  1400. </tr>
  1401. <tr>
  1402. <th scope="row">
  1403. <?php echo TXT_WPSC_REPLYEMAIL;?>:
  1404. </td>
  1405. <td>
  1406. <input class='text' type='text' size='40' value='<?php echo get_option('return_email'); ?>' name='return_email' />
  1407. </td>
  1408. </tr>
  1409. <tr>
  1410. <th scope="row">
  1411. <?php echo TXT_WPSC_TERMS2;?>:
  1412. </th>
  1413. <td>
  1414. <textarea name='terms_and_conditions' size='40'><?php echo stripslashes(get_option('terms_and_conditions')); ?></textarea>
  1415. </td>
  1416. </tr>
  1417. </table>
  1418. <h3 class="form_group"><?php echo TXT_WPSC_URLSETTINGS;?>:</h3>
  1419. <table class='wpsc_options form-table'>
  1420. </tr>
  1421. <tr class='merged'>
  1422. <th scope="row">
  1423. <?php echo TXT_WPSC_PRODUCTLISTURL;?>:
  1424. </th>
  1425. <td>
  1426. <input class='text' type='text' size='50' value='<?php echo get_option('product_list_url'); ?>' name='product_list_url' />
  1427. </td>
  1428. </tr>
  1429. <tr class='merged'>
  1430. <th scope="row">
  1431. <?php echo TXT_WPSC_SHOPPINGCARTURL;?>:
  1432. </th>
  1433. <td>
  1434. <input class='text' type='text' size='50' value='<?php echo get_option('shopping_cart_url'); ?>' name='shopping_cart_url' />
  1435. </td>
  1436. </tr>
  1437. <?php /*
  1438. <tr class='merged'>
  1439. <th scope="row">
  1440. <?php echo TXT_WPSC_CHECKOUTURL;?>:
  1441. </th>
  1442. <td>
  1443. <input class='text' type='text' size='50' value='<?php echo get_option('checkout_url'); ?>' name='checkout_url' />
  1444. </td>
  1445. </tr>*/
  1446. ?>
  1447. <tr class='merged'>
  1448. <th scope="row">
  1449. <?php echo TXT_WPSC_TRANSACTIONDETAILSURL;?>:
  1450. </th>
  1451. <td>
  1452. <input class='text' type='text' size='50' value='<?php echo get_option('transact_url'); ?>' name='transact_url' />
  1453. </td>
  1454. </tr>
  1455. <?php
  1456. if(function_exists("nzshpcrt_user_log")) {
  1457. ?>
  1458. <tr class='merged'>
  1459. <th scope="row">
  1460. <?php echo TXT_WPSC_USERACCOUNTURL;?>:
  1461. </th>
  1462. <td>
  1463. <input class='text' type='text' size='50' value='<?php echo get_option('user_account_url'); ?>' name='user_account_url' />
  1464. </td>
  1465. </tr>
  1466. <?php
  1467. }
  1468. ?>
  1469. <tr class='merged'>
  1470. <td>
  1471. </td>
  1472. <td>
  1473. <a href='admin.php?page=<?php echo WPSC_DIR_NAME; ?>/options.php&amp;update_page_urls=true'><?php echo TXT_WPSC_UPDATE_PAGE_URLS; ?></a> |
  1474. <a href='admin.php?page=<?php echo WPSC_DIR_NAME; ?>/options.php&amp;clean_categories=true'><?php echo TXT_WPSC_FIX_CATEGORY_PERMALINKS; ?></a>
  1475. </td>
  1476. </tr>
  1477. </table>
  1478. <?php
  1479. /* here end the admin options */
  1480. ?>
  1481. <div class="submit">
  1482. <input type="submit" value="Update »" name="updateoption"/>
  1483. </div>
  1484. </div>
  1485. <!-- <div id="options_marketing">
  1486. <h2><?php echo TXT_WPSC_OPTIONS_MARKETING_HEADER; ?></h2>
  1487. </div>-->
  1488. </div>
  1489. </form>
  1490. <?php
  1491. }
  1492. ?>