Perfect Brands for WooCommerce - Version 1.4.3

Version Description

  • Feature (Widget): Filter products by brand
  • Feature (Option): Show brand logo in product loop
  • Feature: Brand microdata added to product page
  • Feature (Tool): Migrate brands from "YITH WooCommerce Brands Add-on"
Download this release

Release Info

Developer titodevera
Plugin Icon 128x128 Perfect Brands for WooCommerce
Version 1.4.3
Comparing to
See all releases

Code changes from version 1.4.2 to 1.4.3

assets/css/styles-admin.css CHANGED
@@ -15,3 +15,29 @@
15
  }
16
  }
17
  /* ----------------------- /Taxonomy pwb-brand ----------------------- */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
  }
17
  /* ----------------------- /Taxonomy pwb-brand ----------------------- */
18
+
19
+ .pwb-modal{
20
+ position: fixed;
21
+ top: 0;
22
+ right: 0;
23
+ bottom: 0;
24
+ left: 0;
25
+ z-index: 99999999999;
26
+ line-height: 1;
27
+ background: rgba(0,0,0,0.9);
28
+ font-size: 2em;
29
+ padding-top: 20px;
30
+ text-align: center;
31
+ }
32
+ .pwb-modal-inner {
33
+ max-width: 70%;
34
+ margin: 0 auto;
35
+ animation: pwbblinkkf 3s linear infinite;
36
+ color: #fff;
37
+ }
38
+ .pwb-modal-inner p{
39
+ font-size: 2em;
40
+ }
41
+ @keyframes pwbblinkkf {
42
+ 50% { opacity: 0; }
43
+ }
assets/js/pwb_admin_functions.js CHANGED
@@ -39,4 +39,40 @@ jQuery(document).ready(function( $ ) {
39
  open_media_uploader_image(event);
40
  });
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  });
39
  open_media_uploader_image(event);
40
  });
41
 
42
+
43
+ /* ····························· Settings tab ····························· */
44
+
45
+ $('#wc_pwb_admin_tab_tools_migrate').on( 'change', function(){
46
+
47
+ if( $(this).val() != '-' ){
48
+
49
+ if( confirm(ajax_object.translations.migrate_notice) ){
50
+
51
+ $('html').append('<div class="pwb-modal"><div class="pwb-modal-inner"></div></div>');
52
+ $('.pwb-modal-inner').html('<p>'+ajax_object.translations.migrating+'</p>');
53
+
54
+ var data = {
55
+ 'action': 'pwb_admin_migrate_brands',
56
+ 'from': $(this).val()
57
+ };
58
+ jQuery.post(ajax_object.ajax_url, data, function(response) {
59
+
60
+ setTimeout( function(){
61
+ location.href = ajax_object.brands_url;
62
+ }, 1000 );
63
+
64
+ });
65
+
66
+ }else{
67
+
68
+ }
69
+
70
+ }
71
+
72
+ $(this).val('-');//reset to default value
73
+
74
+ } );
75
+
76
+ /* ····························· /Settings tab ····························· */
77
+
78
  });
assets/js/pwb_frontend_functions.js CHANGED
@@ -73,4 +73,70 @@ jQuery(document).ready(function( $ ) {
73
  }
74
  ]
75
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  }
74
  ]
75
  });
76
+
77
+
78
+ /* ··························· Filter by brand widget ··························· */
79
+
80
+ var brands = PWBgetUrlParameter('pwb-brand-filter');
81
+
82
+ $('.pwb-filter-products button').on( 'click', function(){
83
+
84
+ var currentUrl = window.location.href;
85
+
86
+ var marcas = '';
87
+ $('.pwb-filter-products input[type="checkbox"]').each(function(index){
88
+ var checked = $(this).prop('checked');
89
+ if(checked){
90
+ marcas+=$(this).val();
91
+ if($('.pwb-filter-products input[type="checkbox"]').length-1 != index){
92
+ marcas+=',';
93
+ }
94
+ }
95
+ });
96
+
97
+ //removes previous "pwb-brand" from url
98
+ currentUrl = currentUrl.replace(/&?pwb-brand-filter=([^&]$|[^&]*)/i, "");
99
+
100
+ if( currentUrl.indexOf("?") === -1 ){
101
+ currentUrl = currentUrl + '?pwb-brand-filter='+marcas;
102
+ }else{
103
+ currentUrl = currentUrl + '&pwb-brand-filter='+marcas;
104
+ }
105
+ location.href = currentUrl;
106
+
107
+ });
108
+
109
+ if(brands!=null){
110
+ var brands_array = brands.split(',');
111
+ $('.pwb-filter-products input[type="checkbox"]').prop('checked',false);
112
+ for ( var i = 0, l = brands_array.length; i < l; i++ ) {
113
+ $('.pwb-filter-products input[type="checkbox"]').each(function(index){
114
+ if($(this).val()){
115
+ if(brands_array[i]==$(this).val()){
116
+ $(this).prop('checked',true);
117
+ }
118
+ }
119
+ });
120
+ }
121
+ }else{
122
+ $('.pwb-filter-products input[type="checkbox"]').prop('checked', false);
123
+ }
124
+
125
+ /* ··························· /Filter by brand widget ··························· */
126
+
127
  });
128
+
129
+ var PWBgetUrlParameter = function PWBgetUrlParameter(sParam) {
130
+ var sPageURL = decodeURIComponent(window.location.search.substring(1)),
131
+ sURLVariables = sPageURL.split('&'),
132
+ sParameterName,
133
+ i;
134
+
135
+ for (i = 0; i < sURLVariables.length; i++) {
136
+ sParameterName = sURLVariables[i].split('=');
137
+
138
+ if (sParameterName[0] === sParam) {
139
+ return sParameterName[1] === undefined ? true : sParameterName[1];
140
+ }
141
+ }
142
+ };
classes/class-perfect-woocommerce-brands.php CHANGED
@@ -6,35 +6,153 @@
6
  class Perfect_Woocommerce_Brands{
7
 
8
  function __construct(){
9
- add_action('plugins_loaded', array($this,'load_textdomain'));
10
- add_action('woocommerce_init', array($this,'register_brands_taxonomy'), 10, 0);
11
- add_action('init',array($this,'add_brands_metafields'));
12
- add_action('pwb-brand_add_form_fields', array($this,'add_brands_metafields_form') );
13
- add_action('pwb-brand_edit_form_fields', array($this,'add_brands_metafields_form_edit') );
14
- add_action('edit_pwb-brand', array($this,'add_brands_metafields_save') );
15
- add_action('create_pwb-brand', array($this,'add_brands_metafields_save') );
16
- add_filter('manage_edit-pwb-brand_columns', array($this,'brand_taxonomy_columns_head'));
17
- add_filter('manage_pwb-brand_custom_column', array($this,'brand_taxonomy_columns' ), 10, 3);
18
- add_action('admin_enqueue_scripts', array($this,'register_admin_scripts'));
19
  $this->brand_logo_position();
20
- add_action('woocommerce_before_shop_loop', array($this,'archive_page_banner'), 9);
21
- add_action('woocommerce_before_shop_loop', array($this,'show_brand_description'), 9);
22
- add_action('widgets_init', function(){register_widget('\Perfect_Woocommerce_Brands\Pwb_Dropdown_Widget');});
23
- add_action('widgets_init', function(){register_widget('\Perfect_Woocommerce_Brands\Pwb_List_Widget');});
24
  if ( !is_admin() ) {
25
- add_action('init', array($this,'register_frontend_scripts'));
26
  }
27
- add_shortcode( 'pwb-carousel', array('\Perfect_Woocommerce_Brands\Pwb_Carousel_Shortcode','carousel_shortcode') );
28
- add_shortcode( 'pwb-product-carousel', array('\Perfect_Woocommerce_Brands\Pwb_Product_Carousel_Shortcode','product_carousel_shortcode') );
29
- add_shortcode( 'pwb-all-brands', array('\Perfect_Woocommerce_Brands\Pwb_All_Brands_Shortcode','all_brands_shortcode') );
30
- add_shortcode( 'pwb-brand', array('\Perfect_Woocommerce_Brands\Pwb_Brand_Shortcode','brand_shortcode') );
31
  if(is_plugin_active('js_composer/js_composer.php')){
32
- add_action('vc_before_init', array($this,'vc_map_shortcodes') );
33
  }
 
 
 
 
 
 
 
 
 
34
  }
35
 
36
- public function load_textdomain() {
37
- load_plugin_textdomain( 'perfect-woocommerce-brands', false, PWB_PLUGIN_PATH . '/lang' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  }
39
 
40
  public function show_brand_description(){
@@ -47,6 +165,39 @@
47
  }
48
  }
49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  /**
51
  * woocommerce_single_product_summary hook.
52
  *
@@ -344,6 +495,18 @@
344
  wp_enqueue_style('pwb_styles_brands');
345
  wp_enqueue_media();
346
  wp_enqueue_script('pwb_brands_js');
 
 
 
 
 
 
 
 
 
 
 
 
347
  }else{
348
  return;
349
  }
6
  class Perfect_Woocommerce_Brands{
7
 
8
  function __construct(){
9
+ add_action( 'woocommerce_init', array( $this, 'register_brands_taxonomy' ), 10, 0 );
10
+ add_action( 'init', array( $this, 'add_brands_metafields' ) );
11
+ add_action( 'pwb-brand_add_form_fields', array( $this, 'add_brands_metafields_form' ) );
12
+ add_action( 'pwb-brand_edit_form_fields', array( $this, 'add_brands_metafields_form_edit' ) );
13
+ add_action( 'edit_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
14
+ add_action( 'create_pwb-brand', array( $this, 'add_brands_metafields_save' ) );
15
+ add_filter( 'manage_edit-pwb-brand_columns', array( $this, 'brand_taxonomy_columns_head' ) );
16
+ add_filter( 'manage_pwb-brand_custom_column', array( $this, 'brand_taxonomy_columns' ), 10, 3 );
17
+ add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_scripts' ) );
 
18
  $this->brand_logo_position();
19
+ add_action( 'woocommerce_before_shop_loop', array( $this, 'archive_page_banner' ), 9);
20
+ add_action( 'woocommerce_before_shop_loop', array( $this, 'show_brand_description' ), 9);
21
+ add_action( 'woocommerce_after_shop_loop_item_title', array( $this, 'show_brands_in_loop' ) );
22
+
23
  if ( !is_admin() ) {
24
+ add_action( 'init', array( $this, 'register_frontend_scripts' ) );
25
  }
26
+
27
+ $this->add_shortcodes();
28
+
 
29
  if(is_plugin_active('js_composer/js_composer.php')){
30
+ add_action( 'vc_before_init', array( $this,'vc_map_shortcodes' ) );
31
  }
32
+
33
+ add_action( 'widgets_init', array( $this, 'register_widgets' ) );
34
+
35
+ add_action( 'woocommerce_after_single_product_summary' , array( $this, 'product_microdata' ), 40 );
36
+
37
+ add_action( 'wp_ajax_pwb_admin_migrate_brands', array( $this, 'migrate_brands' ) );
38
+
39
+ add_action( 'pre_get_posts', array( $this, 'pwb_brand_filter' ) );
40
+
41
  }
42
 
43
+ public function pwb_brand_filter( $query ){
44
+
45
+ if( !empty($_GET['pwb-brand-filter']) ){
46
+
47
+ $terms_array = explode(',',$_GET['pwb-brand-filter']);
48
+
49
+ //remove invalid terms (security)
50
+ for ($i=0; $i < count($terms_array); $i++) {
51
+ if( !term_exists( $terms_array[$i], 'pwb-brand' ) ){
52
+ unset($terms_array[$i]);
53
+ }
54
+ }
55
+
56
+ if ( !is_admin() && is_post_type_archive( 'product' ) && $query->is_main_query() ) {
57
+
58
+ $query->set('tax_query', array(
59
+ array (
60
+ 'taxonomy' => 'pwb-brand',
61
+ 'field' => 'slug',
62
+ 'terms' => $terms_array
63
+ )
64
+ ));
65
+
66
+ }
67
+
68
+ }
69
+
70
+ }
71
+
72
+ public function migrate_brands(){
73
+
74
+ if( isset( $_POST['from'] ) ){
75
+
76
+ switch ($_POST['from']) {
77
+ case 'yith':
78
+
79
+ $terms = get_terms( 'yith_product_brand', array(
80
+ 'hide_empty' => false
81
+ ) );
82
+
83
+ foreach ($terms as $term) {
84
+
85
+ global $wpdb;
86
+
87
+ //change taxonomy
88
+ $wpdb->update(
89
+ $wpdb->prefix . 'term_taxonomy',
90
+ array(
91
+ 'taxonomy' => 'pwb-brand'
92
+ ),
93
+ array(
94
+ 'term_id' => $term->term_id
95
+ )
96
+ );
97
+
98
+ //update term meta
99
+ $wpdb->update(
100
+ $wpdb->prefix . 'termmeta',
101
+ array(
102
+ 'meta_key' => 'pwb_brand_image'
103
+ ),
104
+ array(
105
+ 'meta_key' => 'thumbnail_id',
106
+ 'term_id' => $term->term_id
107
+ )
108
+ );
109
+
110
+ }
111
+
112
+ break;
113
+ }
114
+
115
+ }
116
+
117
+ wp_die();
118
+ }
119
+
120
+ /*
121
+ * Adds microdata (brands) to single products
122
+ */
123
+ public function product_microdata(){
124
+ global $product;
125
+ $brands = wp_get_post_terms( $product->id, 'pwb-brand');
126
+
127
+ foreach ($brands as $brand) {
128
+ echo '<meta itemprop="brand" content="'.$brand->name.'">';
129
+ }
130
+
131
+ }
132
+
133
+ public function add_shortcodes(){
134
+ add_shortcode( 'pwb-carousel', array(
135
+ '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Carousel_Shortcode',
136
+ 'carousel_shortcode'
137
+ ) );
138
+ add_shortcode( 'pwb-product-carousel', array(
139
+ '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Product_Carousel_Shortcode',
140
+ 'product_carousel_shortcode'
141
+ ) );
142
+ add_shortcode( 'pwb-all-brands', array(
143
+ '\Perfect_Woocommerce_Brands\Shortcodes\PWB_All_Brands_Shortcode',
144
+ 'all_brands_shortcode'
145
+ ) );
146
+ add_shortcode( 'pwb-brand', array(
147
+ '\Perfect_Woocommerce_Brands\Shortcodes\PWB_Brand_Shortcode',
148
+ 'brand_shortcode'
149
+ ) );
150
+ }
151
+
152
+ public function register_widgets(){
153
+ register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_List_Widget' );
154
+ register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_Dropdown_Widget' );
155
+ register_widget( '\Perfect_Woocommerce_Brands\Widgets\PWB_Filter_By_Brand_Widget' );
156
  }
157
 
158
  public function show_brand_description(){
165
  }
166
  }
167
 
168
+ public function show_brands_in_loop(){
169
+
170
+ $brands_in_loop = get_option('wc_pwb_admin_tab_brands_in_loop');
171
+
172
+ if( $brands_in_loop == 'brand_link' || $brands_in_loop == 'brand_image' ){
173
+
174
+ global $product;
175
+ $product_id = $product->id;
176
+ $product_brands = wp_get_post_terms($product_id, 'pwb-brand');
177
+ if(!empty($product_brands)){
178
+ echo '<div class="pwb-brands-in-loop">';
179
+ foreach ($product_brands as $brand) {
180
+
181
+ echo '<span>';
182
+ $brand_link = get_term_link ( $brand->term_id, 'pwb-brand' );
183
+ $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
184
+
185
+ $attachment_html = wp_get_attachment_image( $attachment_id, 'thumbnail' );
186
+ if( !empty($attachment_html) && $brands_in_loop == 'brand_image' ){
187
+ echo '<a href="'.$brand_link.'">'.$attachment_html.'</a>';
188
+ }else{
189
+ echo '<a href="'.$brand_link.'">'.$brand->name.'</a>';
190
+ }
191
+ echo '</span>';
192
+
193
+ }
194
+ echo '</div>';
195
+ }
196
+
197
+ }
198
+
199
+ }
200
+
201
  /**
202
  * woocommerce_single_product_summary hook.
203
  *
495
  wp_enqueue_style('pwb_styles_brands');
496
  wp_enqueue_media();
497
  wp_enqueue_script('pwb_brands_js');
498
+ }elseif( $hook == 'woocommerce_page_wc-settings' && isset($_GET['tab']) && $_GET['tab']=='pwb_admin_tab' ){
499
+ //settings tab page
500
+ wp_enqueue_style( 'pwb_styles_brands' );
501
+ wp_enqueue_script( 'pwb_brands_js' );
502
+ wp_localize_script( 'pwb_brands_js', 'ajax_object', array(
503
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
504
+ 'brands_url' => admin_url( 'edit-tags.php?taxonomy=pwb-brand&post_type=product' ),
505
+ 'translations' => array(
506
+ 'migrate_notice' => __('¿Start migration?','perfect-woocommerce-brands'),
507
+ 'migrating' => __('We are migrating the product brands. ¡Don´t close this window until the process is finished!','perfect-woocommerce-brands')
508
+ )
509
+ ) );
510
  }else{
511
  return;
512
  }
classes/class-pwb-admin-tab.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- namespace Perfect_Woocommerce_Brands;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
@@ -11,7 +11,6 @@
11
  add_action( 'woocommerce_update_options_pwb_admin_tab', __CLASS__ . '::update_settings' );
12
  }
13
 
14
-
15
  /**
16
  * Add a new settings tab to the WooCommerce settings tabs array.
17
  *
@@ -32,6 +31,7 @@
32
  */
33
  public static function settings_tab() {
34
  woocommerce_admin_fields( self::get_settings() );
 
35
  }
36
 
37
 
@@ -69,23 +69,23 @@
69
 
70
  $settings = array(
71
  'section_title' => array(
72
- 'name' => __( 'Brands settings', 'perfect-woocommerce-brands' ),
73
- 'type' => 'title',
74
- 'desc' => '',
75
- 'id' => 'wc_pwb_admin_tab_section_title'
76
  ),
77
  'slug' => array(
78
- 'name' => __( 'Slug', 'perfect-woocommerce-brands' ),
79
- 'type' => 'text',
80
- 'desc' => __( 'Brands taxonomy slug', 'perfect-woocommerce-brands' ),
81
- 'id' => 'wc_pwb_admin_tab_slug',
82
  'placeholder' => get_taxonomy('pwb-brand')->rewrite['slug']
83
  ),
84
  'brand_logo_size' => array(
85
- 'name' => __( 'Brand logo size', 'perfect-woocommerce-brands' ),
86
- 'type' => 'select',
87
- 'desc' => __( 'Brand logo size for single product view', 'perfect-woocommerce-brands' ),
88
- 'id' => 'wc_pwb_admin_tab_brand_logo_size',
89
  'options' => $available_image_sizes_adapted
90
  ),
91
  'brand_single_position' => array(
@@ -94,29 +94,70 @@
94
  'desc' => __( 'For single product', 'perfect-woocommerce-brands' ),
95
  'id' => 'wc_pwb_admin_tab_brand_single_position',
96
  'options' => array(
97
- 'before_title' => __( 'Before title', 'perfect-woocommerce-brands' ),
98
- 'after_title' => __( 'After title', 'perfect-woocommerce-brands' ),
99
- 'after_price' => __( 'After price', 'perfect-woocommerce-brands' ),
100
- 'after_excerpt' => __( 'After excerpt', 'perfect-woocommerce-brands' ),
101
  'after_add_to_cart' => __( 'After add to cart', 'perfect-woocommerce-brands' ),
102
- 'after_meta' => __( 'After meta', 'perfect-woocommerce-brands' ),
103
- 'after_sharing' => __( 'After sharing', 'perfect-woocommerce-brands' )
104
  )
105
  ),
106
  'brand_description' => array(
107
- 'name' => __( 'Show brand description', 'perfect-woocommerce-brands' ),
108
- 'type' => 'checkbox',
109
  'default' => 'yes',
110
- 'desc' => __( 'Show brand description (if is set) on brand archive page', 'perfect-woocommerce-brands' ),
111
- 'id' => 'wc_pwb_admin_tab_brand_desc'
 
 
 
 
 
 
 
 
 
 
 
112
  ),
113
  'section_end' => array(
114
  'type' => 'sectionend',
115
- 'id' => 'wc_pwb_admin_tab_section_end'
116
  )
117
  );
118
 
119
  return apply_filters( 'wc_pwb_admin_tab_settings', $settings );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  }
121
 
122
  }
1
  <?php
2
+ namespace Perfect_Woocommerce_Brands\Admin;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
11
  add_action( 'woocommerce_update_options_pwb_admin_tab', __CLASS__ . '::update_settings' );
12
  }
13
 
 
14
  /**
15
  * Add a new settings tab to the WooCommerce settings tabs array.
16
  *
31
  */
32
  public static function settings_tab() {
33
  woocommerce_admin_fields( self::get_settings() );
34
+ woocommerce_admin_fields( self::get_tools() );
35
  }
36
 
37
 
69
 
70
  $settings = array(
71
  'section_title' => array(
72
+ 'name' => __( 'Brands settings', 'perfect-woocommerce-brands' ),
73
+ 'type' => 'title',
74
+ 'desc' => '',
75
+ 'id' => 'wc_pwb_admin_tab_section_title'
76
  ),
77
  'slug' => array(
78
+ 'name' => __( 'Slug', 'perfect-woocommerce-brands' ),
79
+ 'type' => 'text',
80
+ 'desc' => __( 'Brands taxonomy slug', 'perfect-woocommerce-brands' ),
81
+ 'id' => 'wc_pwb_admin_tab_slug',
82
  'placeholder' => get_taxonomy('pwb-brand')->rewrite['slug']
83
  ),
84
  'brand_logo_size' => array(
85
+ 'name' => __( 'Brand logo size', 'perfect-woocommerce-brands' ),
86
+ 'type' => 'select',
87
+ 'desc' => __( 'Brand logo size for single product view', 'perfect-woocommerce-brands' ),
88
+ 'id' => 'wc_pwb_admin_tab_brand_logo_size',
89
  'options' => $available_image_sizes_adapted
90
  ),
91
  'brand_single_position' => array(
94
  'desc' => __( 'For single product', 'perfect-woocommerce-brands' ),
95
  'id' => 'wc_pwb_admin_tab_brand_single_position',
96
  'options' => array(
97
+ 'before_title' => __( 'Before title', 'perfect-woocommerce-brands' ),
98
+ 'after_title' => __( 'After title', 'perfect-woocommerce-brands' ),
99
+ 'after_price' => __( 'After price', 'perfect-woocommerce-brands' ),
100
+ 'after_excerpt' => __( 'After excerpt', 'perfect-woocommerce-brands' ),
101
  'after_add_to_cart' => __( 'After add to cart', 'perfect-woocommerce-brands' ),
102
+ 'after_meta' => __( 'After meta', 'perfect-woocommerce-brands' ),
103
+ 'after_sharing' => __( 'After sharing', 'perfect-woocommerce-brands' )
104
  )
105
  ),
106
  'brand_description' => array(
107
+ 'name' => __( 'Show brand description', 'perfect-woocommerce-brands' ),
108
+ 'type' => 'checkbox',
109
  'default' => 'yes',
110
+ 'desc' => __( 'Show brand description (if is set) on brand archive page', 'perfect-woocommerce-brands' ),
111
+ 'id' => 'wc_pwb_admin_tab_brand_desc'
112
+ ),
113
+ 'show_brand_on_loop' => array(
114
+ 'name' => __( 'Show brands in loop', 'perfect-woocommerce-brands' ),
115
+ 'type' => 'select',
116
+ 'desc' => __( 'Show brand logo (or name) in product loop', 'perfect-woocommerce-brands' ),
117
+ 'id' => 'wc_pwb_admin_tab_brands_in_loop',
118
+ 'options' => array(
119
+ 'no' => __( 'No', 'perfect-woocommerce-brands' ),
120
+ 'brand_link' => __( 'Show brand link', 'perfect-woocommerce-brands' ),
121
+ 'brand_image' => __( 'Show brand image (if is set)', 'perfect-woocommerce-brands' )
122
+ )
123
  ),
124
  'section_end' => array(
125
  'type' => 'sectionend',
126
+ 'id' => 'wc_pwb_admin_tab_section_end'
127
  )
128
  );
129
 
130
  return apply_filters( 'wc_pwb_admin_tab_settings', $settings );
131
+
132
+ }
133
+
134
+ public static function get_tools() {
135
+
136
+ $tools = array(
137
+ 'section_title' => array(
138
+ 'name' => __( 'Tools', 'perfect-woocommerce-brands' ),
139
+ 'type' => 'title',
140
+ 'desc' => '',
141
+ 'id' => 'wc_pwb_admin_tab_section_tools_title'
142
+ ),
143
+ 'slug' => array(
144
+ 'name' => __( 'Import brands', 'perfect-woocommerce-brands' ),
145
+ 'type' => 'select',
146
+ 'desc' => __( 'Import brands from old plugin installation', 'perfect-woocommerce-brands' ),
147
+ 'id' => 'wc_pwb_admin_tab_tools_migrate',
148
+ 'options' => array(
149
+ '-' => __( '-', 'perfect-woocommerce-brands' ),
150
+ 'yith' => __( 'YITH WooCommerce Brands Add-On', 'perfect-woocommerce-brands' )
151
+ )
152
+ ),
153
+ 'section_end' => array(
154
+ 'type' => 'sectionend',
155
+ 'id' => 'wc_pwb_admin_tab_section_tools_end'
156
+ )
157
+ );
158
+
159
+ return apply_filters( 'wc_pwb_admin_tab_tools_settings', $tools );
160
+
161
  }
162
 
163
  }
classes/shortcodes/{class-pwb-all-brands-shortcode.php → class-pwb-all-brands.php} RENAMED
@@ -1,11 +1,12 @@
1
  <?php
2
- namespace Perfect_Woocommerce_Brands;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
6
- class Pwb_All_Brands_Shortcode{
7
 
8
  public static function all_brands_shortcode( $atts ) {
 
9
  $atts = shortcode_atts( array(
10
  'per_page' => "10",
11
  'image_size' => "thumbnail"
@@ -13,8 +14,7 @@
13
 
14
  ob_start();
15
 
16
- $brands = Perfect_Woocommerce_Brands::get_brands();
17
-
18
  ?>
19
  <div class="pwb-all-brands">
20
  <?php static::pagination($brands, $atts['per_page'], $atts['image_size']);?>
1
  <?php
2
+ namespace Perfect_Woocommerce_Brands\Shortcodes;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
6
+ class PWB_All_Brands_Shortcode{
7
 
8
  public static function all_brands_shortcode( $atts ) {
9
+
10
  $atts = shortcode_atts( array(
11
  'per_page' => "10",
12
  'image_size' => "thumbnail"
14
 
15
  ob_start();
16
 
17
+ $brands = \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands();
 
18
  ?>
19
  <div class="pwb-all-brands">
20
  <?php static::pagination($brands, $atts['per_page'], $atts['image_size']);?>
classes/shortcodes/{class-pwb-brand-shortcode.php → class-pwb-brand.php} RENAMED
@@ -1,9 +1,9 @@
1
  <?php
2
- namespace Perfect_Woocommerce_Brands;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
6
- class Pwb_Brand_Shortcode{
7
 
8
  public static function brand_shortcode( $atts ) {
9
  $atts = shortcode_atts( array(
1
  <?php
2
+ namespace Perfect_Woocommerce_Brands\Shortcodes;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
6
+ class PWB_Brand_Shortcode{
7
 
8
  public static function brand_shortcode( $atts ) {
9
  $atts = shortcode_atts( array(
classes/shortcodes/{class-pwb-carousel-shortcode.php → class-pwb-carousel.php} RENAMED
@@ -1,9 +1,9 @@
1
  <?php
2
- namespace Perfect_Woocommerce_Brands;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
6
- class Pwb_Carousel_Shortcode{
7
 
8
  public static function carousel_shortcode( $atts ) {
9
  $atts = shortcode_atts( array(
@@ -24,7 +24,7 @@
24
  }
25
 
26
  ?><div class="pwb-carousel" data-slick='{"slidesToShow": <?php echo (int)$atts['items_to_show'];?>, "slidesToScroll": <?php echo (int)$atts['items_to_scroll'];?>, "autoplay": <?php echo $autoplay;?>}'><?php
27
- foreach(Perfect_Woocommerce_Brands::get_brands() as $brand){
28
  if($foreach_iterator>=(int)$atts['items']){
29
  break;
30
  }
1
  <?php
2
+ namespace Perfect_Woocommerce_Brands\Shortcodes;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
6
+ class PWB_Carousel_Shortcode{
7
 
8
  public static function carousel_shortcode( $atts ) {
9
  $atts = shortcode_atts( array(
24
  }
25
 
26
  ?><div class="pwb-carousel" data-slick='{"slidesToShow": <?php echo (int)$atts['items_to_show'];?>, "slidesToScroll": <?php echo (int)$atts['items_to_scroll'];?>, "autoplay": <?php echo $autoplay;?>}'><?php
27
+ foreach(\Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_brands() as $brand){
28
  if($foreach_iterator>=(int)$atts['items']){
29
  break;
30
  }
classes/shortcodes/{class-pwb-product-carousel-shortcode.php → class-pwb-product-carousel.php} RENAMED
@@ -1,9 +1,9 @@
1
  <?php
2
- namespace Perfect_Woocommerce_Brands;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
6
- class Pwb_Product_Carousel_Shortcode{
7
 
8
  public static function product_carousel_shortcode( $atts ) {
9
  $atts = shortcode_atts( array(
@@ -26,9 +26,9 @@
26
  ?>
27
 
28
  <div class="pwb-product-carousel" data-slick='{"slidesToShow": <?php echo (int)$atts['products_to_show'];?>, "slidesToScroll": <?php echo (int)$atts['products_to_scroll'];?>, "autoplay": <?php echo $autoplay;?>}'>
29
- <?php echo Perfect_Woocommerce_Brands::get_products_by_brand($atts['brand'], (int)$atts['products']); ?>
30
  </div>
31
-
32
  <?php
33
  return ob_get_clean();
34
  }
1
  <?php
2
+ namespace Perfect_Woocommerce_Brands\Shortcodes;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
6
+ class PWB_Product_Carousel_Shortcode{
7
 
8
  public static function product_carousel_shortcode( $atts ) {
9
  $atts = shortcode_atts( array(
26
  ?>
27
 
28
  <div class="pwb-product-carousel" data-slick='{"slidesToShow": <?php echo (int)$atts['products_to_show'];?>, "slidesToScroll": <?php echo (int)$atts['products_to_scroll'];?>, "autoplay": <?php echo $autoplay;?>}'>
29
+ <?php echo \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands::get_products_by_brand($atts['brand'], (int)$atts['products']); ?>
30
  </div>
31
+
32
  <?php
33
  return ob_get_clean();
34
  }
classes/widgets/{class-pwb-dropdown-widget.php → class-pwb-dropdown.php} RENAMED
@@ -1,16 +1,16 @@
1
  <?php
2
- namespace Perfect_Woocommerce_Brands;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
6
- class Pwb_Dropdown_Widget extends \WP_Widget {
7
 
8
  function __construct(){
9
  $params = array(
10
  'description' => __( 'Adds a brands dropdown to your site', 'perfect-woocommerce-brands' ),
11
  'name' => __( 'Brands dropdown', 'perfect-woocommerce-brands' )
12
  );
13
- parent::__construct('Pwb_Dropdown_Widget', '', $params);
14
  }
15
 
16
  public function form($instance){
@@ -25,7 +25,7 @@
25
  id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
26
  name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
27
  value="<?php if(isset($title)) echo esc_attr($title); ?>">
28
- </p>
29
 
30
  <?php
31
  }
@@ -66,4 +66,4 @@
66
 
67
  }
68
 
69
- }
1
  <?php
2
+ namespace Perfect_Woocommerce_Brands\Widgets;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
6
+ class PWB_Dropdown_Widget extends \WP_Widget {
7
 
8
  function __construct(){
9
  $params = array(
10
  'description' => __( 'Adds a brands dropdown to your site', 'perfect-woocommerce-brands' ),
11
  'name' => __( 'Brands dropdown', 'perfect-woocommerce-brands' )
12
  );
13
+ parent::__construct('PWB_Dropdown_Widget', '', $params);
14
  }
15
 
16
  public function form($instance){
25
  id="<?php echo esc_attr( $this->get_field_id('title') ); ?>"
26
  name="<?php echo esc_attr( $this->get_field_name('title') ); ?>"
27
  value="<?php if(isset($title)) echo esc_attr($title); ?>">
28
+ </p>
29
 
30
  <?php
31
  }
66
 
67
  }
68
 
69
+ }
classes/widgets/class-pwb-filter-by-brand.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Perfect_Woocommerce_Brands\Widgets;
3
+
4
+ defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
+
6
+ class PWB_Filter_By_Brand_Widget extends \WP_Widget {
7
+
8
+ function __construct() {
9
+ $params = array(
10
+ 'description' => __( 'Recommended for product categories or shop page', 'perfect-woocommerce-brands' ),
11
+ 'name' => __( 'Filter products by brand', 'perfect-woocommerce-brands' )
12
+ );
13
+ parent::__construct('PWB_Filter_By_Brand_Widget', '', $params);
14
+ }
15
+
16
+ public function form( $instance ) {
17
+ if ( isset( $instance[ 'title' ] ) ) {
18
+ $title = $instance[ 'title' ];
19
+ }else {
20
+ $title = 'Marcas';
21
+ }
22
+ ?>
23
+ <p>
24
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
25
+ <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" />
26
+ </p>
27
+ <?php
28
+ }
29
+
30
+ public function widget( $args, $instance ) {
31
+
32
+ $title = apply_filters( 'widget_title', $instance['title'] );
33
+
34
+ echo $args['before_widget'];
35
+ if ( ! empty( $title ) )
36
+ echo $args['before_title'] . $title . $args['after_title'];
37
+ $this->render_widget();
38
+ echo $args['after_widget'];
39
+
40
+ }
41
+
42
+ public function render_widget(){
43
+
44
+ $brands = get_terms('pwb-brand',array(
45
+ 'hide_empty' => false
46
+ ));
47
+ $brands_ids = array();
48
+ foreach ($brands as $brand) {
49
+ $brands_ids[] = $brand->term_id;
50
+ }
51
+
52
+ $cat = get_queried_object();
53
+
54
+ if( is_product_category() ){
55
+
56
+ $cat_id = $cat->term_taxonomy_id;
57
+ $cat_id_array = get_term_children( $cat_id, 'product_cat' );
58
+ $cat_id_array[] = $cat_id;
59
+
60
+ $result_brands = array();
61
+ $args = array(
62
+ 'posts_per_page' => -1,
63
+ 'post_type' => 'product',
64
+ 'tax_query' => array(
65
+ 'relation' => 'AND',
66
+ array(
67
+ 'taxonomy' => 'product_cat',
68
+ 'field' => 'term_id',
69
+ 'terms' => $cat_id_array
70
+ ),
71
+ array(
72
+ 'taxonomy' => 'pwb-brand',
73
+ 'field' => 'term_id',
74
+ 'terms' => $brands_ids
75
+ )
76
+ )
77
+ );
78
+
79
+ $the_query = new \WP_Query($args);
80
+ if ( $the_query->have_posts() ) {
81
+ while ( $the_query->have_posts() ) {
82
+ $the_query->the_post();
83
+
84
+ $product_brands = wp_get_post_terms(get_the_ID(), 'pwb-brand');
85
+
86
+ foreach ($product_brands as $brand) {
87
+ $result_brands[] = $brand->term_id;
88
+ }
89
+
90
+ }
91
+ } else {
92
+ // no posts found
93
+ }
94
+ wp_reset_postdata();
95
+
96
+ $cate = get_queried_object();
97
+ $cateID = $cate->term_id;
98
+ $cate_url = get_term_link($cateID);
99
+
100
+ }else{
101
+ //no product category
102
+ $cate_url = get_permalink( woocommerce_get_page_id( 'shop' ));
103
+ shuffle($brands_ids);
104
+ $result_brands = array_slice($brands_ids, 0, 20);
105
+ }
106
+
107
+ global $wp;
108
+ $current_url = home_url(add_query_arg(array(),$wp->request));
109
+
110
+ echo '<div class="pwb-filter-products" data-cat-url="'.$cate_url.'">';
111
+ echo '<ul>';
112
+ foreach (array_unique($result_brands) as $brand) {
113
+ $term = get_term($brand);
114
+ echo '<li><input type="checkbox" data-brand="'.$brand.'" value="'.$term->slug.'">' . $term->name . '</li>';
115
+ }
116
+ echo '</ul>';
117
+ echo '<button>'.__('Apply filter','perfect-woocommerce-brands').'</button>';
118
+ echo '</div>';
119
+
120
+ }
121
+
122
+ }
classes/widgets/{class-pwb-list-widget.php → class-pwb-list.php} RENAMED
@@ -1,16 +1,16 @@
1
  <?php
2
- namespace Perfect_Woocommerce_Brands;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
6
- class Pwb_List_Widget extends \WP_Widget {
7
 
8
  function __construct(){
9
  $params = array(
10
  'description' => __( 'Adds a brands list to your site', 'perfect-woocommerce-brands' ),
11
  'name' => __( 'Brands list', 'perfect-woocommerce-brands' )
12
  );
13
- parent::__construct('Pwb_List_Widget', '', $params);
14
  }
15
 
16
  public function form($instance){
@@ -67,4 +67,4 @@
67
 
68
  }
69
 
70
- }
1
  <?php
2
+ namespace Perfect_Woocommerce_Brands\Widgets;
3
 
4
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
5
 
6
+ class PWB_List_Widget extends \WP_Widget {
7
 
8
  function __construct(){
9
  $params = array(
10
  'description' => __( 'Adds a brands list to your site', 'perfect-woocommerce-brands' ),
11
  'name' => __( 'Brands list', 'perfect-woocommerce-brands' )
12
  );
13
+ parent::__construct('PWB_List_Widget', '', $params);
14
  }
15
 
16
  public function form($instance){
67
 
68
  }
69
 
70
+ }
lang/perfect-woocommerce-brands-es_ES.mo CHANGED
Binary file
lang/perfect-woocommerce-brands-es_ES.po CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Perfect WooCommerce Brands\n"
4
- "POT-Creation-Date: 2016-08-16 18:23+0200\n"
5
- "PO-Revision-Date: 2016-08-16 18:24+0200\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: es_ES\n"
@@ -10,7 +10,7 @@ msgstr ""
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
- "X-Generator: Poedit 1.8.8\n"
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-WPHeader: main.php\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
@@ -20,233 +20,245 @@ msgstr ""
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPathExcluded-0: *.js\n"
22
 
23
- #: classes/class-perfect-woocommerce-brands.php:110
24
  msgid "PWB Product carousel"
25
  msgstr "PWB Carrusel de productos"
26
 
27
- #: classes/class-perfect-woocommerce-brands.php:111
28
  msgid "Product carousel by brand or by category"
29
  msgstr "Carrusel de productos por marca o categoría"
30
 
31
- #: classes/class-perfect-woocommerce-brands.php:119
32
- #: classes/class-perfect-woocommerce-brands.php:356
33
  msgid "Brand"
34
  msgstr "Marca"
35
 
36
- #: classes/class-perfect-woocommerce-brands.php:127
37
  msgid "Products"
38
  msgstr "Productos"
39
 
40
- #: classes/class-perfect-woocommerce-brands.php:130
41
  msgid "Number of products to load"
42
  msgstr "Número de productos que cargar"
43
 
44
- #: classes/class-perfect-woocommerce-brands.php:135
45
  msgid "Products to show"
46
  msgstr "Productos a mostrar"
47
 
48
- #: classes/class-perfect-woocommerce-brands.php:138
49
  msgid "Number of products to show"
50
  msgstr "Número de productos que mostrar"
51
 
52
- #: classes/class-perfect-woocommerce-brands.php:143
53
  msgid "Products to scroll"
54
  msgstr "Número de productos por scroll"
55
 
56
- #: classes/class-perfect-woocommerce-brands.php:146
57
  msgid "Number of products to scroll"
58
  msgstr "Número de productos por cada scroll"
59
 
60
- #: classes/class-perfect-woocommerce-brands.php:151
61
- #: classes/class-perfect-woocommerce-brands.php:195
62
  msgid "Autoplay"
63
  msgstr "Modo automático"
64
 
65
- #: classes/class-perfect-woocommerce-brands.php:153
66
- #: classes/class-perfect-woocommerce-brands.php:197
67
  msgid "Autoplay carousel"
68
  msgstr "Modo automático para el carrusel"
69
 
70
- #: classes/class-perfect-woocommerce-brands.php:161
71
  msgid "PWB Brands carousel"
72
  msgstr "PWB Carrusel de marcas"
73
 
74
- #: classes/class-perfect-woocommerce-brands.php:162
75
  msgid "Brands carousel"
76
  msgstr "Carrusel de marcas"
77
 
78
- #: classes/class-perfect-woocommerce-brands.php:171
79
  msgid "Items"
80
  msgstr "Elementos"
81
 
82
- #: classes/class-perfect-woocommerce-brands.php:174
83
  msgid "Number of items to load"
84
  msgstr "Número de elementos que cargar"
85
 
86
- #: classes/class-perfect-woocommerce-brands.php:179
87
  msgid "Items to show"
88
  msgstr "Elementos a mostrar"
89
 
90
- #: classes/class-perfect-woocommerce-brands.php:182
91
  msgid "Number of items to show"
92
  msgstr "Número de elementos a mostrar"
93
 
94
- #: classes/class-perfect-woocommerce-brands.php:187
95
  msgid "Items to scroll"
96
  msgstr "Número de elementos por scroll"
97
 
98
- #: classes/class-perfect-woocommerce-brands.php:190
99
  msgid "Number of items to scroll"
100
  msgstr "Número de elementos por cada scroll"
101
 
102
- #: classes/class-perfect-woocommerce-brands.php:201
103
- #: classes/class-perfect-woocommerce-brands.php:230
104
- #: classes/class-perfect-woocommerce-brands.php:259
105
  #: classes/class-pwb-admin-tab.php:85
106
  msgid "Brand logo size"
107
  msgstr "Tamaño del logo de la marca"
108
 
109
- #: classes/class-perfect-woocommerce-brands.php:212
110
  msgid "PWB All brands"
111
  msgstr "PWB Todas las marcas"
112
 
113
- #: classes/class-perfect-woocommerce-brands.php:213
114
  msgid "Show all brands"
115
  msgstr "Mostrar todas las marcas"
116
 
117
- #: classes/class-perfect-woocommerce-brands.php:223
118
  msgid "Brands per page"
119
  msgstr "Marcas por página"
120
 
121
- #: classes/class-perfect-woocommerce-brands.php:226
122
  msgid "Show x brands per page"
123
  msgstr "Mostrar x marcas por página"
124
 
125
- #: classes/class-perfect-woocommerce-brands.php:241
126
  msgid "PWB brand"
127
  msgstr "PWB Marca"
128
 
129
- #: classes/class-perfect-woocommerce-brands.php:242
130
  msgid "Show brand for a specific product"
131
  msgstr "Ver marcas de un producto específico"
132
 
133
- #: classes/class-perfect-woocommerce-brands.php:252
134
  msgid "Product id"
135
  msgstr "Id del producto"
136
 
137
- #: classes/class-perfect-woocommerce-brands.php:255
138
  msgid "Product id (post id)"
139
  msgstr "Id del producto (id del post)"
140
 
141
- #: classes/class-perfect-woocommerce-brands.php:289
142
- #: classes/class-perfect-woocommerce-brands.php:291
143
- #: classes/shortcodes/class-pwb-all-brands-shortcode.php:70
144
- #: classes/shortcodes/class-pwb-brand-shortcode.php:24
145
- #: classes/shortcodes/class-pwb-carousel-shortcode.php:42
 
146
  msgid "View brand"
147
  msgstr "Ver marca"
148
 
149
- #: classes/class-perfect-woocommerce-brands.php:355
150
- #: classes/class-perfect-woocommerce-brands.php:357
151
- #: classes/class-pwb-admin-tab.php:22
152
- #: classes/widgets/class-pwb-dropdown-widget.php:56
 
 
 
 
 
 
 
 
 
 
 
153
  msgid "Brands"
154
  msgstr "Marcas"
155
 
156
- #: classes/class-perfect-woocommerce-brands.php:358
157
  msgid "All Brands"
158
  msgstr "Todas las marcas"
159
 
160
- #: classes/class-perfect-woocommerce-brands.php:359
161
  msgid "Edit Brand"
162
  msgstr "Editar marca"
163
 
164
- #: classes/class-perfect-woocommerce-brands.php:360
165
  msgid "View Brand"
166
  msgstr "Ver marca"
167
 
168
- #: classes/class-perfect-woocommerce-brands.php:361
169
  msgid "Update Brand"
170
  msgstr "Actualizar marca"
171
 
172
- #: classes/class-perfect-woocommerce-brands.php:362
173
  msgid "Add New Brand"
174
  msgstr "Añadir nueva marca"
175
 
176
- #: classes/class-perfect-woocommerce-brands.php:363
177
  msgid "New Brand Name"
178
  msgstr "Nuevo nombre de marca"
179
 
180
- #: classes/class-perfect-woocommerce-brands.php:364
181
  msgid "Parent Brand"
182
  msgstr "Marca Padre"
183
 
184
- #: classes/class-perfect-woocommerce-brands.php:365
185
  msgid "Parent Brand:"
186
  msgstr "Marca Padre:"
187
 
188
- #: classes/class-perfect-woocommerce-brands.php:366
189
  msgid "Search Brands"
190
  msgstr "Buscar Marcas"
191
 
192
- #: classes/class-perfect-woocommerce-brands.php:367
193
  msgid "Popular Brands"
194
  msgstr "Marcas Populares"
195
 
196
- #: classes/class-perfect-woocommerce-brands.php:368
197
  msgid "Separate brands with commas"
198
  msgstr "Separar marcas con comas"
199
 
200
- #: classes/class-perfect-woocommerce-brands.php:369
201
  msgid "Add or remove brands"
202
  msgstr "Añadir o eliminar marcas"
203
 
204
- #: classes/class-perfect-woocommerce-brands.php:370
205
  msgid "Choose from the most used brands"
206
  msgstr "Seleccionar de las marcas más utilizadas"
207
 
208
- #: classes/class-perfect-woocommerce-brands.php:371
209
  msgid "No brands found"
210
  msgstr "No se han encontrado marcas"
211
 
212
- #: classes/class-perfect-woocommerce-brands.php:415
213
- #: classes/class-perfect-woocommerce-brands.php:448
214
  msgid "Brand logo"
215
  msgstr "Logo de la marca"
216
 
217
- #: classes/class-perfect-woocommerce-brands.php:417
218
- #: classes/class-perfect-woocommerce-brands.php:424
219
- #: classes/class-perfect-woocommerce-brands.php:452
220
- #: classes/class-perfect-woocommerce-brands.php:463
221
  msgid "Select image"
222
  msgstr "Seleccionar imagen"
223
 
224
- #: classes/class-perfect-woocommerce-brands.php:422
225
- #: classes/class-perfect-woocommerce-brands.php:459
226
  msgid "Brand banner"
227
  msgstr "Banner de la marca"
228
 
229
- #: classes/class-perfect-woocommerce-brands.php:425
230
  msgid "This image will be shown on brand page"
231
  msgstr "Esta imagen se mostrará en la página de la marca"
232
 
233
- #: classes/class-perfect-woocommerce-brands.php:430
234
- #: classes/class-perfect-woocommerce-brands.php:470
235
  msgid "Brand banner link"
236
  msgstr "Enlace para el banner de la marca"
237
 
238
- #: classes/class-perfect-woocommerce-brands.php:432
239
- #: classes/class-perfect-woocommerce-brands.php:474
240
  msgid "This link should be relative to site url. Example: product/product-name"
241
  msgstr ""
242
  "Este enlace ha de ser relativo a la url del sitio web. Ejemplo: producto/"
243
  "nombre-del-producto"
244
 
245
- #: classes/class-perfect-woocommerce-brands.php:532
246
  msgid "Logo"
247
  msgstr "Logo"
248
 
249
- #: classes/class-perfect-woocommerce-brands.php:622
250
  msgid "No products found"
251
  msgstr "No se han encontrado productos"
252
 
@@ -310,57 +322,113 @@ msgstr "Mostrar descripción de la marca"
310
  msgid "Show brand description (if is set) on brand archive page"
311
  msgstr "Mostrar descripción de la marca en la página de archivo"
312
 
313
- #: classes/shortcodes/class-pwb-all-brands-shortcode.php:83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
314
  msgid "First page"
315
  msgstr "Primera página"
316
 
317
- #: classes/shortcodes/class-pwb-all-brands-shortcode.php:86
318
  msgid "Previous page"
319
  msgstr "Página anterior"
320
 
321
- #: classes/shortcodes/class-pwb-all-brands-shortcode.php:90
322
  msgid "Next page"
323
  msgstr "Siguiente página"
324
 
325
- #: classes/shortcodes/class-pwb-all-brands-shortcode.php:93
326
  msgid "Last page"
327
  msgstr "Última página"
328
 
329
- #: classes/shortcodes/class-pwb-all-brands-shortcode.php:98
330
  msgid "No results"
331
  msgstr "No se han encontrado resultados"
332
 
333
- #: classes/widgets/class-pwb-dropdown-widget.php:10
334
  msgid "Adds a brands dropdown to your site"
335
  msgstr "Añade un desplegable con las marcas a tu sitio"
336
 
337
- #: classes/widgets/class-pwb-dropdown-widget.php:11
338
  msgid "Brands dropdown"
339
  msgstr "Desplegable de marcas"
340
 
341
- #: classes/widgets/class-pwb-dropdown-widget.php:21
342
- #: classes/widgets/class-pwb-list-widget.php:21
343
  msgid "Title"
344
  msgstr "Título"
345
 
346
- #: classes/widgets/class-pwb-dropdown-widget.php:64
347
- #: classes/widgets/class-pwb-list-widget.php:65
348
  msgid "There is not available brands"
349
  msgstr "No se encuentran marcas disponibles"
350
 
351
- #: classes/widgets/class-pwb-list-widget.php:10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
  msgid "Adds a brands list to your site"
353
  msgstr "Añade una lista de marcas a tu sitio"
354
 
355
- #: classes/widgets/class-pwb-list-widget.php:11
356
  msgid "Brands list"
357
  msgstr "Lista de marcas"
358
 
359
- #: classes/widgets/class-pwb-list-widget.php:60
360
  msgid "Go to"
361
  msgstr "Ir a"
362
 
363
- #: main.php:55
364
  msgid ""
365
  "Perfect WooCommerce Brands needs WooCommerce to run. Please, install and "
366
  "active WooCommerce plugin."
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Perfect WooCommerce Brands\n"
4
+ "POT-Creation-Date: 2016-11-26 19:26+0100\n"
5
+ "PO-Revision-Date: 2016-11-26 19:26+0100\n"
6
  "Last-Translator: \n"
7
  "Language-Team: \n"
8
  "Language: es_ES\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
13
+ "X-Generator: Poedit 1.8.11\n"
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-WPHeader: main.php\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPathExcluded-0: *.js\n"
22
 
23
+ #: classes/class-perfect-woocommerce-brands.php:261
24
  msgid "PWB Product carousel"
25
  msgstr "PWB Carrusel de productos"
26
 
27
+ #: classes/class-perfect-woocommerce-brands.php:262
28
  msgid "Product carousel by brand or by category"
29
  msgstr "Carrusel de productos por marca o categoría"
30
 
31
+ #: classes/class-perfect-woocommerce-brands.php:270
32
+ #: classes/class-perfect-woocommerce-brands.php:519
33
  msgid "Brand"
34
  msgstr "Marca"
35
 
36
+ #: classes/class-perfect-woocommerce-brands.php:278
37
  msgid "Products"
38
  msgstr "Productos"
39
 
40
+ #: classes/class-perfect-woocommerce-brands.php:281
41
  msgid "Number of products to load"
42
  msgstr "Número de productos que cargar"
43
 
44
+ #: classes/class-perfect-woocommerce-brands.php:286
45
  msgid "Products to show"
46
  msgstr "Productos a mostrar"
47
 
48
+ #: classes/class-perfect-woocommerce-brands.php:289
49
  msgid "Number of products to show"
50
  msgstr "Número de productos que mostrar"
51
 
52
+ #: classes/class-perfect-woocommerce-brands.php:294
53
  msgid "Products to scroll"
54
  msgstr "Número de productos por scroll"
55
 
56
+ #: classes/class-perfect-woocommerce-brands.php:297
57
  msgid "Number of products to scroll"
58
  msgstr "Número de productos por cada scroll"
59
 
60
+ #: classes/class-perfect-woocommerce-brands.php:302
61
+ #: classes/class-perfect-woocommerce-brands.php:346
62
  msgid "Autoplay"
63
  msgstr "Modo automático"
64
 
65
+ #: classes/class-perfect-woocommerce-brands.php:304
66
+ #: classes/class-perfect-woocommerce-brands.php:348
67
  msgid "Autoplay carousel"
68
  msgstr "Modo automático para el carrusel"
69
 
70
+ #: classes/class-perfect-woocommerce-brands.php:312
71
  msgid "PWB Brands carousel"
72
  msgstr "PWB Carrusel de marcas"
73
 
74
+ #: classes/class-perfect-woocommerce-brands.php:313
75
  msgid "Brands carousel"
76
  msgstr "Carrusel de marcas"
77
 
78
+ #: classes/class-perfect-woocommerce-brands.php:322
79
  msgid "Items"
80
  msgstr "Elementos"
81
 
82
+ #: classes/class-perfect-woocommerce-brands.php:325
83
  msgid "Number of items to load"
84
  msgstr "Número de elementos que cargar"
85
 
86
+ #: classes/class-perfect-woocommerce-brands.php:330
87
  msgid "Items to show"
88
  msgstr "Elementos a mostrar"
89
 
90
+ #: classes/class-perfect-woocommerce-brands.php:333
91
  msgid "Number of items to show"
92
  msgstr "Número de elementos a mostrar"
93
 
94
+ #: classes/class-perfect-woocommerce-brands.php:338
95
  msgid "Items to scroll"
96
  msgstr "Número de elementos por scroll"
97
 
98
+ #: classes/class-perfect-woocommerce-brands.php:341
99
  msgid "Number of items to scroll"
100
  msgstr "Número de elementos por cada scroll"
101
 
102
+ #: classes/class-perfect-woocommerce-brands.php:352
103
+ #: classes/class-perfect-woocommerce-brands.php:381
104
+ #: classes/class-perfect-woocommerce-brands.php:410
105
  #: classes/class-pwb-admin-tab.php:85
106
  msgid "Brand logo size"
107
  msgstr "Tamaño del logo de la marca"
108
 
109
+ #: classes/class-perfect-woocommerce-brands.php:363
110
  msgid "PWB All brands"
111
  msgstr "PWB Todas las marcas"
112
 
113
+ #: classes/class-perfect-woocommerce-brands.php:364
114
  msgid "Show all brands"
115
  msgstr "Mostrar todas las marcas"
116
 
117
+ #: classes/class-perfect-woocommerce-brands.php:374
118
  msgid "Brands per page"
119
  msgstr "Marcas por página"
120
 
121
+ #: classes/class-perfect-woocommerce-brands.php:377
122
  msgid "Show x brands per page"
123
  msgstr "Mostrar x marcas por página"
124
 
125
+ #: classes/class-perfect-woocommerce-brands.php:392
126
  msgid "PWB brand"
127
  msgstr "PWB Marca"
128
 
129
+ #: classes/class-perfect-woocommerce-brands.php:393
130
  msgid "Show brand for a specific product"
131
  msgstr "Ver marcas de un producto específico"
132
 
133
+ #: classes/class-perfect-woocommerce-brands.php:403
134
  msgid "Product id"
135
  msgstr "Id del producto"
136
 
137
+ #: classes/class-perfect-woocommerce-brands.php:406
138
  msgid "Product id (post id)"
139
  msgstr "Id del producto (id del post)"
140
 
141
+ #: classes/class-perfect-woocommerce-brands.php:440
142
+ #: classes/class-perfect-woocommerce-brands.php:442
143
+ #: classes/shortcodes/class-pwb-all-brands.php:70
144
+ #: classes/shortcodes/class-pwb-brand.php:29
145
+ #: classes/shortcodes/class-pwb-brand.php:31
146
+ #: classes/shortcodes/class-pwb-carousel.php:42
147
  msgid "View brand"
148
  msgstr "Ver marca"
149
 
150
+ #: classes/class-perfect-woocommerce-brands.php:506
151
+ msgid "¿Start migration?"
152
+ msgstr "¿Comenzar la migración?"
153
+
154
+ #: classes/class-perfect-woocommerce-brands.php:507
155
+ msgid ""
156
+ "We are migrating the product brands. ¡Don´t close this window until the "
157
+ "process is finished!"
158
+ msgstr ""
159
+ "Estamos migrando las marcas de producto. ¡No cierres esta ventana hasta que "
160
+ "el proceso finalice!"
161
+
162
+ #: classes/class-perfect-woocommerce-brands.php:518
163
+ #: classes/class-perfect-woocommerce-brands.php:520
164
+ #: classes/class-pwb-admin-tab.php:21 classes/widgets/class-pwb-dropdown.php:56
165
  msgid "Brands"
166
  msgstr "Marcas"
167
 
168
+ #: classes/class-perfect-woocommerce-brands.php:521
169
  msgid "All Brands"
170
  msgstr "Todas las marcas"
171
 
172
+ #: classes/class-perfect-woocommerce-brands.php:522
173
  msgid "Edit Brand"
174
  msgstr "Editar marca"
175
 
176
+ #: classes/class-perfect-woocommerce-brands.php:523
177
  msgid "View Brand"
178
  msgstr "Ver marca"
179
 
180
+ #: classes/class-perfect-woocommerce-brands.php:524
181
  msgid "Update Brand"
182
  msgstr "Actualizar marca"
183
 
184
+ #: classes/class-perfect-woocommerce-brands.php:525
185
  msgid "Add New Brand"
186
  msgstr "Añadir nueva marca"
187
 
188
+ #: classes/class-perfect-woocommerce-brands.php:526
189
  msgid "New Brand Name"
190
  msgstr "Nuevo nombre de marca"
191
 
192
+ #: classes/class-perfect-woocommerce-brands.php:527
193
  msgid "Parent Brand"
194
  msgstr "Marca Padre"
195
 
196
+ #: classes/class-perfect-woocommerce-brands.php:528
197
  msgid "Parent Brand:"
198
  msgstr "Marca Padre:"
199
 
200
+ #: classes/class-perfect-woocommerce-brands.php:529
201
  msgid "Search Brands"
202
  msgstr "Buscar Marcas"
203
 
204
+ #: classes/class-perfect-woocommerce-brands.php:530
205
  msgid "Popular Brands"
206
  msgstr "Marcas Populares"
207
 
208
+ #: classes/class-perfect-woocommerce-brands.php:531
209
  msgid "Separate brands with commas"
210
  msgstr "Separar marcas con comas"
211
 
212
+ #: classes/class-perfect-woocommerce-brands.php:532
213
  msgid "Add or remove brands"
214
  msgstr "Añadir o eliminar marcas"
215
 
216
+ #: classes/class-perfect-woocommerce-brands.php:533
217
  msgid "Choose from the most used brands"
218
  msgstr "Seleccionar de las marcas más utilizadas"
219
 
220
+ #: classes/class-perfect-woocommerce-brands.php:534
221
  msgid "No brands found"
222
  msgstr "No se han encontrado marcas"
223
 
224
+ #: classes/class-perfect-woocommerce-brands.php:578
225
+ #: classes/class-perfect-woocommerce-brands.php:611
226
  msgid "Brand logo"
227
  msgstr "Logo de la marca"
228
 
229
+ #: classes/class-perfect-woocommerce-brands.php:580
230
+ #: classes/class-perfect-woocommerce-brands.php:587
231
+ #: classes/class-perfect-woocommerce-brands.php:615
232
+ #: classes/class-perfect-woocommerce-brands.php:626
233
  msgid "Select image"
234
  msgstr "Seleccionar imagen"
235
 
236
+ #: classes/class-perfect-woocommerce-brands.php:585
237
+ #: classes/class-perfect-woocommerce-brands.php:622
238
  msgid "Brand banner"
239
  msgstr "Banner de la marca"
240
 
241
+ #: classes/class-perfect-woocommerce-brands.php:588
242
  msgid "This image will be shown on brand page"
243
  msgstr "Esta imagen se mostrará en la página de la marca"
244
 
245
+ #: classes/class-perfect-woocommerce-brands.php:593
246
+ #: classes/class-perfect-woocommerce-brands.php:633
247
  msgid "Brand banner link"
248
  msgstr "Enlace para el banner de la marca"
249
 
250
+ #: classes/class-perfect-woocommerce-brands.php:595
251
+ #: classes/class-perfect-woocommerce-brands.php:637
252
  msgid "This link should be relative to site url. Example: product/product-name"
253
  msgstr ""
254
  "Este enlace ha de ser relativo a la url del sitio web. Ejemplo: producto/"
255
  "nombre-del-producto"
256
 
257
+ #: classes/class-perfect-woocommerce-brands.php:695
258
  msgid "Logo"
259
  msgstr "Logo"
260
 
261
+ #: classes/class-perfect-woocommerce-brands.php:785
262
  msgid "No products found"
263
  msgstr "No se han encontrado productos"
264
 
322
  msgid "Show brand description (if is set) on brand archive page"
323
  msgstr "Mostrar descripción de la marca en la página de archivo"
324
 
325
+ #: classes/class-pwb-admin-tab.php:114
326
+ msgid "Show brands in loop"
327
+ msgstr "Mostrar marcas en el loop"
328
+
329
+ #: classes/class-pwb-admin-tab.php:116
330
+ msgid "Show brand logo (or name) in product loop"
331
+ msgstr "Mostrar el logo de la marca (o el nombre) en el loop"
332
+
333
+ #: classes/class-pwb-admin-tab.php:119
334
+ msgid "No"
335
+ msgstr "No"
336
+
337
+ #: classes/class-pwb-admin-tab.php:120
338
+ msgid "Show brand link"
339
+ msgstr "Mostrar el link de la marca"
340
+
341
+ #: classes/class-pwb-admin-tab.php:121
342
+ msgid "Show brand image (if is set)"
343
+ msgstr "Mostrar el logo de la marca (si tiene uno asignado)"
344
+
345
+ #: classes/class-pwb-admin-tab.php:138
346
+ msgid "Tools"
347
+ msgstr "Herramientas"
348
+
349
+ #: classes/class-pwb-admin-tab.php:144
350
+ msgid "Import brands"
351
+ msgstr "Importar marcas"
352
+
353
+ #: classes/class-pwb-admin-tab.php:146
354
+ msgid "Import brands from old plugin installation"
355
+ msgstr "Importar marcas de otro plugin"
356
+
357
+ #: classes/class-pwb-admin-tab.php:149
358
+ msgid "-"
359
+ msgstr "-"
360
+
361
+ #: classes/class-pwb-admin-tab.php:150
362
+ msgid "YITH WooCommerce Brands Add-On"
363
+ msgstr "YITH WooCommerce Brands Add-On"
364
+
365
+ #: classes/shortcodes/class-pwb-all-brands.php:83
366
  msgid "First page"
367
  msgstr "Primera página"
368
 
369
+ #: classes/shortcodes/class-pwb-all-brands.php:86
370
  msgid "Previous page"
371
  msgstr "Página anterior"
372
 
373
+ #: classes/shortcodes/class-pwb-all-brands.php:90
374
  msgid "Next page"
375
  msgstr "Siguiente página"
376
 
377
+ #: classes/shortcodes/class-pwb-all-brands.php:93
378
  msgid "Last page"
379
  msgstr "Última página"
380
 
381
+ #: classes/shortcodes/class-pwb-all-brands.php:98
382
  msgid "No results"
383
  msgstr "No se han encontrado resultados"
384
 
385
+ #: classes/widgets/class-pwb-dropdown.php:10
386
  msgid "Adds a brands dropdown to your site"
387
  msgstr "Añade un desplegable con las marcas a tu sitio"
388
 
389
+ #: classes/widgets/class-pwb-dropdown.php:11
390
  msgid "Brands dropdown"
391
  msgstr "Desplegable de marcas"
392
 
393
+ #: classes/widgets/class-pwb-dropdown.php:21
394
+ #: classes/widgets/class-pwb-list.php:21
395
  msgid "Title"
396
  msgstr "Título"
397
 
398
+ #: classes/widgets/class-pwb-dropdown.php:64
399
+ #: classes/widgets/class-pwb-list.php:65
400
  msgid "There is not available brands"
401
  msgstr "No se encuentran marcas disponibles"
402
 
403
+ #: classes/widgets/class-pwb-filter-by-brand.php:10
404
+ msgid "Recommended for product categories or shop page"
405
+ msgstr "Recomendado para las categorías de producto y la página de la tienda"
406
+
407
+ #: classes/widgets/class-pwb-filter-by-brand.php:11
408
+ msgid "Filter products by brand"
409
+ msgstr "Filtrar productos por marca"
410
+
411
+ #: classes/widgets/class-pwb-filter-by-brand.php:24
412
+ msgid "Title:"
413
+ msgstr "Título:"
414
+
415
+ #: classes/widgets/class-pwb-filter-by-brand.php:117
416
+ msgid "Apply filter"
417
+ msgstr "Filtrar"
418
+
419
+ #: classes/widgets/class-pwb-list.php:10
420
  msgid "Adds a brands list to your site"
421
  msgstr "Añade una lista de marcas a tu sitio"
422
 
423
+ #: classes/widgets/class-pwb-list.php:11
424
  msgid "Brands list"
425
  msgstr "Lista de marcas"
426
 
427
+ #: classes/widgets/class-pwb-list.php:60
428
  msgid "Go to"
429
  msgstr "Ir a"
430
 
431
+ #: main.php:67
432
  msgid ""
433
  "Perfect WooCommerce Brands needs WooCommerce to run. Please, install and "
434
  "active WooCommerce plugin."
main.php CHANGED
@@ -3,14 +3,14 @@
3
  Plugin Name: Perfect WooCommerce Brands
4
  Plugin URI: https://wordpress.org/plugins/perfect-woocommerce-brands/
5
  Description: Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store.
6
- Version: 1.4.2
7
  Author: Alberto de Vera Sevilla
8
  Author URI: https://profiles.wordpress.org/titodevera/
9
  Text Domain: perfect-woocommerce-brands
10
  Domain Path: /lang
11
  License: GPL3
12
 
13
- Perfect WooCommerce Brands version 1.4.2, Copyright (C) 2016 Alberto de Vera Sevilla
14
 
15
  Perfect WooCommerce Brands is free software: you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License as published by
@@ -31,29 +31,41 @@ namespace Perfect_Woocommerce_Brands;
31
 
32
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
33
 
34
- register_deactivation_hook( __FILE__, function(){update_option( 'old_wc_pwb_admin_tab_slug', 'null' );} );
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
37
- if(is_plugin_active('woocommerce/woocommerce.php')){
38
-
39
- define('PWB_PLUGIN', plugins_url( '', __FILE__ ));
40
- define('PWB_PLUGIN_PATH', plugin_basename( dirname( __FILE__ ) ));
41
- define('PWB_PLUGIN_VERSION', '1.4.2');
42
- require 'classes/widgets/class-pwb-dropdown-widget.php';
43
- require 'classes/widgets/class-pwb-list-widget.php';
44
- require 'classes/shortcodes/class-pwb-product-carousel-shortcode.php';
45
- require 'classes/shortcodes/class-pwb-carousel-shortcode.php';
46
- require 'classes/shortcodes/class-pwb-all-brands-shortcode.php';
47
- require 'classes/shortcodes/class-pwb-brand-shortcode.php';
48
- require 'classes/class-perfect-woocommerce-brands.php';
49
- new \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands();
50
- require 'classes/class-pwb-admin-tab.php';
51
-
52
- }elseif(is_admin()){
53
-
54
- add_action( 'admin_notices', function() {
55
- $message = __( 'Perfect WooCommerce Brands needs WooCommerce to run. Please, install and active WooCommerce plugin.', 'perfect-woocommerce-brands' );
56
- printf( '<div class="%1$s"><p>%2$s</p></div>', 'notice notice-error', $message );
57
- });
58
 
59
  }
3
  Plugin Name: Perfect WooCommerce Brands
4
  Plugin URI: https://wordpress.org/plugins/perfect-woocommerce-brands/
5
  Description: Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store.
6
+ Version: 1.4.3
7
  Author: Alberto de Vera Sevilla
8
  Author URI: https://profiles.wordpress.org/titodevera/
9
  Text Domain: perfect-woocommerce-brands
10
  Domain Path: /lang
11
  License: GPL3
12
 
13
+ Perfect WooCommerce Brands version 1.4.3, Copyright (C) 2016 Alberto de Vera Sevilla
14
 
15
  Perfect WooCommerce Brands is free software: you can redistribute it and/or modify
16
  it under the terms of the GNU General Public License as published by
31
 
32
  defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
33
 
34
+ //plugin constants
35
+ define('PWB_PLUGIN', plugins_url( '', __FILE__ ));
36
+ define('PWB_PLUGIN_PATH', plugin_basename( dirname( __FILE__ ) ));
37
+ define('PWB_PLUGIN_VERSION', '1.4.3');
38
+
39
+ //clean brands slug on plugin deactivation
40
+ register_deactivation_hook( __FILE__, function(){
41
+ update_option( 'old_wc_pwb_admin_tab_slug', 'null' );
42
+ } );
43
+
44
+ //loads textdomain for the translations
45
+ add_action( 'plugins_loaded', function(){
46
+ load_plugin_textdomain( 'perfect-woocommerce-brands', false, PWB_PLUGIN_PATH . '/lang' );
47
+ } );
48
 
49
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
50
+ if( is_plugin_active( 'woocommerce/woocommerce.php' ) ){
51
+
52
+ require 'classes/widgets/class-pwb-dropdown.php';
53
+ require 'classes/widgets/class-pwb-list.php';
54
+ require 'classes/widgets/class-pwb-filter-by-brand.php';
55
+ require 'classes/shortcodes/class-pwb-product-carousel.php';
56
+ require 'classes/shortcodes/class-pwb-carousel.php';
57
+ require 'classes/shortcodes/class-pwb-all-brands.php';
58
+ require 'classes/shortcodes/class-pwb-brand.php';
59
+ require 'classes/class-perfect-woocommerce-brands.php';
60
+ require 'classes/class-pwb-admin-tab.php';
61
+
62
+ new \Perfect_Woocommerce_Brands\Perfect_Woocommerce_Brands();
63
+
64
+ }elseif( is_admin() ){
65
+
66
+ add_action( 'admin_notices', function() {
67
+ $message = __( 'Perfect WooCommerce Brands needs WooCommerce to run. Please, install and active WooCommerce plugin.', 'perfect-woocommerce-brands' );
68
+ printf( '<div class="%1$s"><p>%2$s</p></div>', 'notice notice-error', $message );
69
+ });
 
70
 
71
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: titodevera
3
  Donate link: mailto:albertodeverasevilla@gmail.com
4
  Tags: woocommerce, brands, brand taxonomy, product brands, woocommerce manufacturer, woocommerce supplier, e-commerce
5
  Requires at least: 4.4
6
- Tested up to: 4.5.3
7
- Stable tag: 1.4.2
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.en.html
10
 
@@ -33,9 +33,12 @@ With this extension you can add product brands to your WooCommerce site.
33
  > * Visual Composer support
34
  > * Widget: Display brands as dropdown
35
  > * Widget: Display brands as list
 
 
36
  > * Minimalist design and fully responsive
37
  > * Very lightweight
38
  > * Customizable brands slug
 
39
 
40
 
41
  == Installation ==
@@ -51,11 +54,11 @@ Yes, of course. This plugin is 100% free. No ads, no premium version exists.
51
  Go to `WooCommerce/Settings/` and click on `Brands` tab
52
 
53
  = How can i use the available shortcodes without Visual Composer? =
54
- There are three shortcodes available:
55
  > * Display all brands: [pwb-all-brands per_page="10" image_size="thumbnail"]
56
- > * Display brands carousel: [pwb-carousel items="10" items_to_show="5" items_to_scroll="1" image_size="thumbnail" autoplay="true"]
 
57
  > * Display brands for a specific product: [pwb-brand product_id="5" image_size="thumbnail"]
58
- > * Display product carousel by brand: [pwb-product-carousel brand="all" products="10" products_to_show="4" products_to_scroll="2" image_size="" items_to_show="2" autoplay="true"]
59
 
60
 
61
  == Screenshots ==
@@ -66,6 +69,11 @@ There are three shortcodes available:
66
 
67
 
68
  == Changelog ==
 
 
 
 
 
69
  = 1.4.2 =
70
  * Fix: Table collapses in "Admin > Products > Brands" (thanks eljkmw)
71
  * Fix: "pwb-brand" shortcode does not display the brand when it has not a logo assigned
3
  Donate link: mailto:albertodeverasevilla@gmail.com
4
  Tags: woocommerce, brands, brand taxonomy, product brands, woocommerce manufacturer, woocommerce supplier, e-commerce
5
  Requires at least: 4.4
6
+ Tested up to: 4.6.1
7
+ Stable tag: 1.4.3
8
  License: GPL3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.en.html
10
 
33
  > * Visual Composer support
34
  > * Widget: Display brands as dropdown
35
  > * Widget: Display brands as list
36
+ > * Widget: Filter products by brand **NEW!**
37
+ > * Import brands from other brands plugins **NEW!**
38
  > * Minimalist design and fully responsive
39
  > * Very lightweight
40
  > * Customizable brands slug
41
+ > * And much more!
42
 
43
 
44
  == Installation ==
54
  Go to `WooCommerce/Settings/` and click on `Brands` tab
55
 
56
  = How can i use the available shortcodes without Visual Composer? =
57
+ There are four shortcodes available:
58
  > * Display all brands: [pwb-all-brands per_page="10" image_size="thumbnail"]
59
+ > * Display brands carousel: [pwb-carousel items="10" items_to_show="5" items_to_scroll="1" image_size="thumbnail" autoplay="true"]
60
+ > * Display product carousel by brand: [pwb-product-carousel brand="all" products="10" products_to_show="4" products_to_scroll="2" image_size="" items_to_show="2" autoplay="true"]
61
  > * Display brands for a specific product: [pwb-brand product_id="5" image_size="thumbnail"]
 
62
 
63
 
64
  == Screenshots ==
69
 
70
 
71
  == Changelog ==
72
+ = 1.4.3 =
73
+ * Feature (Widget): Filter products by brand
74
+ * Feature (Option): Show brand logo in product loop
75
+ * Feature: Brand microdata added to product page
76
+ * Feature (Tool): Migrate brands from "YITH WooCommerce Brands Add-on"
77
  = 1.4.2 =
78
  * Fix: Table collapses in "Admin > Products > Brands" (thanks eljkmw)
79
  * Fix: "pwb-brand" shortcode does not display the brand when it has not a logo assigned