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 Cart Notices and click Activate under it

Setup

Add notices

New notices you can add on page Admin Panel -> Products -> Notices.

There is different notices types more information.

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 Notices

General

Contains general settings for Product Tabs.

  • Disable all notices - disable notices, without plugin disabling and removing notices
  • Pages to display notices - pages where notices will be displayed

 

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

Notices

To add new notice go to Admin Panel -> Products -> Notices and press Add Notice button

There you can see default editor for posts, where you can use anything, that you can use in posts.

Also under editor you can find some additional settings for notices:

  • Notice type - type of notice
    • Minimum cart price - show notice when total cart price less then selectedprice  value and more threshold value
      • Price - maximum price to show notice
      • Price threshold - minimum price values
    • Time deadline - show notice when current time less then selected value, but not more values that equals subtract threshold from time
      • Time - maximum time deadline in hours to show notice
      • Time threshold - minimum time in hours
      • Days of week - days of the week when notice will be displayed
    • Product in cart - show notice when cart contains product from selected products
      • Products - search box to select products
      • Minimum quantity of products - minimum quantity of products from list, which must be in cart to show notice
      • Maximum quantity of products - maximum quantity of products from list, which must be in cart to show notice
    • Category in cart - show notice when cart contains product from selected category
      • Category - products category, which must contain one of the product in cart
    • Host referer - show notice when customers go to site from selected site
      • Referrer host - previous site referrer
  • Button with notice - button with link, that will be displayed on notice
    • Text on button - text, that will be displayed on button
    • Button link - link, that will be on button

Widget

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

  • Title - Widget title
  • Type of Notices - type of notices, that will be displayed
    • Minimum cart price
    • Time deadline
    • Product in cart
    • Category in cart
    • Host referer

Shortcode

[br_cart_notices] - shortcode to display notices

Options:

  • title - any text that you whant for title
  • display - types of widget to display. You can use multiple values, like this "time,price". Types of widget:
    • all - display all notices
    • time - display Time deadline type
    • price - display Minimum cart price type
    • product - display Product in cart type
    • category - display Category in cart type
    • referer - display Host referer type

For Developers

Filter hooks

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

add_filter( 'cart_notices_get_template_part', 'change_cart_notices_get_template_part', 10, 2 );
?>

br_is_show_price_notice

Display price notice on page or not.

Parameters

  1. is_show - show current notice, can be true or false
  2. cart_total - total price in cart
  3. max_price - maximum price value
  4. min_price - minimum price value

Usage

<?php
function change_br_is_show_price_notice ( $is_show, $cart_total, $max_price, $min_price ) {
//your code here
    return $is_show;
}

add_filter( 'br_is_show_price_notice', 'change_br_is_show_price_notice', 10, 4 );
?>

br_is_show_time_notice

Display time notice on page or not.

Parameters

  1. is_show - show current notice, can be true or false
  2. time - current time in minutes
  3. max_time - maximum time in minutes
  4. min_time - minimum time in minutes

Usage

<?php
function change_br_is_show_time_notice ( $is_show, $time, $max_time, $min_time ) {
//your code here
    return $is_show;
}

add_filter( 'br_is_show_time_notice', 'change_br_is_show_time_notice', 10, 4 );
?>

br_is_show_product_notice

Display products in cart notice on page or not.

Parameters

  1. is_show - show current notice, can be true or false
  2. products_in_cart - array with product IDs in cart
  3. products - array with product IDs, that must be in cart to show notice

Usage

<?php
function change_br_is_show_product_notice ( $is_show, $products_in_cart, $products ) {
//your code here
    return $is_show;
}

add_filter( 'br_is_show_product_notice', 'change_br_is_show_product_notice', 10, 3 );
?>

br_is_show_category_notice

Display category in cart notice on page or not.

Parameters

  1. is_show - show current notice, can be true or false
  2. categories_in_cart - array with category IDs in cart
  3. category - category ID, that must be in cart to show notice

Usage

<?php
function change_br_is_show_category_notice ( $is_show, $categories_in_cart, $category ) {
//your code here
    return $is_show;
}

add_filter( 'br_is_show_category_notice', 'change_br_is_show_category_notice', 10, 3 );
?>

br_is_show_referer_notice

Display referrer notice on page or not.

Parameters

  1. is_show - show current notice, can be true or false
  2. referrer - string from $_SERVER['HTTP_REFERER'] , when customer enter the site
  3. expect_referrer - string that current notice expect

Usage

<?php
function change_br_is_show_referer_notice ( $is_show, $referrer, $expect_referrer ) {
//your code here
    return $is_show;
}

add_filter( 'br_is_show_referer_notice', 'change_br_is_show_referer_notice', 10, 3 );
?>

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-cart-notices.php

All of these functions is in class BeRocket_cart_notices 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-cart-notices/templates.

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

Options

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

public static $defaults = array(
        'disable'       => '',
        'pages'         => array(),
        'plugin_key'    => '',
    );

Files

  • woocommerce-cart-notices.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.php - widget to display notices
  • js - folder with JavaScript files
    • admin.js - JavaScript for admin panel settings
  • templates - templates for settings and widget
    • settings.php - plugin settings page
    • widget.php - widget template