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 Force Sell for WooCommerce and click Activate under it

Setup

Linked products

For single product
  • To add linked product go to Admin Panel -> Products -> Edit product.
  • In Product Data metabox open Linked products tab.
  • Add products to Linked Products, that can be removed or Linked Products, that can be removed only with this product field
For products in category
  • To add linked product to category go to Admin Panel -> WooCommerce -> Force Sell.
  • In Categories? block select category in dropdown menu and click Add Category.
  • In table add products to Products Added field
  • Check Linked if products can be removed only with added product
For products list
  • To add linked product to list of products go to Admin Panel -> WooCommerce -> Force Sell.
  • In Products? click Add Product.
  • In table add products to Products field. Those are products list
  • In table add products to Products Added field. Those are products that will be added to products from Products field
  • Check Linked if products can be removed only with added product

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 -> Force Sell

General

Contains general settings for Force Sell plugin.

  • Display linked products on single product page - how to display linked products on single product page
    • Linked Products, that can be removed - display products, that can be removed after add to cart
    • Linked Products, that can be removed only with this product - display products, that can be removed with current product
    • Link to products page - list of products will be link to products, instead text only
  • Products for all products - products, that will be added to all products
  • Categories - products, that will be added to products from specific category
  • Products - products, that will be ad

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

Widget

Widget to display linked products on single product page. You can place this widget to any widget area like other widgets.

  • Linked Products, that can be removed - display products, that can be removed after add to cart
  • Linked Products, that can be removed only with this product - display products, that can be removed with current product
  • Link to products page - list of products will be link to products, instead text only

Shortcode

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

  • title - title before shortcode
  • display_force_sell - display products, that can be removed after add to cart (0 or 1)
  • display_force_sell_linked - display products, that can be removed with current product (0 or 1)
  • display_as_link - list of products will be link to products, instead text only (0 or 1)

For Developers

Filter hooks

force_sell_products_list

Products, that can be removed after add to cart.

Parameters

  1. products - array of product IDs
  2. product_id - current product ID

Usage

<?php
function change_force_sell_products_list ( $products, $product_id ) {
//your code here
    return $products;
}

add_filter( 'force_sell_products_list', 'change_force_sell_products_list', 10, 2 );
?>

force_sell_products_linked_list

Products, that can be removed with current product.

Parameters

  1. products - array of product IDs
  2. product_id - current product ID

Usage

<?php
function change_force_sell_products_list ( $products, $product_id ) {
//your code here
    return $products;
}

add_filter( 'force_sell_products_list', 'change_force_sell_products_list', 10, 2 );
?>

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

add_filter( 'force_sell_get_template_part', 'change_force_sell_get_template_part', 10, 2 );
?>

products_that_added_text

Text, that displayed before linked products

Parameters

  1. text - displayed before linked products

Usage

<?php
function change_products_that_added_text ( $text ) {
//your code here
    return $text;
}

add_filter( 'products_that_added_text', 'change_products_that_added_text' );
?>

product_linked_with_text

Text, that displayed on cart before linked product

Parameters

  1. text - displayed before linked product

Usage

<?php
function change_product_linked_with_text ( $text ) {
//your code here
    return $text;
}

add_filter( 'product_linked_with_text', 'change_product_linked_with_text' );
?>

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-force-sell.php

All of these functions is in class BeRocket_force_sell 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-force-sell/templates.

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

return_linked_products( $display_force_sell = '' , $display_force_sell_linked = '' , $display_as_link = '' )

Get linked products list.

  • $display_force_sell - display products, that can be removed after add to cart
  • $display_force_sell_linked - display products, that can be removed with current product
  • $display_as_link - list of products will be link to products, instead text only

return string or void. HTML code

Options

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

public static $defaults = array(
        'display_force_sell'        => '1',
        'display_force_sell_linked' => '1',
        'display_as_link'           => '',
        'force_sell'                => array(),
        'force_sell_linked'         => array(),
        'category_linked'           => array(),
        'product_linked'            => array(),
        'linked_products'           => array(),
        'custom_css'                => '',
        'plugin_key'                => '',
    );

Files

  • woocommerce-force-sell.php - main plugin file
  • css - folder with CSS files
    • admin.css - styles for admin panel
    • font-awesome.css - standard Font Awesome 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.phpWooCommerce Force Sell widget
  • js - folder with JavaScript files
    • admin.js - JavaScript for admin panel settings
    • admin_global.js - JavaScript for defferent BeRocket plugins
  • templates - templates for settings and widget
    • settings.php - plugin settings page