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 Products of Day and click Activate under it

Setup

Add products of day

Add products of day in plugin settings Admin Panel -> WooCommerce -> Products Of Day, more information about settings.

Add widget WooCommerce Products of Day to the page or use shortcode [br_products_of_day]

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 -> Cart Suggestions

General

Contains general settings for Suggestions.

  • Position to display products of day - position on page where products of day will be displayed. Doesn't work on some WooCommerce pages
  • Monday - products that will be displayed on monday
  • Tuesday - products that will be displayed on tuesday
  • Wednesday - products that will be displayed on wednesday
  • Thursday - products that will be displayed on thursday
  • Friday - products that will be displayed on friday
  • Saturday - products that will be displayed on saturday
  • Sunday - products that will be displayed on sunday

Styles

Contains styles for product of day element.

  • Use Global styles - this styles use to global product block
  • Use Add to cart button - this styles uses to add to cart button in products of day block
  • Use Price - this styles uses to price in products of day block
  • Use Quick View button - this styles uses to Quick view button in products of day block ( only if plugin WooCommerce Product Preview installed and activated )
  • Settings for each block:
    • Text color - text color inside block or button
    • Text color on mouse over - text color inside block or button, when mouse over this block
    • Background color - background color for block
    • Background color on mouse over - background color for block, when mouse over this block
    • Border color - border color around block
    • Border color on mouse over - border color around block, when mouse over this block
    • Border width - border width around block
    • Paddings - paddings inside block from border
    • Border round - corner rounding for border

CSS

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

  • Custom CSS - any CSS code, that you want

JavaScript

Custom JavaScript code.

  • On Page Load - JavaScript that execute on page load

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

The widget from plugin called WooCommerce Cart Suggestions. You can place this widget to any widget area like other widgets.

  • Title - any text that you whant for title
  • Number of Products - count of products to display
  • Random Products from List - get random products from products list for day with random sort
  • Type - types of widget:
    • Default - like products on your shop
    • Slider - products in slider
  • Number of Products per line? - products count per line or per slide for sliders type
  • Show Thumbnails - display product thumbnails
  • Show Add to Cart Button - display add to cart button after products
  • Show Qiuck View Button - display Quick View button ( only if plugin WooCommerce Product Preview installed and activated )
  • Hide out of stock products - hide products, that out of stock

Shortcode

[br_products_of_day] - shortcode to display suggested products

Options:

  • title - any text that you whant for title
  • products_count - count of products to display
  • random
  • type - types of widget:
    • default - like products on your shop
    • slider - products in slider
  • count_line - products count per line or per slide for sliders type
  • thumbnails - display product thumbnails
  • add_to_cart - display add to cart button after products
  • quick_view - display Quick View button ( only if plugin WooCommerce Product Preview installed and activated )
  • hide_outofstock - hide products, that out of stock

For Developers

Filter hooks

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

add_filter( 'products_of_day_get_template_part', 'change_products_of_day_get_template_part', 10, 2 );
?>

berocket_products_of_day_user_func

Filter for user functions

Parameters

  1. functions - array with user functions

Usage

<?php
function change_berocket_products_of_day_user_func ( $functions ) {
//your code here
    return $functions;
}

add_filter( 'berocket_products_of_day_user_func', 'change_berocket_products_of_day_user_func' );
?>

products_of_day_widget_title

Title for widgets and shortcodes.

Parameters

  1. title - Title for widgets and shortcodes.

Usage

<?php
function change_products_of_day_widget_title ( $title ) {
//your code here
    return $title;
}

add_filter( 'products_of_day_widget_title', 'change_products_of_day_widget_title' );
?>

products_of_day_widget_products_count

Products count for widgets and shortcodes.

Parameters

  1. count - suggested products count, that can be displayed.

Usage

<?php
function change_products_of_day_widget_products_count ( $count ) {
//your code here
    return $count;
}

add_filter( 'products_of_day_widget_products_count', 'change_products_of_day_widget_products_count' );
?>

products_of_day_widget_random

Get products randomly or not for widgets and shortcodes.

Parameters

  1. random - is products will be get randomly, true or false.

Usage

<?php
function change_products_of_day_widget_random ( $random ) {
//your code here
    return $random;
}

add_filter( 'products_of_day_widget_random', 'change_products_of_day_widget_random' );
?>

products_of_day_widget_type

Type of widgets and shortcodes.

Parameters

  1. type - type of widgets and shortcodes.

Usage

<?php
function change_products_of_day_widget_type ( $type ) {
//your code here
    return $type;
}

add_filter( 'products_of_day_widget_type', 'change_products_of_day_widget_type' );
?>

products_of_day_widget_count_line

Products count per line or per slide for sliders type in widgets and shortcodes.

Parameters

  1. count - products per line

Usage

<?php
function change_products_of_day_widget_count_line ( $count ) {
//your code here
    return $count;
}

add_filter( 'products_of_day_widget_count_line', 'change_products_of_day_widget_count_line' );
?>

products_of_day_widget_thumbnails

Display product thumbnails or not in widgets and shortcodes.

Parameters

  1. thumbnails - can be true or false

Usage

<?php
function change_products_of_day_widget_thumbnails ( $thumbnails ) {
//your code here
    return $thumbnails;
}

add_filter( 'products_of_day_widget_thumbnails', 'change_products_of_day_widget_thumbnails' );
?>

products_of_day_widget_add_to_cart

Use Add to cart button or not in widgets and shortcodes.

Parameters

  1. add_to_cart - can be true or false

Usage

<?php
function change_products_of_day_widget_add_to_cart ( $add_to_cart ) {
//your code here
    return $add_to_cart;
}

add_filter( 'products_of_day_widget_add_to_cart', 'change_products_of_day_widget_add_to_cart' );
?>

products_of_day_widget_quick_view

Use Quick View button or not in widgets and shortcodes.

Parameters

  1. quick_view - can be true or false

Usage

<?php
function change_products_of_day_widget_quick_view ( $quick_view ) {
//your code here
    return $quick_view;
}

add_filter( 'products_of_day_widget_quick_view', 'change_products_of_day_widget_quick_view' );
?>

products_of_day_widget_hide_outofstock

Hide out of stock products or not in widgets and shortcodes.

Parameters

  1. hide_out_of_stock - can be true or false

Usage

<?php
function change_products_of_day_widget_hide_outofstock ( $hide_out_of_stock ) {
//your code here
    return $hide_out_of_stock;
}

add_filter( 'products_of_day_widget_hide_outofstock', 'change_products_of_day_widget_hide_outofstock' );
?>

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-products-of-day.php

All of these functions is in class BeRocket_cart_suggestion 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-products-of-day/templates.

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

Options

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

public static $defaults = array(
        'positions'         => array(),
        'products'          => array(
            '0'                 => array(),
            '1'                 => array(),
            '2'                 => array(),
            '3'                 => array(),
            '4'                 => array(),
            '5'                 => array(),
            '6'                 => array(),
            '7'                 => array(),
        ),
        'use_styles'        => array(),
        'buttons'           => array(),
        'custom_css'        => '',
        'script'            => array(
            'js_page_load'      => '',
        ),
        'plugin_key'        => '',
    );

Files

  • woocommerce-products-of-day.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.php - widget to display suggested products
  • js - folder with JavaScript files
    • admin.js - JavaScript for admin panel settings
    • colpick.js - JavaScript for color picker in admin panel settings
    • frontend.js - JavaScript for frontend
    • unslider-min.js - JQuery slider plugin
  • templates - templates for settings and widget
    • settings.php - plugin settings page
    • widget.php - widget template