PageRenderTime 28ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/wp-e-commerce/display-coupons.php

https://gitlab.com/endomorphosis/reservationtelco
PHP | 580 lines | 502 code | 55 blank | 23 comment | 69 complexity | db2f691c016ad43688b28081eb81edbf MD5 | raw file
  1. <?php
  2. function wpsc_display_coupons_page(){
  3. global $wpdb;
  4. if(isset($_POST) && is_array($_POST) && !empty($_POST)) {
  5. if(isset($_POST['add_coupon']) && ($_POST['add_coupon'] == 'true')&& (!($_POST['is_edit_coupon'] == 'true'))) {
  6. $coupon_code = $_POST['add_coupon_code'];
  7. $discount = (double)$_POST['add_discount'];
  8. // cast to boolean, then integer, prevents the value from being anything but 1 or 0
  9. $discount_type = (int)$_POST['add_discount_type'];
  10. $use_once = (int)(bool)$_POST['add_use-once'];
  11. $every_product = (int)(bool)$_POST['add_every_product'];
  12. // $start_date = date("Y-m-d H:i:s", mktime(0, 0, 0, (int)$_POST['add_start']['month'], (int)$_POST['add_start']['day'], (int)$_POST['add_start']['year']));
  13. // $end_date = date("Y-m-d H:i:s", mktime(0, 0, 0, (int)$_POST['add_end']['month'], (int)$_POST['add_end']['day'], (int)$_POST['add_end']['year']));
  14. $start_date = date('Y-m-d', strtotime($_POST['add_start'])) . " 00:00:00";
  15. $end_date = date('Y-m-d', strtotime($_POST['add_end'])) . " 00:00:00";
  16. $rules = $_POST['rules'];
  17. foreach ($rules as $key => $rule) {
  18. foreach ($rule as $k => $r) {
  19. $new_rule[$k][$key] = $r;
  20. }
  21. }
  22. foreach($new_rule as $key => $rule) {
  23. if ($rule['value'] == '') {
  24. unset($new_rule[$key]);
  25. }
  26. }
  27. if($wpdb->query("INSERT INTO `".WPSC_TABLE_COUPON_CODES."` ( `coupon_code` , `value` , `is-percentage` , `use-once` , `is-used` , `active` , `every_product` , `start` , `expiry`, `condition` ) VALUES ( '$coupon_code', '$discount', '$discount_type', '$use_once', '0', '1', '$every_product', '$start_date' , '$end_date' , '".serialize($new_rule)."' );")) {
  28. echo "<div class='updated'><p align='center'>".__('Thanks, the coupon has been added.', 'wpsc')."</p></div>";
  29. }
  30. }
  31. if(isset($_POST['is_edit_coupon']) && ($_POST['is_edit_coupon'] == 'true') && !(isset($_POST['delete_condition'])) && !(isset($_POST['submit_condition']))) {
  32. //exit('<pre>'.print_r($_POST, true).'</pre>');
  33. foreach((array)$_POST['edit_coupon'] as $coupon_id => $coupon_data) {
  34. //echo('<pre>'.print_r($coupon_data,true)."</pre>");
  35. $coupon_id = (int)$coupon_id;
  36. // convert dates to a form that compares well and can be inserted into the database
  37. // $coupon_data['start'] = date("Y-m-d H:i:s", mktime(0, 0, 0, (int)$coupon_data['start']['month'], (int)$coupon_data['start']['day'], (int)$coupon_data['start']['year']));
  38. // $coupon_data['expiry'] = date("Y-m-d H:i:s", mktime(0, 0, 0, (int)$coupon_data['expiry']['month'], (int)$coupon_data['expiry']['day'], (int)$coupon_data['expiry']['year']));
  39. $coupon_data['start'] = $coupon_data['start']." 00:00:00";
  40. $coupon_data['expiry'] = $coupon_data['expiry']." 00:00:00";
  41. $check_values = $wpdb->get_row("SELECT `id`, `coupon_code`, `value`, `is-percentage`, `use-once`, `active`, `start`, `expiry` FROM `".WPSC_TABLE_COUPON_CODES."` WHERE `id` = '$coupon_id'", ARRAY_A);
  42. //sort both arrays to make sure that if they contain the same stuff, that they will compare to be the same, may not need to do this, but what the heck
  43. // exit('<pre>'.print_r($coupon_data, true).'</pre>');
  44. ksort($check_values); ksort($coupon_data);
  45. if($check_values != $coupon_data) {
  46. $insert_array = array();
  47. foreach($coupon_data as $coupon_key => $coupon_value) {
  48. if(($coupon_key == "submit_coupon") || ($coupon_key == "delete_coupon")) {
  49. continue;
  50. }
  51. if($coupon_value != $check_values[$coupon_key]) {
  52. $insert_array[] = "`$coupon_key` = '$coupon_value'";
  53. }
  54. }
  55. //if(in_array(mixed needle, array haystack [, bool strict]))
  56. //exit("<pre>".print_r($conditions,true)."</pre>");
  57. if(count($insert_array) > 0) {
  58. $wpdb->query("UPDATE `".WPSC_TABLE_COUPON_CODES."` SET ".implode(", ", $insert_array)." WHERE `id` = '$coupon_id' LIMIT 1;");
  59. }
  60. unset($insert_array);
  61. $rules = $_POST['rules'];
  62. foreach ((array)$rules as $key => $rule) {
  63. foreach ($rule as $k => $r) {
  64. $new_rule[$k][$key] = $r;
  65. }
  66. }
  67. foreach((array)$new_rule as $key => $rule) {
  68. if ($rule['value'] == '') {
  69. unset($new_rule[$key]);
  70. }
  71. }
  72. /*
  73. $sql ="UPDATE `".WPSC_TABLE_COUPON_CODES."` SET `condition`='".serialize($new_rule)."' WHERE `id` = '$coupon_id' LIMIT 1";
  74. $wpdb->query($sql);
  75. */
  76. $conditions = $wpdb->get_var("SELECT `condition` FROM `".WPSC_TABLE_COUPON_CODES."` WHERE `id` = '".(int)$_POST['coupon_id']."' LIMIT 1");
  77. $conditions=unserialize($conditions);
  78. $new_cond=array();
  79. if($_POST['rules']['value'][0] != ''){
  80. $new_cond['property']=$_POST['rules']['property'][0];
  81. $new_cond['logic']=$_POST['rules']['logic'][0];
  82. $new_cond['value']=$_POST['rules']['value'][0];
  83. $conditions []= $new_cond;
  84. }
  85. $sql ="UPDATE `".WPSC_TABLE_COUPON_CODES."` SET `condition`='".serialize($conditions)."' WHERE `id` = '".(int)$_POST['coupon_id']."' LIMIT 1";
  86. $wpdb->query($sql);
  87. }
  88. if($coupon_data['delete_coupon'] != '') {
  89. $wpdb->query("DELETE FROM `".WPSC_TABLE_COUPON_CODES."` WHERE `id` = '$coupon_id' LIMIT 1;");
  90. }
  91. }
  92. }
  93. if(isset($_POST['delete_condition'])){
  94. $conditions = $wpdb->get_var("SELECT `condition` FROM `".WPSC_TABLE_COUPON_CODES."` WHERE `id` = '".(int)$_POST['coupon_id']."' LIMIT 1");
  95. $conditions=unserialize($conditions);
  96. unset($conditions[(int)$_POST['delete_condition']]);
  97. //$conditions = array_values($conditions);
  98. // exit('<pre>'.print_r($_POST, true).'</pre><pre>'.print_r($conditions, true).'</pre>'.$sql);
  99. $sql ="UPDATE `".WPSC_TABLE_COUPON_CODES."` SET `condition`='".serialize($conditions)."' WHERE `id` = '".(int)$_POST['coupon_id']."' LIMIT 1";
  100. $wpdb->query($sql);
  101. }
  102. if(isset($_POST['submit_condition'])){
  103. $conditions = $wpdb->get_var("SELECT `condition` FROM `".WPSC_TABLE_COUPON_CODES."` WHERE `id` = '".(int)$_POST['coupon_id']."' LIMIT 1");
  104. $conditions=unserialize($conditions);
  105. $new_cond=array();
  106. $new_cond['property']=$_POST['rules']['property'][0];
  107. $new_cond['logic']=$_POST['rules']['logic'][0];
  108. $new_cond['value']=$_POST['rules']['value'][0];
  109. $conditions []= $new_cond;
  110. $sql ="UPDATE `".WPSC_TABLE_COUPON_CODES."` SET `condition`='".serialize($conditions)."' WHERE `id` = '".(int)$_POST['coupon_id']."' LIMIT 1";
  111. $wpdb->query($sql);
  112. }
  113. if($_POST['change-settings'] == 'true') {
  114. if($_POST['wpsc_also_bought'] == 1) {
  115. update_option('wpsc_also_bought', 1);
  116. } else {
  117. update_option('wpsc_also_bought', 0);
  118. }
  119. if($_POST['display_find_us'] == 'on') {
  120. update_option('display_find_us', 1);
  121. } else {
  122. update_option('display_find_us', 0);
  123. }
  124. if($_POST['wpsc_share_this'] == 1) {
  125. update_option('wpsc_share_this', 1);
  126. } else {
  127. update_option('wpsc_share_this', 0);
  128. }
  129. }
  130. }
  131. /*<strong><?php echo TXT_WPSC_ADD_COUPON; ?></strong>*/
  132. ?>
  133. <script type='text/javascript'>
  134. jQuery(".pickdate").datepicker();
  135. /* jQuery datepicker selector */
  136. if (typeof jQuery('.pickdate').datepicker != "undefined") {
  137. jQuery('.pickdate').datepicker({ dateFormat: 'yy-mm-dd' });
  138. }
  139. </script>
  140. <div class="wrap">
  141. <h2><?php echo __('Coupons', 'wpsc');?></h2>
  142. <div style='margin:0px;' class="tablenav wpsc_admin_nav">
  143. <!-- <a target="_blank" href="http://www.instinct.co.nz/e-commerce/marketing/" class="about_this_page"><span>About This Page</span> </a> -->
  144. <form action='' method='post'>
  145. <input id='add_coupon_box_link' type='submit' class=' add_item_link button' name='add_coupon_button' value='<?php echo __('Create Coupon', 'wpsc');?>' onclick='return show_status_box("add_coupon_box","add_coupon_box_link");return false;' />
  146. </form>
  147. </div>
  148. <!-- <form name='edit_coupon' method='post' action=''> -->
  149. <table style="width: 100%;">
  150. <tr>
  151. <td id="coupon_data">
  152. <div id='add_coupon_box' class='modify_coupon' >
  153. <form name='add_coupon' method='post' action=''>
  154. <table class='add-coupon' >
  155. <tr>
  156. <th>
  157. <?php echo __('Coupon Code', 'wpsc'); ?>
  158. </th>
  159. <th>
  160. <?php echo __('Discount', 'wpsc'); ?>
  161. </th>
  162. <th>
  163. <?php echo __('Start', 'wpsc'); ?>
  164. </th>
  165. <th>
  166. <?php echo __('Expiry', 'wpsc'); ?>
  167. </th>
  168. <th>
  169. <?php echo __('Use Once', 'wpsc'); ?>
  170. </th>
  171. <th>
  172. <?php echo __('Active', 'wpsc'); ?>
  173. </th>
  174. <!--
  175. <th>
  176. <?php echo __('Apply On All Products', 'wpsc'); ?>
  177. </th>
  178. -->
  179. </tr>
  180. <tr>
  181. <td>
  182. <input type='text' value='' name='add_coupon_code' />
  183. </td>
  184. <td>
  185. <input type='text' value='' size='3' name='add_discount' />
  186. <select name='add_discount_type'>
  187. <option value='0' >$</option>
  188. <option value='1' >%</option>
  189. <option value='2' >Free shipping</option>
  190. </select>
  191. </td>
  192. <td>
  193. <input type='text' class='pickdate' size='11' name='add_start' />
  194. <!--<select name='add_start[day]'>
  195. <?php
  196. for($i = 1; $i <=31; ++$i) {
  197. $selected = '';
  198. if($i == date("d")) { $selected = "selected='selected'"; }
  199. echo "<option $selected value='$i'>$i</option>";
  200. }
  201. ?>
  202. </select>
  203. <select name='add_start[month]'>
  204. <?php
  205. for($i = 1; $i <=12; ++$i) {
  206. $selected = '';
  207. if($i == (int)date("m")) { $selected = "selected='selected'"; }
  208. echo "<option $selected value='$i'>".date("M",mktime(0, 0, 0, $i, 1, date("Y")))."</option>";
  209. }
  210. ?>
  211. </select>
  212. <select name='add_start[year]'>
  213. <?php
  214. for($i = date("Y"); $i <= (date("Y") +12); ++$i) {
  215. $selected = '';
  216. if($i == date("Y")) { $selected = "selected='true'"; }
  217. echo "<option $selected value='$i'>".$i."</option>";
  218. }
  219. ?>
  220. </select>-->
  221. </td>
  222. <td>
  223. <input type='text' class='pickdate' size='11' name='add_end'>
  224. <!--<select name='add_end[day]'>
  225. <?php
  226. for($i = 1; $i <=31; ++$i) {
  227. $selected = '';
  228. if($i == date("d")) { $selected = "selected='true'"; }
  229. echo "<option $selected value='$i'>$i</option>";
  230. }
  231. ?>
  232. </select>
  233. <select name='add_end[month]'>
  234. <?php
  235. for($i = 1; $i <=12; ++$i) {
  236. $selected = '';
  237. if($i == (int)date("m")) { $selected = "selected='true'"; }
  238. echo "<option $selected value='$i'>".date("M",mktime(0, 0, 0, $i, 1, date("Y")))."</option>";
  239. }
  240. ?>
  241. </select>
  242. <select name='add_end[year]'>
  243. <?php
  244. for($i = date("Y"); $i <= (date("Y") +12); ++$i) {
  245. $selected = '';
  246. if($i == (date("Y")+1)) { $selected = "selected='true'"; }
  247. echo "<option $selected value='$i'>".$i."</option>";
  248. }
  249. ?>
  250. </select>-->
  251. </td>
  252. <td>
  253. <input type='hidden' value='0' name='add_use-once' />
  254. <input type='checkbox' value='1' name='add_use-once' />
  255. </td>
  256. <td>
  257. <input type='hidden' value='0' name='add_active' />
  258. <input type='checkbox' value='1' checked='checked' name='add_active' />
  259. </td>
  260. <td>
  261. <input type='hidden' value='true' name='add_coupon' />
  262. <input type='submit' value='Add Coupon' name='submit_coupon' class='button-primary' />
  263. </td>
  264. </tr>
  265. <tr><td colspan="2">
  266. <input type='hidden' value='0' name='add_every_product' />
  267. <input type="checkbox" value="1" name='add_every_product'/>
  268. <?php _e('Apply On All Products', 'wpsc')?></td></tr>
  269. <tr><td colspan='3'><span id='table_header'>Conditions</span></td></tr>
  270. <tr><td colspan="8">
  271. <div class='coupon_condition' >
  272. <div class='first_condition'>
  273. <select class="ruleprops" name="rules[property][]">
  274. <option value="item_name" rel="order">Item name</option>
  275. <option value="item_quantity" rel="order">Item quantity</option>
  276. <option value="total_quantity" rel="order">Total quantity</option>
  277. <option value="subtotal_amount" rel="order">Subtotal amount</option>
  278. <?php echo apply_filters( 'wpsc_coupon_rule_property_options', '' ); ?>
  279. </select>
  280. <select name="rules[logic][]">
  281. <option value="equal">Is equal to</option>
  282. <option value="greater">Is greater than</option>
  283. <option value="less">Is less than</option>
  284. <option value="contains">Contains</option>
  285. <option value="not_contain">Does not contain</option>
  286. <option value="begins">Begins with</option>
  287. <option value="ends">Ends with</option>
  288. </select>
  289. <span>
  290. <input type="text" name="rules[value][]"/>
  291. </span>
  292. <span>
  293. <script>
  294. var coupon_number=1;
  295. function add_another_property(this_button){
  296. var new_property='<div class="coupon_condition">\n'+
  297. '<div><img height="16" width="16" class="delete" alt="Delete" src="<?php echo WPSC_URL; ?>/images/cross.png" onclick="jQuery(this).parent().remove();"/> \n'+
  298. '<select class="ruleprops" name="rules[property][]"> \n'+
  299. '<option value="item_name" rel="order">Item name</option> \n'+
  300. '<option value="item_quantity" rel="order">Item quantity</option>\n'+
  301. '<option value="total_quantity" rel="order">Total quantity</option>\n'+
  302. '<option value="subtotal_amount" rel="order">Subtotal amount</option>\n'+
  303. '<?php echo apply_filters( 'wpsc_coupon_rule_property_options', '' ); ?>'+
  304. '</select> \n'+
  305. '<select name="rules[logic][]"> \n'+
  306. '<option value="equal">Is equal to</option> \n'+
  307. '<option value="greater">Is greater than</option> \n'+
  308. '<option value="less">Is less than</option> \n'+
  309. '<option value="contains">Contains</option> \n'+
  310. '<option value="not_contain">Does not contain</option> \n'+
  311. '<option value="begins">Begins with</option> \n'+
  312. '<option value="ends">Ends with</option> \n'+
  313. '</select> \n'+
  314. '<span> \n'+
  315. '<input type="text" name="rules[value][]"/> \n'+
  316. '</span> \n'+
  317. '</div> \n'+
  318. '</div> ';
  319. jQuery('.coupon_condition :first').after(new_property);
  320. coupon_number++;
  321. }
  322. </script>
  323. </span>
  324. </div>
  325. </div>
  326. </tr>
  327. <tr><td> <a class="wpsc_coupons_condition_add" onclick="add_another_property(jQuery(this));">
  328. <?php _e('Add New Condition','wpsc'); ?>
  329. </a></td></tr>
  330. </table>
  331. <br />
  332. </form>
  333. </div>
  334. <?php
  335. $num = 0;
  336. echo "<table class='coupon-list'>\n\r";
  337. echo " <tr class='toprow'>\n\r";
  338. echo " <th>\n\r";
  339. echo __('Coupon Code', 'wpsc');
  340. echo " </th>\n\r";
  341. echo " <th>\n\r";
  342. echo __('Discount', 'wpsc');
  343. echo " </th>\n\r";
  344. echo " <th>\n\r";
  345. echo __('Start', 'wpsc');
  346. echo " </th>\n\r";
  347. echo " <th>\n\r";
  348. echo __('Expiry', 'wpsc');
  349. echo " </th>\n\r";
  350. echo " <th>\n\r";
  351. echo __('Active', 'wpsc');
  352. echo " </th>\n\r";
  353. echo " <th>\n\r";
  354. echo __('Apply On All Products', 'wpsc');
  355. echo " </th>\n\r";
  356. echo " <th>\n\r";
  357. echo __('Edit', 'wpsc');
  358. echo " </th>\n\r";
  359. $i=0;
  360. $coupon_data = $wpdb->get_results("SELECT * FROM `".WPSC_TABLE_COUPON_CODES."` ",ARRAY_A);
  361. //exit('Coupon Data<pre>'.print_r($coupon_data, true).'</pre>');
  362. foreach((array)$coupon_data as $coupon) {
  363. $alternate = "";
  364. $i++;
  365. if(($i % 2) != 0) {
  366. $alternate = "class='alt'";
  367. }
  368. echo "<tr $alternate>\n\r";
  369. echo " <td>\n\r";
  370. echo $coupon['coupon_code'];
  371. echo " </td>\n\r";
  372. echo " <td>\n\r";
  373. if($coupon['is-percentage'] == 1){
  374. echo $coupon['value']."%";
  375. } else {
  376. echo nzshpcrt_currency_display($coupon['value'], 1);
  377. }
  378. echo " </td>\n\r";
  379. echo " <td>\n\r";
  380. echo date("d/m/Y",strtotime($coupon['start']));
  381. echo " </td>\n\r";
  382. echo " <td>\n\r";
  383. echo date("d/m/Y",strtotime($coupon['expiry']));
  384. echo " </td>\n\r";
  385. echo " <td>\n\r";
  386. switch($coupon['active']) {
  387. case 1:
  388. echo "<img src='".WPSC_URL."/images/yes_stock.gif' alt='' title='' />";
  389. break;
  390. case 0: default:
  391. echo "<img src='".WPSC_URL."/images/no_stock.gif' alt='' title='' />";
  392. break;
  393. }
  394. echo " </td>\n\r";
  395. echo " <td>\n\r";
  396. switch($coupon['every_product']) {
  397. case 1:
  398. echo "<img src='".WPSC_URL."/images/yes_stock.gif' alt='' title='' />";
  399. break;
  400. case 0: default:
  401. echo "<img src='".WPSC_URL."/images/no_stock.gif' alt='' title='' />";
  402. break;
  403. }
  404. echo " </td>\n\r";
  405. echo " <td>\n\r";
  406. echo "<a title='".$coupon['coupon_code']."' href='javascript:void(0)' class='wpsc_edit_coupon' >".__('Edit', 'wpsc')."</a>";
  407. echo " </td>\n\r";
  408. echo " </tr>\n\r";
  409. echo " <tr>\n\r";
  410. echo " <td colspan='7' style='padding-left:0px;'>\n\r";
  411. // $status_style = "style='display: block;'";
  412. echo " <div id='coupon_box_".$coupon['id']."' class='modify_coupon' >\n\r";
  413. coupon_edit_form($coupon);
  414. echo " </div>\n\r";
  415. echo " </td>\n\r";
  416. echo " </tr>\n\r";
  417. }
  418. echo "</table>\n\r";
  419. ?>
  420. <p style='margin: 0px 0px 5px 0px;'>
  421. <?php _e('<strong>Note:</strong> Due to a current limitation of PayPal, if your user makes a purchase and uses a coupon, we can not send a list of items through to paypal for processing. Rather, we must send the total amount of the purchase, so that within PayPal the user who purchases a product will see your shop name and the total amount of their purchase.', 'wpsc');?>
  422. </p>
  423. </td>
  424. </tr>
  425. </table>
  426. <!-- <input type='hidden' value='true' name='is_edit_coupon' /> -->
  427. <!-- </form> -->
  428. <br />
  429. <h2><?php echo __('Marketing Settings', 'wpsc');?></h2>
  430. <form name='cart_options' method='POST' action=''>
  431. <input type='hidden' value='true' name='change-settings' />
  432. <table>
  433. <tr>
  434. <td>
  435. <?php echo __('Display Cross Sales', 'wpsc');?>:
  436. </td>
  437. <td>
  438. <?php
  439. $wpsc_also_bought = get_option('wpsc_also_bought');
  440. $wpsc_also_bought1 = "";
  441. $wpsc_also_bought2 = "";
  442. switch($wpsc_also_bought) {
  443. case 0:
  444. $wpsc_also_bought2 = "checked ='true'";
  445. break;
  446. case 1:
  447. $wpsc_also_bought1 = "checked ='true'";
  448. break;
  449. }
  450. ?>
  451. <input type='radio' value='1' name='wpsc_also_bought' id='wpsc_also_bought1' <?php echo $wpsc_also_bought1; ?> /> <label for='wpsc_also_bought1'><?php echo __('Yes', 'wpsc');?></label> &nbsp;
  452. <input type='radio' value='0' name='wpsc_also_bought' id='wpsc_also_bought2' <?php echo $wpsc_also_bought2; ?> /> <label for='wpsc_also_bought2'><?php echo __('No', 'wpsc');?></label>
  453. </td>
  454. </tr>
  455. <tr>
  456. <td>
  457. <?php echo __('Show Share This (Social Bookmarks)', 'wpsc');?>:
  458. </td>
  459. <td>
  460. <?php
  461. $wpsc_share_this = get_option('wpsc_share_this');
  462. $wpsc_share_this1 = "";
  463. $wpsc_share_this2 = "";
  464. switch($wpsc_share_this) {
  465. case 0:
  466. $wpsc_share_this2 = "checked ='true'";
  467. break;
  468. case 1:
  469. $wpsc_share_this1 = "checked ='true'";
  470. break;
  471. }
  472. ?>
  473. <input type='radio' value='1' name='wpsc_share_this' id='wpsc_share_this1' <?php echo $wpsc_share_this1; ?> /> <label for='wpsc_share_this1'><?php echo __('Yes', 'wpsc');?></label> &nbsp;
  474. <input type='radio' value='0' name='wpsc_share_this' id='wpsc_share_this2' <?php echo $wpsc_share_this2; ?> /> <label for='wpsc_share_this2'><?php echo __('No', 'wpsc');?></label>
  475. </td>
  476. </tr>
  477. <tr>
  478. <td>
  479. <?php echo __('Display How Customer Found Us Survey', 'wpsc')?>
  480. </td>
  481. <?php
  482. $display_find_us = get_option('display_find_us');
  483. if ($display_find_us=='1') {
  484. $display_find_us1 = "checked ='checked'";
  485. }
  486. ?>
  487. <td>
  488. <input <?php echo $display_find_us1; ?> type='checkbox' name='display_find_us'>
  489. </td>
  490. </tr>
  491. <tr>
  492. <td>
  493. </td>
  494. <td>
  495. <input type='submit' value='<?php echo __('Submit', 'wpsc');?>' name='form_submit' />
  496. </td>
  497. </tr>
  498. </table>
  499. </form>
  500. <h2><?php echo __('RSS Address', 'wpsc');?></h2>
  501. <table>
  502. <tr>
  503. <td colspan='2'>
  504. <?php echo __('<strong>Note:</strong> Not only can people use this RSS to keep update with your product list but you can also use this link to promote your products in your facebook profile. <br />Just add the <a href="http://apps.facebook.com/getshopped">getshopped! facebook application</a> to your facebook profile and follow the instructions.', 'wpsc');?>
  505. </td>
  506. </tr>
  507. <tr><td>&nbsp;</td></tr>
  508. <tr>
  509. <td>
  510. RSS Feed Address:
  511. </td>
  512. <td>
  513. <?php echo get_bloginfo('url')."/index.php?rss=true&amp;action=product_list"; ?>
  514. </td>
  515. </tr>
  516. </table>
  517. <h2><?php echo __('Google Merchant Centre / Google Product Search', 'wpsc'); ?></h2>
  518. <p>To import your products into <a href="http://www.google.com/merchants/" target="_blank">Google Merchant Centre</a> so that they appear within Google Product Search results, sign up for a Google Merchant Centre account and add a scheduled data feed with the following URL:</p>
  519. <?php $google_feed_url = get_bloginfo('url')."/index.php?rss=true&action=product_list&xmlformat=google"; ?>
  520. <a href="<?php echo htmlentities($google_feed_url); ?>"><?php echo htmlentities($google_feed_url); ?></a>
  521. </div>
  522. <?php
  523. }
  524. ?>