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 Terms and Conditions Popup and click Activate under it

Setup

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 Terms and conditions popup.

  • Agree button on terms - use "Agree" and "Decline" buttons under terms to close popup
  • Remove agree checkbox - hide checkbox, good choice to use it with "Agree" and "Decline" buttons
  • Popup Width - popup width in pixels
  • Popup Height - popup height in pixels
  • Timer - time in seconds, that customers must wait before they can close popup
  • Classes for agree button - classes, that will be used for "Agree" button. Default: "button alt"
  • Classes for decline button - classes, that will be used for "Decline" button. Default: "button"

Styles

Contains style settings for Terms and conditions popup.

  • Height paddings - sum padding from left and right in pixels or percentage
  • Width paddings - sum padding from top and bottom in pixels or percentage
  • Border width - popup border width in pixels
  • Border color - popup border color
  • Background color - color block behind popup window
  • Title background color - background color for title in popup window
  • Title font color - font color for title in popup window
  • Title font size - font size in pixels for title in popup window
  • Title height - height in pixels of the title in popup window
  • Close button size - close button size in pixels
  • Close button color - close button font color
  • Close button color on mouse over - close button font color on mouse over
  • Content background color - background color of content in popup window
  • Content font color - font color of content in popup window

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

Shortcode

[br_terms_and_conditions] - shortcode to add terms and conditions block

For Developers

Filter hooks

br_terms_cond_the_content

Filter terms and condition content.

Parameters

  1. content - page content, that will be displayed as terms and conditions

Usage

<?php
function change_br_terms_cond_the_content ( $content ) {
//your code here
    return $content;
}

add_filter( 'br_terms_cond_the_content', 'change_br_terms_cond_the_content', 10, 4 );
?>

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

add_filter( 'terms_cond_popup_get_template_part', 'change_terms_cond_popup_get_template_part', 10, 2 );
?>

Functions

includes/functions.php

br_get_woocommerce_version()

Public function to get WooCommerce version

return string. woocommerce version

woocommerce-terms-and-conditions-popup.php

All of these functions is in class BeRocket_terms_cond_popup 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-terms-and-conditions-popup/templates.

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

Options

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

public static $defaults = array(
        'agree_button'      => '',
        'popup_width'       => '',
        'popup_height'      => '',
        'timer'             => '',
        'agree_checkbox_remove' => '',
        'agree_class'       => 'button alt',
        'decline_class'     => 'button',
        'custom_css'        => '',
        'script'            => array(
            'js_page_load'      => '',
        ),
        'plugin_key'        => '',
    );

Files

  • woocommerce-terms-and-conditions-popup.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
  • 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
    • frontend.js - JavaScript for frontend
  • templates - templates for settings and popup
    • popup.php - widget template
    • settings.php - plugin settings page