For Users

Installation

First way to install plugin:

  1. Download plugin from your BeRocket account
  2. Disable FREE version of same plugin if you have it
  3. Open your site admin panel and go to Plugins -> Add New -> Upload Plugin
  4. Click Browse and select downloaded zip file and click Install Now
  5. Click Activate Plugin

 

Second way to install plugin:  

  1. Download plugin from your BeRocket account
  2. Disable FREE version of same plugin if you have it
  3. Open your site via FTP
  4. Go to WordPress folder/wp-content/plugins
  5. Extract files from downloaded zip file and copy extracted folders to plugins folder
  6. Open your site admin panel and go to Plugins
  7. Find WooCommerce Product Brands and click Activate under it

Setup

Brands

  • To add new brand go to Admin Panel -> Products -> Brands.
  • Enter Name, Description and select Thumbnail.
  • Click Add New Brand

Account/Product Key

BeRocket Account and Product key uses for auto update plugins from BeRocket site.

Where can you find Account Key?

  1. Open BeRocket site and Login (The Login button you can find in header menu)
  2. Go to My Account (The My Account button you can find in header menu)
  3. From right side on page you can find all information about your BeRocket account including Account Key

  4. You can click on account key and copy it
  5. What can you do with Account Key?

Where can you find Product Key?

  1. Open BeRocket site and Login (The Login button you can find in header menu)
  2. Go to My Account (The My Account button you can find in header menu)
  3. Click on key icon on right side from plugin name WooCommerce Products Compare

  4. You can click on Product key and copy it
  5. In left field you can type any notice for this key and click DONE to save
  6. What can you do with Product Key?

Theme Setup

Clean Commerce

Setting Custom CSS

Open your site admin panel->WooCommerce->Product Brands->Custom CSS

Add this CSS to the field "User custom CSS style":

div.brcs_slider_brands ul li::before 
{
    content: none;
}

 

Settings

WooCommerce Products Compare have settings in Admin Panel -> WooCommerce -> Product Brands

General

Contains general settings for Product Brands.

  • Display thumnail on brand page - displayed brand thumbnail above products list
  • Thumbnail width? - width of brand thumbnail above products list
  • Thumbnail align - horizontal position of brand thumbnail above products list
  • Display description on brand page - displayed brand description above products list
  • Display brand thumbnail on product page - displayed brand thumbnail on product page

CSS

Contains setting to set custom CSS code that will be added to frontend pages.

  • Custom CSS - any CSS code, that you want

License

Plugin key - uses for updates plugin from BeRocket site. You can get this on BeRocket site -> My Account page on click key icon

BeRocket Account

BeRocket account settings are in Admin Panel -> Settings -> BeRocket Account.

Contains field for place BeRocket Account Key

Where can you find Account Key?

  1. Copy Account Key from BeRocket site
  2. Paste this key to Account key field
  3. Press Test button
  4. If you use right Account Key you will see

  5. Then press Save button

Brands

To add new brand go to Admin Panel -> Products -> Brands

  • Name - brand name
  • Slug - custom brand slug
  • Parent - parent brand
  • Description - brand description, can be displayed on brand page
  • Thumbnail - brand image, can be displayed on brand page

Widgets

WooCommerce Brands by Name

Widget to display Brands list by name. You can place this widget to any widget area like other widgets.

  • Display image - display image for brands
  • Maximum image height - brands thumbnail height
  • Maximum image width - brands thumbnail width
  • Display name - display name for brands
  • Columns - brands per row
  • Position - image and thumbnail positions:
    • Name after image - displayed name after brand thumbnail
    • Name before image - displayed name before brand thumbnail
    • Name under image - displayed name under brand thumbnail
    • Show only on letter click - hide all brands and display only brands by clicking on letter
  • Style - vertical or horizontal style:
    • Vertical - display letter under letter with brands in columns
    • Horizontal - display letter in columns with brands under brands

WooCommerce Product Brands

Widget to display product brands. You can place this widget to any widget area like other widgets.

  • Title - widget title
  • Display image - display image for brands
  • Maximum image height - brands thumbnail maximum height
  • Display name - display name for brands
  • Hide empty - hide brands without products
  • Slider - brands list as slider.
  • Brands per row - brands columns. Brands per slider, when slider enabled
  • Number of brands - Maximum number of brands to display
  • Order brands by - Brands sort
  • Padding around brands - padding around each brand (Default: 3px)
  • Border color - color of border around each brand
  • Border width - width of border around each brand

 

WooCommerce Product Brands Description

Widget to display product brand information. You can place this widget to any widget area like other widgets.

  • Display title - display name for brands
  • Display thumbnails - display image for brands
  • Display description - display description for brands
  • Image width - brands thumbnail width (Default: 100%)
  • Image align - position of image

Shortcodes

[brands_product_thumbnail] - display brand thumbnail on product page. Displayed brand name, when brand has no thumbnail.

  • post_id - product ID to display brand from specific product
  • width - thumbnail width (Default: 35%)
  • height - thumbnail height
  • position - thumbnail align ( left, right or none )

[brands_info] - display product brand information

  • type - type of information ( name, image or description ). Can be used multiple types (Example: name,image,description). Position of elements is important. name,image,description and description,name,image return different shortcode.
  • id - brand ID to display information for specific brand

[product_brands_info] - brand info on product page

  • product_id - product ID(optionaly)
  • type - type of information ( name, image or description ). Can be used multiple types (Example: name,image,description). Position of elements is important. name,image,description and description,name,image return different shortcode.

[brands_products] - display products for specific brand like WooCommerce product category shortcode

  • brand_id - brand ID(s). One or more brand ID(Example: 12,34,35)
  • brand_slug - brand slug(s). One or more brand slug name(Example: brand1,brand2,brand3)
  • columns - count of columns for product list. Can doesn't work with some theme or plugin
  • orderby - order products by this field(title, name, date, modified)
    • title - Order by title
    • name - Order by post name (post slug)
    • date - Order by date
    • modified - Order by last modified date
    • rand - Random order
  • order - ascending(asc) or descending(desc) order

[brands_list] - list of brands

  • use_image - display brand image(1 or 0)
  • use_name - display brand name(1 or 0)
  • per_row - Count of columns for brands list(count of brand per slider)
  • hide_empty - Hide brands without products(1 or 0)
  • count - maximum number of brand
  • slider - is this slider with brands(1 or 0)
  • padding - padding around image and name(Default: 3px)
  • border_color - border color in HEX(#FFFFFF - white, #000000 - black)
  • border_width - border width in pixels

[brands_by_name] - brands list by name

  • image - display brand image
  • text - display brand name
  • style - "vertical" or "horizontal" position of elements
  • position - image and name position for brand
    • 1 - Name after image
    • 2 - Name before image
    • 3 - Name under image
    • 4 - Show only on letter click
  • column - Count of columns for brands list
  • imgw - image width(Default: 64px)
  • imgh - image height

For Developers

Filter hooks

product_brand_get_template_part

Template that uses in plugin.

Parameters

  1. template - link to template that will be loaded.
  2. name - template name.

Usage

<?php
function change_product_brand_get_template_part ( $template, $name ) {
//your code here
    return $template;
}

add_filter( 'product_brand_get_template_part', 'change_product_brand_get_template_part', 10, 2 );
?>

shortcode_brands_product_thumbnail_return

HTML code, that brands_product_thumbnail shortcode returns.

Parameters

  1. return - HTML code, that returns
  2. atts - shortcode attributes

Usage

<?php
function change_shortcode_brands_product_thumbnail_return ( $return, $atts ) {
//your code here
    return $return;
}

add_filter( 'shortcode_brands_product_thumbnail_return', 'change_shortcode_brands_product_thumbnail_return', 10, 2 );
?>

shortcode_brands_info_return

HTML code, that brands_info shortcode returns.

Parameters

  1. return - HTML code, that returns
  2. term - brand term taxonomy
  3. atts - shortcode attributes

Usage

<?php
function change_shortcode_brands_info_return ( $return, $term, $atts ) {
//your code here
    return $return;
}

add_filter( 'shortcode_brands_info_return', 'change_shortcode_brands_info_return', 10, 3 );
?>

brands_by_name_shortcode_return

HTML code, that brands_by_name shortcode returns.

Parameters

  1. return - HTML code, that returns
  2. atts - shortcode attributes

Usage

<?php
function change_brands_by_name_shortcode_return ( $return, $atts ) {
//your code here
    return $return;
}

add_filter( 'brands_by_name_shortcode_return', 'change_brands_by_name_shortcode_return', 10, 2 );
?>

brands_list_shortcode_return

HTML code, that brands_list shortcode returns.

Parameters

  1. return - HTML code, that returns
  2. atts - shortcode attributes

Usage

<?php
function change_brands_list_shortcode_return ( $return, $atts ) {
//your code here
    return $return;
}

add_filter( 'brands_list_shortcode_return', 'change_brands_list_shortcode_return', 10, 2 );
?>

brands_products_shortcode_return

HTML code, that brands_products shortcode returns.

Parameters

  1. return - HTML code, that returns
  2. atts - shortcode attributes

Usage

<?php
function change_brands_products_shortcode_return ( $return, $atts ) {
//your code here
    return $return;
}

add_filter( 'brands_products_shortcode_return', 'change_brands_products_shortcode_return', 10, 2 );
?>

Action hooks

brands_info_before

Action in brand_info shortcode before HTML.

Parameters

  1. term - brand term taxonomy
  2. atts - shortcode attributes

Usage

<?php
function change_brands_info_before ( $term, $atts ) {
//your code here
}

add_action( 'brands_info_before', 'change_brands_info_before', 10, 2 );
?>

brands_info_after

Action in brand_info shortcode after HTML.

Parameters

  1. term - brand term taxonomy
  2. atts - shortcode attributes

Usage

<?php
function change_brands_info_after ( $term, $atts ) {
//your code here
}

add_action( 'brands_info_after', 'change_brands_info_after', 10, 2 );
?>

brands_letter_before_brands

Action in brands_by_name shortcode and WooCommerce Brands by Name widget before letter block.

Parameters

  1. letter - current letter
  2. atts - shortcode or widget attributes
  3. random_class - class for current widget or shortcode block

Usage

<?php
function change_brands_letter_before_brands ( $letter, $atts, $random_class ) {
//your code here
}

add_action( 'brands_letter_before_brands', 'change_brands_letter_before_brands', 10, 3 );
?>

brands_letter_after_brands

Action in brands_by_name shortcode and WooCommerce Brands by Name widget after letter block.

Parameters

  1. letter - current letter
  2. atts - shortcode or widget attributes
  3. random_class - class for current widget or shortcode block

Usage

<?php
function change_brands_letter_after_brands ( $letter, $atts, $random_class ) {
//your code here
}

add_action( 'brands_letter_after_brands', 'change_brands_letter_after_brands', 10, 3 );
?>

Functions

includes/functions.php

br_get_woocommerce_version()

Public function to get WooCommerce version

return string. woocommerce version

woocommerce-brand.php

All of these functions is in class BeRocket_product_brand as static functions.

init ()

Function for initialize scripts.

admin_init ()

Function for initialize scripts and settings page in admin panel.

options ()

Add option page to admin menu.

br_get_template_part( $name = '' )

Get template part (for templates like the slider).

  • $name - template name

Default templates places in plugins folder woocommerce-brand/templates.

To rewrite the template in your theme folder create folder with name woocommerce-product_brand and places new template with identical name in this folder.

shortcode_brands_product_thumbnail ($atts)

brands_product_thumbnail shortcode

  • $atts - shortcode attributes
shortcode_brands_info ($atts)

brands_info shortcode

  • $atts - shortcode attributes
brands_by_name_shortcode ($atts)

brands_by_name shortcode

  • $atts - shortcode attributes
brands_list_shortcode ($atts)

brands_list shortcode

  • $atts - shortcode attributes
products_shortcode ($atts)

brands_products shortcode

  • $atts - shortcode attributes

Options

All settings you can find in BeRocket_product_brand class in static variables $defaults.

public static $defaults = array(
        'display_thumbnail'     => '',
        'thumbnail_width'       => '100%',
        'thumbnail_align'       => 'none',
        'display_description'   => '',
        'product_thumbnail'     => '',
        'custom_css'            => '',
        'script'                => array(
            'js_page_load'          => '',
        ),
        'plugin_key'            => '',
    );

Files

  • woocommerce-brand.php - main plugin file
  • css - folder with CSS files
    • admin.css - styles for admin panel
    • colpick.css - styles for color picker block
    • font-awesome.css - standard Font Awesome styles
    • frontend.css - styles for frontend
    • unslider.css - JQuery slider plugin styles
  • fonts - Font Awesome fonts
  • includes - folder with additional PHP files
    • functions.php - public functions
    • updater.php - BeRocket Updater for plugins update from BeRocket site
    • widget-alphabet.phpWooCommerce Brands by Name widget
    • widget-description.phpWooCommerce Product Brands Description widget
    • widget-links.phpWooCommerce Product Brands widget
  • js - folder with JavaScript files
    • admin.js - JavaScript for admin panel settings
    • colpick.js - JavaScript for color picker in admin panel settings
    • unslider-min.js - JQuery slider plugin
  • templates - templates for settings and widget
    • alphabet.php - frontend template for WooCommerce Brands By Name widget and brands_by_name shortcode
    • description.php - frontend template for WooCommerce Product Brands Description widget and brands page description
    • settings.php - plugin settings page
    • widget.php - widget template