Plugin Directory

Changeset 2228017


Ignore:
Timestamp:
01/15/2020 07:48:58 PM (6 years ago)
Author:
titodevera
Message:

Update version to 1.7.8

Location:
perfect-woocommerce-brands
Files:
91 added
12 edited

Legend:

Unmodified
Added
Removed
  • perfect-woocommerce-brands/trunk/assets/css/styles-frontend.css

    r2176402 r2228017  
    2020  margin: 0 auto;
    2121}
    22 .pwb-carousel .slick-loading .slick-list, .pwb-product-carousel .slick-loading .slick-list{
    23     background: #fff url('./ajax-loader.gif') center center no-repeat;
    24 }
    2522.pwb-carousel .pwb-slick-slide, .pwb-product-carousel .pwb-slick-slide{
    26     margin: 0 10px;
     23  margin: 0 10px;
    2724}
    2825.pwb-carousel .slick-prev, .pwb-carousel .slick-next,
    2926.pwb-product-carousel .slick-prev, .pwb-product-carousel .slick-next{
    30     font-size: 0;
    31     position: absolute;
    32     top: 0;
    33     bottom: 0;
    34     display: block;
    35     cursor: pointer;
    36     font-size: 22px;
    37     width: 30px;
    38     overflow: hidden;
    39     text-align: center;
    40     color: #aeaeae;
    41     border: none;
    42     outline: none;
    43     z-index: 999;
    44     background: #eee;
    45     opacity: 0;
    46     transition: opacity 0.3s ease-in-out;
    47     -webkit-transition: opacity 0.3s ease-in-out;
    48     -moz-transition: opacity 0.3s ease-in-out;
    49     -o-transition: opacity 0.3s ease-in-out;
     27  font-size: 0;
     28  position: absolute;
     29  top: 0;
     30  bottom: 0;
     31  display: block;
     32  cursor: pointer;
     33  font-size: 22px;
     34  width: 30px;
     35  overflow: hidden;
     36  text-align: center;
     37  color: #aeaeae;
     38  border: none;
     39  outline: none;
     40  z-index: 999;
     41  background: #eee;
     42  opacity: 0;
     43  transition: opacity 0.3s ease-in-out;
     44  -webkit-transition: opacity 0.3s ease-in-out;
     45  -moz-transition: opacity 0.3s ease-in-out;
     46  -o-transition: opacity 0.3s ease-in-out;
    5047}
    5148.pwb-carousel .slick-prev > span, .pwb-carousel .slick-next > span,
    5249.pwb-product-carousel .slick-prev > span, .pwb-product-carousel .slick-next > span{
    53     display: inline-block;
    54     height: 20px;
    55     width: 20px;
    56     padding: 10px;
    57     position: absolute;
    58     top: 50%;
    59     margin-top: -20px;
    60     left: 0;
    61     right: 0;
     50  display: inline-block;
     51  height: 20px;
     52  width: 20px;
     53  padding: 10px;
     54  position: absolute;
     55  top: 50%;
     56  margin-top: -20px;
     57  left: 0;
     58  right: 0;
    6259}
    6360.pwb-carousel .slick-prev:hover,
     
    6966.pwb-product-carousel .slick-next:hover,
    7067.pwb-product-carousel .slick-next:focus{
    71     outline: none;
     68  outline: none;
    7269}
    7370.pwb-carousel .slick-prev, .pwb-product-carousel .slick-prev{
    74     left: 0;
     71  left: 0;
    7572}
    7673.pwb-carousel .slick-next, .pwb-product-carousel .slick-next{
    77     right: 0;
     74  right: 0;
    7875}
    7976.pwb-carousel:hover .slick-next,.pwb-carousel:hover .slick-prev,
    8077.pwb-product-carousel:hover .slick-next,.pwb-product-carousel:hover .slick-prev{
    81     opacity: 0.8;
     78  opacity: 0.8;
    8279}
    8380.pwb-product-carousel .pwb-amount{
     
    191188}
    192189.pwb-all-brands .pwb-pagination-wrapper{
    193     margin-top: 20px;
    194     padding-top: 10px;
    195     border-top: 1px solid #ededed;
    196     text-align: right;
     190  margin-top: 20px;
     191  padding-top: 10px;
     192  border-top: 1px solid #ededed;
     193  text-align: right;
    197194}
    198195.pwb-all-brands .pwb-pagination{
    199     display: inline-block;
    200     margin-right: 10px;
    201     background-color: #ededed;
    202     color: #333;
    203     text-align: center;
    204     padding: 10px;
     196  display: inline-block;
     197  margin-right: 10px;
     198  background-color: #ededed;
     199  color: #333;
     200  text-align: center;
     201  padding: 10px;
    205202}
    206203.pwb-all-brands .pwb-brands-cols-outer:after{
    207     content: "";
    208     display: table;
    209     clear: both;
     204  content: "";
     205  display: table;
     206  clear: both;
    210207}
    211208.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
    212     padding: 0 15px;
    213     width: 20%;
    214     float: left;
     209  padding: 0 15px;
     210  width: 20%;
     211  float: left;
    215212}
    216213.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
    217     height: 25px;
    218     overflow: hidden;
    219     font-size: 14px;
     214  height: 25px;
     215  overflow: hidden;
     216  font-size: 14px;
    220217}
    221218/* ----------------------- /PWB All Brands ----------------------- */
     
    315312/* ----------------------- Responsive ----------------------- */
    316313@media screen and (max-width: 1000px) {
    317     .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
    318         width: 25%;
    319     }
     314  .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
     315    width: 25%;
     316  }
    320317}
    321318@media screen and (max-width: 700px) {
    322     .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
    323         width: 50%;
    324     }
    325     .pwb-columns-5, .pwb-columns-6{
    326       width: 25%;
    327     }
     319  .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
     320    width: 50%;
     321  }
     322  .pwb-columns-5, .pwb-columns-6{
     323    width: 25%;
     324  }
    328325}
    329326@media screen and (max-width: 480px) {
    330     .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
    331         width: 100%;
    332         float: none;
    333     }
    334     .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
    335         height: auto;
    336     }
    337     .pwb-columns-3, .pwb-columns-4, .pwb-columns-5, .pwb-columns-6{
    338       width: 50%;
    339     }
     327  .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{
     328    width: 100%;
     329    float: none;
     330  }
     331  .pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3 > p:first-child{
     332    height: auto;
     333  }
     334  .pwb-columns-3, .pwb-columns-4, .pwb-columns-5, .pwb-columns-6{
     335    width: 50%;
     336  }
    340337}
    341338
  • perfect-woocommerce-brands/trunk/assets/css/styles-frontend.min.css

    r2176402 r2228017  
    1 .pwb-clearfix:after{content:"";display:table;clear:both}.pwb-before-loop{margin-bottom:1em}.pwb-after-loop{margin-top:1em}.pwb-carousel .pwb-slick-slide a{display:block}.pwb-carousel .pwb-slick-slide a>img{margin:0 auto}.pwb-carousel .slick-loading .slick-list,.pwb-product-carousel .slick-loading .slick-list{background:#fff url('./ajax-loader.gif') center center no-repeat}.pwb-carousel .pwb-slick-slide,.pwb-product-carousel .pwb-slick-slide{margin:0 10px}.pwb-carousel .slick-prev,.pwb-carousel .slick-next,.pwb-product-carousel .slick-prev,.pwb-product-carousel .slick-next{font-size:0;position:absolute;top:0;bottom:0;display:block;cursor:pointer;font-size:22px;width:30px;overflow:hidden;text-align:center;color:#aeaeae;border:0;outline:0;z-index:999;background:#eee;opacity:0;transition:opacity .3s ease-in-out;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out}.pwb-carousel .slick-prev>span,.pwb-carousel .slick-next>span,.pwb-product-carousel .slick-prev>span,.pwb-product-carousel .slick-next>span{display:inline-block;height:20px;width:20px;padding:10px;position:absolute;top:50%;margin-top:-20px;left:0;right:0}.pwb-carousel .slick-prev:hover,.pwb-carousel .slick-prev:focus,.pwb-carousel .slick-next:hover,.pwb-carousel .slick-next:focus,.pwb-product-carousel .slick-prev:hover,.pwb-product-carousel .slick-prev:focus,.pwb-product-carousel .slick-next:hover,.pwb-product-carousel .slick-next:focus{outline:0}.pwb-carousel .slick-prev,.pwb-product-carousel .slick-prev{left:0}.pwb-carousel .slick-next,.pwb-product-carousel .slick-next{right:0}.pwb-carousel:hover .slick-next,.pwb-carousel:hover .slick-prev,.pwb-product-carousel:hover .slick-next,.pwb-product-carousel:hover .slick-prev{opacity:.8}.pwb-product-carousel .pwb-amount{display:block;width:100%;margin-bottom:12px}.pwb-carousel,.pwb-product-carousel{min-height:30px}.pwb-carousel .pwb-slick-slide,.pwb-product-carousel .pwb-slick-slide{display:none}.pwb-carousel.slick-initialized .pwb-slick-slide,.pwb-product-carousel.slick-initialized .pwb-slick-slide{display:block}.pwb-carousel .slick-list,.pwb-product-carousel .slick-list{opacity:0;position:absolute}.pwb-carousel.slick-initialized,.pwb-product-carousel.slick-initialized{min-height:none}.pwb-carousel.slick-initialized .slick-list,.pwb-product-carousel.slick-initialized .slick-list{opacity:1;position:relative;transition:opacity .2s ease-in}.pwb-carousel.slick-initialized .pwb-carousel-loader,.pwb-product-carousel.slick-initialized .pwb-carousel-loader{display:none!important;opacity:0!important}.pwb-carousel-loader{font-size:10px;margin:50px auto;text-indent:-9999em;width:30px;height:30px;border-radius:50%;background:#525252;background:-moz-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:-webkit-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:-o-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:-ms-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:linear-gradient(to right,#525252 10%,rgba(82,82,82,0) 42%);position:relative;-webkit-animation:PWBCarouselLoader 1.4s infinite linear;animation:PWBCarouselLoader 1.4s infinite linear;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}.pwb-carousel-loader:before{width:50%;height:50%;background:#525252;border-radius:100% 0 0 0;position:absolute;top:0;left:0;content:''}.pwb-carousel-loader:after{background:#fff;width:75%;height:75%;border-radius:50%;content:'';margin:auto;position:absolute;top:0;left:0;bottom:0;right:0}@-webkit-keyframes PWBCarouselLoader{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes PWBCarouselLoader{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.pwb-brands-cols-outer{margin-left:-15px;margin-right:-15px}.pwb-all-brands .pwb-pagination-wrapper{margin-top:20px;padding-top:10px;border-top:1px solid #ededed;text-align:right}.pwb-all-brands .pwb-pagination{display:inline-block;margin-right:10px;background-color:#ededed;color:#333;text-align:center;padding:10px}.pwb-all-brands .pwb-brands-cols-outer:after{content:"";display:table;clear:both}.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{padding:0 15px;width:20%;float:left}.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3>p:first-child{height:25px;overflow:hidden;font-size:14px}.pwb-az-listing-row{margin-bottom:20px}.pwb-az-listing-row-in{margin-left:-5px;margin-right:-5px}.pwb-az-listing-col{padding:5px}.pwb-az-listing-col>a{display:block;text-transform:uppercase;white-space:nowrap;overflow:hidden}.pwb-az-listing-title{border-bottom:1px solid #ddd;font-weight:bold;font-size:115%;text-transform:uppercase}.pwb-az-listing-header{margin-bottom:30px}.pwb-az-listing-header ul{margin:0;padding:0;list-style:none;margin-right:-2px;margin-left:-2px}.pwb-az-listing-header li{display:inline-block;float:left;width:25px;height:25px;margin:2px;line-height:25px;border:1px solid #ddd;text-align:center}.pwb-az-listing-header a{text-transform:uppercase}.pwb-filter-products input[type="checkbox"]{margin-right:10px}.pwb-filter-products li{margin-bottom:5px}.pwb-row:after{content:"";display:table;clear:both}.pwb-columns-2{width:50%}.pwb-columns-3{width:33.33333%}.pwb-columns-4{width:25%}.pwb-columns-5{width:20%}.pwb-columns-6{width:16.66666%}.pwb-columns{float:left}.pwb-single-product-brands{padding-top:1em}.pwb-text-before-brands-links{margin-right:10px}@media screen and (max-width:1000px){.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{width:25%}}@media screen and (max-width:700px){.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{width:50%}.pwb-columns-5,.pwb-columns-6{width:25%}}@media screen and (max-width:480px){.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{width:100%;float:none}.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3>p:first-child{height:auto}.pwb-columns-3,.pwb-columns-4,.pwb-columns-5,.pwb-columns-6{width:50%}}@media(min-width:576px){.pwb-az-listing-col{width:50%;float:left}}@media(min-width:992px){.pwb-az-listing-col{width:25%}}
     1.pwb-clearfix:after{content:"";display:table;clear:both}.pwb-before-loop{margin-bottom:1em}.pwb-after-loop{margin-top:1em}.pwb-carousel .pwb-slick-slide a{display:block}.pwb-carousel .pwb-slick-slide a>img{margin:0 auto}.pwb-carousel .pwb-slick-slide,.pwb-product-carousel .pwb-slick-slide{margin:0 10px}.pwb-carousel .slick-prev,.pwb-carousel .slick-next,.pwb-product-carousel .slick-prev,.pwb-product-carousel .slick-next{font-size:0;position:absolute;top:0;bottom:0;display:block;cursor:pointer;font-size:22px;width:30px;overflow:hidden;text-align:center;color:#aeaeae;border:0;outline:0;z-index:999;background:#eee;opacity:0;transition:opacity .3s ease-in-out;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out}.pwb-carousel .slick-prev>span,.pwb-carousel .slick-next>span,.pwb-product-carousel .slick-prev>span,.pwb-product-carousel .slick-next>span{display:inline-block;height:20px;width:20px;padding:10px;position:absolute;top:50%;margin-top:-20px;left:0;right:0}.pwb-carousel .slick-prev:hover,.pwb-carousel .slick-prev:focus,.pwb-carousel .slick-next:hover,.pwb-carousel .slick-next:focus,.pwb-product-carousel .slick-prev:hover,.pwb-product-carousel .slick-prev:focus,.pwb-product-carousel .slick-next:hover,.pwb-product-carousel .slick-next:focus{outline:0}.pwb-carousel .slick-prev,.pwb-product-carousel .slick-prev{left:0}.pwb-carousel .slick-next,.pwb-product-carousel .slick-next{right:0}.pwb-carousel:hover .slick-next,.pwb-carousel:hover .slick-prev,.pwb-product-carousel:hover .slick-next,.pwb-product-carousel:hover .slick-prev{opacity:.8}.pwb-product-carousel .pwb-amount{display:block;width:100%;margin-bottom:12px}.pwb-carousel,.pwb-product-carousel{min-height:30px}.pwb-carousel .pwb-slick-slide,.pwb-product-carousel .pwb-slick-slide{display:none}.pwb-carousel.slick-initialized .pwb-slick-slide,.pwb-product-carousel.slick-initialized .pwb-slick-slide{display:block}.pwb-carousel .slick-list,.pwb-product-carousel .slick-list{opacity:0;position:absolute}.pwb-carousel.slick-initialized,.pwb-product-carousel.slick-initialized{min-height:none}.pwb-carousel.slick-initialized .slick-list,.pwb-product-carousel.slick-initialized .slick-list{opacity:1;position:relative;transition:opacity .2s ease-in}.pwb-carousel.slick-initialized .pwb-carousel-loader,.pwb-product-carousel.slick-initialized .pwb-carousel-loader{display:none!important;opacity:0!important}.pwb-carousel-loader{font-size:10px;margin:50px auto;text-indent:-9999em;width:30px;height:30px;border-radius:50%;background:#525252;background:-moz-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:-webkit-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:-o-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:-ms-linear-gradient(left,#525252 10%,rgba(82,82,82,0) 42%);background:linear-gradient(to right,#525252 10%,rgba(82,82,82,0) 42%);position:relative;-webkit-animation:PWBCarouselLoader 1.4s infinite linear;animation:PWBCarouselLoader 1.4s infinite linear;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)}.pwb-carousel-loader:before{width:50%;height:50%;background:#525252;border-radius:100% 0 0 0;position:absolute;top:0;left:0;content:''}.pwb-carousel-loader:after{background:#fff;width:75%;height:75%;border-radius:50%;content:'';margin:auto;position:absolute;top:0;left:0;bottom:0;right:0}@-webkit-keyframes PWBCarouselLoader{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes PWBCarouselLoader{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.pwb-brands-cols-outer{margin-left:-15px;margin-right:-15px}.pwb-all-brands .pwb-pagination-wrapper{margin-top:20px;padding-top:10px;border-top:1px solid #ededed;text-align:right}.pwb-all-brands .pwb-pagination{display:inline-block;margin-right:10px;background-color:#ededed;color:#333;text-align:center;padding:10px}.pwb-all-brands .pwb-brands-cols-outer:after{content:"";display:table;clear:both}.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{padding:0 15px;width:20%;float:left}.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3>p:first-child{height:25px;overflow:hidden;font-size:14px}.pwb-az-listing-row{margin-bottom:20px}.pwb-az-listing-row-in{margin-left:-5px;margin-right:-5px}.pwb-az-listing-col{padding:5px}.pwb-az-listing-col>a{display:block;text-transform:uppercase;white-space:nowrap;overflow:hidden}.pwb-az-listing-title{border-bottom:1px solid #ddd;font-weight:bold;font-size:115%;text-transform:uppercase}.pwb-az-listing-header{margin-bottom:30px}.pwb-az-listing-header ul{margin:0;padding:0;list-style:none;margin-right:-2px;margin-left:-2px}.pwb-az-listing-header li{display:inline-block;float:left;width:25px;height:25px;margin:2px;line-height:25px;border:1px solid #ddd;text-align:center}.pwb-az-listing-header a{text-transform:uppercase}.pwb-filter-products input[type="checkbox"]{margin-right:10px}.pwb-filter-products li{margin-bottom:5px}.pwb-row:after{content:"";display:table;clear:both}.pwb-columns-2{width:50%}.pwb-columns-3{width:33.33333%}.pwb-columns-4{width:25%}.pwb-columns-5{width:20%}.pwb-columns-6{width:16.66666%}.pwb-columns{float:left}.pwb-single-product-brands{padding-top:1em}.pwb-text-before-brands-links{margin-right:10px}@media screen and (max-width:1000px){.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{width:25%}}@media screen and (max-width:700px){.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{width:50%}.pwb-columns-5,.pwb-columns-6{width:25%}}@media screen and (max-width:480px){.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3{width:100%;float:none}.pwb-all-brands .pwb-brands-cols-outer .pwb-brands-col3>p:first-child{height:auto}.pwb-columns-3,.pwb-columns-4,.pwb-columns-5,.pwb-columns-6{width:50%}}@media(min-width:576px){.pwb-az-listing-col{width:50%;float:left}}@media(min-width:992px){.pwb-az-listing-col{width:25%}}
  • perfect-woocommerce-brands/trunk/classes/admin/class-pwb-admin-tab.php

    r2028187 r2228017  
    147147                    'type'    => 'select',
    148148                    'class'  => 'pwb-admin-tab-field',
    149                     'desc'    => __( 'Brand logo size for single product view', 'perfect-woocommerce-brands' ),
    150149                    'id'      => 'wc_pwb_admin_tab_brand_logo_size',
    151150                    'options' => $available_image_sizes_adapted
  • perfect-woocommerce-brands/trunk/classes/class-perfect-woocommerce-brands.php

    r2176402 r2228017  
    4040    add_action( 'posts_clauses', array( $this, 'brands_column_sortable_posts' ), 10, 2 );
    4141    add_filter( 'post_type_link', array( $this, 'brand_name_in_url' ), 10, 2 );
     42    add_action( 'pre_get_posts', array( $this, 'search_by_brand_name' ) );
    4243  }
    4344
     
    254255
    255256    $brands_in_loop = get_option('wc_pwb_admin_tab_brands_in_loop');
     257    $image_size_selected = get_option('wc_pwb_admin_tab_brand_logo_size', 'thumbnail');
    256258
    257259    if( $brands_in_loop == 'brand_link' || $brands_in_loop == 'brand_image' ){
     
    268270            $attachment_id = get_term_meta( $brand->term_id, 'pwb_brand_image', 1 );
    269271
    270             $attachment_html = wp_get_attachment_image( $attachment_id, 'thumbnail' );
     272            $attachment_html = wp_get_attachment_image( $attachment_id, $image_size_selected );
    271273            if( !empty($attachment_html) && $brands_in_loop == 'brand_image' ){
    272274              echo '<a href="'.$brand_link.'">'.$attachment_html.'</a>';
     
    618620              echo '<div class="pwb-single-product-brands pwb-clearfix">';
    619621
    620               if( $show_as == 'brand_link' ){
    621                 echo '<span class="pwb-text-before-brands-links">';
    622                   echo apply_filters( 'pwb_text_before_brands_links', __('Brands', 'perfect-woocommerce-brands') );
    623                 echo ':</span>';
     622              if ( $show_as == 'brand_link' ) {
     623                $before_brands_links = '<span class="pwb-text-before-brands-links">';
     624                $before_brands_links.= apply_filters( 'pwb_text_before_brands_links', __('Brands', 'perfect-woocommerce-brands') );
     625                $before_brands_links.= ':</span>';
     626                echo apply_filters( 'pwb_html_before_brands_links', $before_brands_links );
    624627              }
    625628
     
    629632
    630633                  $image_size = 'thumbnail';
    631                   $image_size_selected = get_option('wc_pwb_admin_tab_brand_logo_size');
     634                  $image_size_selected = get_option('wc_pwb_admin_tab_brand_logo_size', 'thumbnail');
    632635                  if($image_size_selected!=false){
    633636                      $image_size = $image_size_selected;
     
    914917  }
    915918
     919  /**
     920   *  Redirect if the search matchs with a brands name
     921   *  Better search experience
     922   */
     923  public function search_by_brand_name( $query ) {
     924
     925    if ( ! is_admin() && $query->is_main_query() && $query->is_search() ) {
     926
     927      $brands = get_terms( array( 'taxonomy' => 'pwb-brand', 'fields' => 'id=>name' ) );
     928
     929      if ( $match = array_search( strtolower( trim( $query->get('s') ) ), array_map('strtolower', $brands ) ) ) {
     930
     931        wp_redirect( get_term_link( $match ) );
     932        exit;
     933
     934      }
     935
     936    }
     937
     938  }
     939
    916940}
  • perfect-woocommerce-brands/trunk/classes/class-pwb-product-tab.php

    r2176402 r2228017  
    4646
    4747      <?php
     48      $image_size = get_option('wc_pwb_admin_tab_brand_logo_size', 'thumbnail');
    4849      $brand_logo = get_term_meta( $brand->term_id, 'pwb_brand_image', true );
    49       $brand_logo = wp_get_attachment_image( $brand_logo, apply_filters( 'pwb_product_tab_brand_logo_size', 'thumbnail' ) );
     50      $brand_logo = wp_get_attachment_image( $brand_logo, apply_filters( 'pwb_product_tab_brand_logo_size', $image_size ) );
    5051      ?>
    5152
  • perfect-woocommerce-brands/trunk/classes/shortcodes/class-pwb-all-brands.php

    r1982266 r2228017  
    2929    }
    3030
     31    //remove residual empty brands
     32    foreach ( $brands as $key => $brand ) {
     33
     34      $count = self::count_visible_products( $brand->term_id );
     35
     36      if ( ! $count && $hide_empty ){
     37        unset( $brands[$key] );
     38      } else {
     39        $brands[$key]->count_pwb = $count;
     40      }
     41
     42    }
     43
    3144    ?>
    3245    <div class="pwb-all-brands">
     
    3649
    3750    return ob_get_clean();
     51  }
     52
     53  /**
     54   *  WP_Term->count property don´t care about hidden products
     55   *  Counts the products in a specific brand
     56   */
     57  public static function count_visible_products( $brand_id ) {
     58
     59    $args = array(
     60      'posts_per_page' => -1,
     61      'post_type'      => 'product',
     62      'tax_query'      => array(
     63        array(
     64          'taxonomy'  => 'pwb-brand',
     65          'field'     => 'ID',
     66          'terms'     => $brand_id
     67        ),
     68        array(
     69          'taxonomy' => 'product_visibility',
     70          'field'    => 'name',
     71          'terms'    => 'exclude-from-catalog',
     72          'operator' => 'NOT IN',
     73        )
     74      )
     75    );
     76    $wc_query = new \WP_Query($args);
     77
     78    return $wc_query->found_posts;
     79
    3880  }
    3981
     
    63105      <div class="pwb-brands-cols-outer">
    64106        <?php
    65         foreach($outArray as $brand){
    66           $brand_id = $brand->term_id;
     107        foreach( $outArray as $brand ) {
     108
     109          $brand_id   = $brand->term_id;
    67110          $brand_name = $brand->name;
    68111          $brand_link = get_term_link($brand_id);
     
    71114          $attachment_html = $brand_name;
    72115          if($attachment_id!=''){
    73             $attachment_html = wp_get_attachment_image($attachment_id,$image_size);
     116            $attachment_html = wp_get_attachment_image( $attachment_id, $image_size );
    74117          }
    75118
     
    80123              <p>
    81124                <a href="<?php echo $brand_link;?>"><?php echo $brand_name;?></a>
    82                 <small>(<?php echo $brand->count;?>)</small>
     125                <small>(<?php echo $brand->count_pwb;?>)</small>
    83126              </p>
    84127            <?php endif; ?>
     
    91134              <p>
    92135                <a href="<?php echo $brand_link;?>"><?php echo $brand_name;?></a>
    93                 <small>(<?php echo $brand->count;?>)</small>
     136                <small>(<?php echo $brand->count_pwb;?>)</small>
    94137              </p>
    95138            <?php endif; ?>
  • perfect-woocommerce-brands/trunk/classes/shortcodes/class-pwb-product-carousel.php

    r2074985 r2228017  
    1212    self::$atts = shortcode_atts( array(
    1313        'brand'               => "all",
     14        'category'            => "all",
    1415        'products'            => "10",
    1516        'products_to_show'    => "5",
     
    6364      );
    6465    }
     66    if( self::$atts['category'] != 'all'){
     67        $woo_category_query =    array(
     68            'taxonomy' => 'product_cat',
     69            'field'    => 'slug',
     70            'terms'    => self::$atts['category']
     71        );
     72        if(isset($args['tax_query']) && is_array($args['tax_query'])) {
     73            $args['tax_query'][] = $woo_category_query;
     74        } else {
     75            $args['tax_query'] = array($woo_category_query);
     76        }
     77    }
    6578
    6679        $loop = new \WP_Query( $args );
  • perfect-woocommerce-brands/trunk/lang/perfect-woocommerce-brands-ca.po

    r2028187 r2228017  
    485485msgstr "Mostrar el logo de la marca (o el nom) a la pàgina del producte"
    486486
    487 #: classes/admin/class-pwb-admin-tab.php:132
    488 msgid "Brand logo size for single product view"
    489 msgstr "Mida del logo per a la vista individual de producte"
    490 
    491487#: classes/admin/class-pwb-admin-tab.php:137
    492488msgid "Brand position"
  • perfect-woocommerce-brands/trunk/lang/perfect-woocommerce-brands-es_ES.po

    r2028187 r2228017  
    485485msgstr "Mostrar el logo de la marca (o el nombre) en la página del producto"
    486486
    487 #: classes/admin/class-pwb-admin-tab.php:132
    488 msgid "Brand logo size for single product view"
    489 msgstr "Tamaño del logo para la vista individual de producto"
    490 
    491487#: classes/admin/class-pwb-admin-tab.php:137
    492488msgid "Brand position"
  • perfect-woocommerce-brands/trunk/lang/perfect-woocommerce-brands.pot

    r2028187 r2228017  
    466466msgstr ""
    467467
    468 #: classes/admin/class-pwb-admin-tab.php:132
    469 msgid "Brand logo size for single product view"
    470 msgstr ""
    471 
    472468#: classes/admin/class-pwb-admin-tab.php:137
    473469msgid "Brand position"
  • perfect-woocommerce-brands/trunk/main.php

    r2176402 r2228017  
    44 *  Plugin URI: https://wordpress.org/plugins/perfect-woocommerce-brands/
    55 *  Description: Perfect WooCommerce Brands allows you to show product brands in your WooCommerce based store.
    6  *  Version: 1.7.7
     6 *  Version: 1.7.8
    77 *  Author: Alberto de Vera Sevilla
    88 *  Author URI: https://profiles.wordpress.org/titodevera/
     
    1010 *  Domain Path: /lang
    1111 *  License: GPL3
    12  *      Perfect WooCommerce Brands version 1.7.7, Copyright (C) 2019 Alberto de Vera Sevilla
     12 *      Perfect WooCommerce Brands version 1.7.8, Copyright (C) 2019 Alberto de Vera Sevilla
    1313 *      Perfect WooCommerce Brands is free software: you can redistribute it and/or modify
    1414 *      it under the terms of the GNU General Public License as published by
     
    2424 *
    2525 *  WC requires at least: 3.1.0
    26  *  WC tested up to: 3.8
     26 *  WC tested up to: 3.9
    2727 */
    2828
     
    3535define( 'PWB_PLUGIN_PATH', plugin_basename( dirname( __FILE__ ) ) );
    3636define( 'PWB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
    37 define( 'PWB_PLUGIN_VERSION', '1.7.7' );
     37define( 'PWB_PLUGIN_VERSION', '1.7.8' );
    3838define( 'PWB_WP_VERSION', get_bloginfo( 'version' ) );
    3939define( 'PWB_WC_VERSION', get_option( 'woocommerce_version' ) );
  • perfect-woocommerce-brands/trunk/readme.txt

    r2176402 r2228017  
    44Tags: woocommerce, brands, brand taxonomy, product brands, woocommerce manufacturer, woocommerce supplier, e-commerce
    55Requires at least: 4.7
    6 Tested up to: 5.2
     6Tested up to: 5.3
    77Requires PHP: 5.6
    8 Stable tag: 1.7.7
     8Stable tag: 1.7.8
    99License: GPL3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.en.html
     
    8282
    8383== Changelog ==
     84= 1.7.8 =
     85* Fix: Hidden products contribute towards product count for "pwb-all-brands" shortcode
     86* Enhancement: Replace hardcoded thumbnail size for product loops with selected size (thanks @orjhor)
     87* Feature: Redirect if the search matches with a brand name. Better product search experience.
     88* Feature: Add the possibility to filter by product category on product carousel shortcode (thanks @lasdou)
     89* Dev: New filter hook "pwb_html_before_brands_links"
     90* Tested on WooCommerce 3.9
    8491= 1.7.7 =
    8592* Enhancement: Better support for special characters in "AZ-Listing" shortcode
Note: See TracChangeset for help on using the changeset viewer.