For Users

Installation

First way to install plugin:

  1. Download plugin from your BeRocket account
  2. Open your site admin panel and go to Plugins -> Add New -> Upload Plugin
  3. Click Browse and select downloaded zip file and click Install Now
  4. Click Activate Plugin

 

Second way to install plugin:  

  1. Download plugin from your BeRocket account
  2. Open your site via FTP
  3. Go to WordPress folder/wp-content/plugins
  4. Extract files from downloaded zip file and copy extracted folders to plugins folder
  5. Open your site admin panel and go to Plugins
  6. Find WooCommerce Advanced Products Labels and click Activate under it

Setup

Label

  • To add new label go to Admin Panel -> Products -> Advanced Labels and click Add Label button.
  • Click + button under Conditions and select needed condition.
  • + button, that outside any blocks add new blocks that connected as OR, but + buttons inside each block add new condition as AND.
  • Select needed content type and enter information for selected content type.

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?

Settings

WooCommerce Products Compare have settings in Admin Panel -> WooCommerce -> Currency Exchange

General

Contains general settings for Advanced Product Labels.

  • Disable global labels? - Disable labels, that added to all products from page Admin Panel -> Products -> Advanced Labels
  • Disable product labels - Disable labels, that added on products pages

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

Labels

To add new label go to Admin Panel -> Products -> Advanced Labels and press Add Label button

There you can add Labels to all products by specific conditions.

  • Title - uses only in admin panel
  • Conditions - you can add any conditions to display labels on products. + button, that outside any blocks add new blocks that connected as OR, but + buttons inside each block add new condition as AND
  • Content type - type of label content:
    • Text - block of text with background color
    • Image - block with images
    • Time left for discount - block of text ( time for discount end ) with background color
    • Discount percentage - block of text ( percentage of discount ) with background color
  • Color - Background color for block with images or text
  • Font color - color for font on block with text
  • Font size - font size on block with text
  • Type - type of label position:
    • Label - displayed under product image
    • On image - displayed on images
  • Border width - border width for label block
  • Border color - border color for label block
  • Border radius - border corner radius for label block
  • Position - horizontal label position

For Developers

Filter hooks

products_label_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_products_label_get_template_part ( $template, $name ) {
//your code here
    return $template;
}

add_filter( 'products_label_get_template_part', 'change_products_label_get_template_part', 10, 2 );
?>

Functions

includes/functions.php

br_get_woocommerce_version()

Public function to get WooCommerce version

return string. woocommerce version

br_generate_product_selector($options)

Generate multiple products selector with search field

  • $options - array with options. Elements:
    • option - array with products id
    • block_name - unique name
    • name - name, that used as fields name. Must be array, like "br_tabs[additional_product][products][]"
    • return - if false, then used echo to display HTML code. If true, then return HTML code as string

return string or void. HTML code

woocommerce-advanced-products-labels.php

All of these functions is in class BeRocket_tab_manager 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-advanced-products-labels/templates.

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

Options

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

public static $defaults = array(
        'disable_labels'    => '0',
        'disable_plabels'   => '0',
        'custom_css'        => '',
        'script'            => '',
        'plugin_key'        => '',
    );

Files

  • woocommerce-advanced-products-labels.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 front end pages
  • fonts - Font Awesome fonts
  • includes - folder with additional PHP files
    • functions.php - public functions
    • updater.php - BeRocket Updater for plugins update from BeRocket site
  • js - folder with JavaScript files
    • admin.js - JavaScript for admin panel settings
    • colpick.js - JavaScript for color picker in admin panel settings
  • templates - templates for settings, list style and buttons
    • label.php - label settings
    • settings.php - plugin settings page