Changeset 3027301
- Timestamp:
- 01/26/2024 10:38:32 AM (2 years ago)
- Location:
- sf-autosuggest-product-search
- Files:
-
- 41 added
- 8 edited
-
tags/1.5 (added)
-
tags/1.5/README.txt (added)
-
tags/1.5/assets (added)
-
tags/1.5/assets/css (added)
-
tags/1.5/assets/css/sf_pa.css (added)
-
tags/1.5/assets/css/sf_pa_admin.css (added)
-
tags/1.5/assets/fonts (added)
-
tags/1.5/assets/fonts/Roboto (added)
-
tags/1.5/assets/fonts/Roboto/LICENSE.txt (added)
-
tags/1.5/assets/fonts/Roboto/Roboto-Black.ttf (added)
-
tags/1.5/assets/fonts/Roboto/Roboto-BlackItalic.ttf (added)
-
tags/1.5/assets/fonts/Roboto/Roboto-Bold.ttf (added)
-
tags/1.5/assets/fonts/Roboto/Roboto-BoldItalic.ttf (added)
-
tags/1.5/assets/fonts/Roboto/Roboto-Italic.ttf (added)
-
tags/1.5/assets/fonts/Roboto/Roboto-Light.ttf (added)
-
tags/1.5/assets/fonts/Roboto/Roboto-LightItalic.ttf (added)
-
tags/1.5/assets/fonts/Roboto/Roboto-Medium.ttf (added)
-
tags/1.5/assets/fonts/Roboto/Roboto-MediumItalic.ttf (added)
-
tags/1.5/assets/fonts/Roboto/Roboto-Regular.ttf (added)
-
tags/1.5/assets/fonts/Roboto/Roboto-Thin.ttf (added)
-
tags/1.5/assets/fonts/Roboto/Roboto-ThinItalic.ttf (added)
-
tags/1.5/assets/img (added)
-
tags/1.5/assets/img/loading.gif (added)
-
tags/1.5/assets/img/search-example.png (added)
-
tags/1.5/assets/js (added)
-
tags/1.5/assets/js/sf_pa.js (added)
-
tags/1.5/assets/js/sf_pa_admin.js (added)
-
tags/1.5/build (added)
-
tags/1.5/build/block.json (added)
-
tags/1.5/build/index.asset.php (added)
-
tags/1.5/build/index.css (added)
-
tags/1.5/build/index.js (added)
-
tags/1.5/build/style-index.css (added)
-
tags/1.5/classes (added)
-
tags/1.5/classes/AdminClass.php (added)
-
tags/1.5/classes/FeedbackClass.php (added)
-
tags/1.5/classes/SearchClass.php (added)
-
tags/1.5/classes/ValidatorClass.php (added)
-
tags/1.5/sf_products_autosuggest.php (added)
-
tags/1.5/uninstall.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/assets/js/sf_pa.js (modified) (1 diff)
-
trunk/assets/js/sf_pa_admin.js (modified) (1 diff)
-
trunk/classes/AdminClass.php (modified) (3 diffs)
-
trunk/classes/FeedbackClass.php (modified) (1 diff)
-
trunk/classes/SearchClass.php (modified) (5 diffs)
-
trunk/classes/ValidatorClass.php (modified) (1 diff)
-
trunk/sf_products_autosuggest.php (modified) (2 diffs)
-
trunk/uninstall.php (added)
Legend:
- Unmodified
- Added
- Removed
-
sf-autosuggest-product-search/trunk/README.txt
r3021136 r3027301 5 5 Requires PHP: 7.0 6 6 Tested up to: 6.4 7 Stable tag: 1. 4.17 Stable tag: 1.5 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.txt … … 58 58 59 59 == Changelog == 60 = 1.5 = 61 * Add price in search results 62 * Add uninstall functionality 63 60 64 = 1.4.1 = 61 65 * Change Prefix Class for more compatibility -
sf-autosuggest-product-search/trunk/assets/js/sf_pa.js
r3015788 r3027301 33 33 if(response[i].show_cat == 'on' && response[i].type == 'product'){ 34 34 to_append += '<p>'+response[i].cat_title+'</p>'; 35 } 36 //Category title 37 if(response[i].show_price == 'on' && response[i].type == 'product'){ 38 to_append += '<p>'+response[i].price+'</p>'; 35 39 } 36 40 to_append += '</div></div>'; -
sf-autosuggest-product-search/trunk/assets/js/sf_pa_admin.js
r2911702 r3027301 2 2 $('.sf_pa_color_picker').wpColorPicker(); 3 3 $('#sf_remove_transient').on('click', function(){ 4 /* TODO: fare ajax per cancellazione transients */4 /* TODO: ajax to delete transients */ 5 5 var data = { 6 6 'action': 'delete_sf_pa_transient' -
sf-autosuggest-product-search/trunk/classes/AdminClass.php
r3021136 r3027301 1 1 <?php 2 3 if ( ! defined( 'ABSPATH' ) ) { 4 exit; 5 } 2 6 3 7 class SFPA_AdminClass { … … 106 110 ), 107 111 array( 112 'title' => __('Show Price', 'sf_products_autosuggest'), 113 'section' => 'sf_pa_apparance', 114 'key' => 'show_price', 115 'input' => 'checkbox', 116 'instruction' => __('Check if you want to show product price in results', 'sf_products_autosuggest') 117 ), 118 array( 108 119 'title' => __('Exclude categories from search', 'sf_products_autosuggest'), 109 120 'section' => 'sf_pa_apparance', … … 213 224 $newinput['show_cat'] = $validator->checkbox($input['show_cat']); 214 225 } 226 if(isset($input['show_price']) && !empty($input['show_price'])){ 227 $newinput['show_price'] = $validator->checkbox($input['show_price']); 228 } 215 229 $newinput['exclude_cat'] = $validator->ids($input['exclude_cat']); 216 230 $newinput['exclude_ids'] = $validator->ids($input['exclude_ids']); -
sf-autosuggest-product-search/trunk/classes/FeedbackClass.php
r3021136 r3027301 1 1 <?php 2 3 if ( ! defined( 'ABSPATH' ) ) { 4 exit; 5 } 6 2 7 3 8 class SFPA_FeedbackClass { -
sf-autosuggest-product-search/trunk/classes/SearchClass.php
r3021136 r3027301 1 1 <?php 2 3 if ( ! defined( 'ABSPATH' ) ) { 4 exit; 5 } 6 2 7 class SFPA_SearchClass { 3 8 private $options; … … 6 11 $content_url = wp_upload_dir(); 7 12 $this->options = get_option( 'sf_pa_autosuggest_plugin_options' ); 13 if(!isset($this->options['show_cat'])){ 14 $this->options['show_cat'] = 0; 15 } 16 if(!isset($this->options['show_thumbnail'])){ 17 $this->options['show_thumbnail'] = 0; 18 } 19 if(!isset($this->options['show_price'])){ 20 $this->options['show_price'] = 0; 21 } 8 22 $this->count = 6; 9 23 $this->content_url = $content_url['baseurl']; … … 18 32 if(!$results){ 19 33 20 $prepare = array($this->options['show_cat'], $this->options['show_thumbnail'], '%' . $wpdb->esc_like($sf_pa_search) .'%');34 $prepare = array($this->options['show_cat'], $this->options['show_thumbnail'], $this->options['show_price'], '%' . $wpdb->esc_like($sf_pa_search) .'%'); 21 35 $join = ''; 22 36 $where = ''; … … 30 44 } 31 45 32 $sql = "SELECT ".$wpdb->prefix."posts.ID, ".$wpdb->prefix."posts.post_title as title, img_postmeta.meta_value as img_url, ".$wpdb->prefix."terms.name as cat_title, %s as show_cat, %s as show_thumbnail, 'product' AS type 46 // TODO: Join only if entity checkbox is true 47 $sql = "SELECT ".$wpdb->prefix."posts.ID, ".$wpdb->prefix."posts.post_title as title, img_postmeta.meta_value as img_url, price_postmeta.meta_value as price, ".$wpdb->prefix."terms.name as cat_title, %s as show_cat, %s as show_thumbnail, %s as show_price, 'product' AS type 33 48 FROM ".$wpdb->prefix."posts 34 49 LEFT JOIN ".$wpdb->prefix."postmeta ON ".$wpdb->prefix."postmeta.post_id = ".$wpdb->prefix."posts.ID AND ".$wpdb->prefix."postmeta.meta_key = '_thumbnail_id' 35 50 LEFT JOIN ".$wpdb->prefix."postmeta as img_postmeta ON img_postmeta.post_id = ".$wpdb->prefix."postmeta.meta_value AND img_postmeta.meta_key = '_wp_attachment_metadata' 51 LEFT JOIN ".$wpdb->prefix."postmeta as price_postmeta ON price_postmeta.post_id = ".$wpdb->prefix."posts.ID AND price_postmeta.meta_key = '_price' 36 52 LEFT JOIN ".$wpdb->prefix."term_relationships ON ".$wpdb->prefix."term_relationships.object_id = ".$wpdb->prefix."posts.ID 37 53 LEFT JOIN ".$wpdb->prefix."terms ON ".$wpdb->prefix."terms.term_id = ".$wpdb->prefix."term_relationships.term_taxonomy_id … … 66 82 $single_prod->cat_title = esc_html($single_prod->cat_title); 67 83 $single_prod->link = esc_url($this->build_link($single_prod->type, $single_prod->ID)); 84 $single_prod->price = number_format((float)esc_html($single_prod->price), 2, '.', '').' '.get_woocommerce_currency_symbol(); 68 85 $this->results[] = $single_prod; 69 86 } 70 87 71 88 foreach($results_cat as $single_cat){ 72 $single_cat->name = esc_html($single_cat-> name);89 $single_cat->name = esc_html($single_cat->title); 73 90 $single_cat->link = esc_url($this->build_link($single_cat->type, false, $single_cat->taxonomy,$single_cat->slug )); 74 91 $this->results[] = $single_cat; -
sf-autosuggest-product-search/trunk/classes/ValidatorClass.php
r3021136 r3027301 1 1 <?php 2 3 if ( ! defined( 'ABSPATH' ) ) { 4 exit; 5 } 2 6 3 7 class SFPA_ValidatorClass{ -
sf-autosuggest-product-search/trunk/sf_products_autosuggest.php
r3021136 r3027301 3 3 * Plugin Name: SF Autosuggest Product Search 4 4 * Description: Autosuggest Product Search for Woocommerce 5 * Version: 1. 4.15 * Version: 1.5 6 6 * Author: Simone Fontana 7 7 * Author URI: https://www.simonefontana.net/ 8 8 * WC requires at least: 3.0.0 9 * WC tested up to: 8. 4.09 * WC tested up to: 8.5 10 10 **/ 11 11 12 const SF_VERSION = "1.4.1"; 12 if ( ! defined( 'ABSPATH' ) ) { 13 exit; 14 } 13 15 16 const SF_VERSION = "1.5"; 14 17 15 18 /* Add style and script to plugin*/ … … 47 50 } 48 51 49 function sf_pa_input_search_shortcode( $attr ibuti){52 function sf_pa_input_search_shortcode( $attrs ){ 50 53 $options = get_option( 'sf_pa_autosuggest_plugin_options' ); 51 54 $all_bg = '#000';
Note: See TracChangeset
for help on using the changeset viewer.