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 Splash 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 -> Splash Popup

General

Contains general settings for Image watermarks.

  • Display popup type - how often popups will be displayed
  • Days of the week - you can select different popups for different users on different days of the week
    • Not Logged In Page - popup for not logged in users
    • Logged In Page - popup for logged in users
    • Logged In Customers Page - popup for logged in users, that has one or more orders
  • Timer - time in seconds, that customers must wait before they can close popup
  • Cookie Expire - time in days, when cookie will expire and popups will be displayed again
  • Reset Cookie on Login / Logout - remove cookie on login or logout
  • Force Popup - show popups on every page load

Styles

Contains styles settings for popups.

  • 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

JavaScript

Custom JavaScript code.

  • On Page Load? - JavaScript that executes on page load
  • Before Popup Open? - JavaScript that executes before popup open
  • On Popup Close - JavaScript that executes when popup was closed

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

For Developers

Filter hooks

berocket_splash_popup_user_func

Array with custom JavaScript.

Parameters

  1. functions - array with custom JavaScript field: 
    • js_page_load - string with JavaScript code that executes on page load
    • before_popup - string with JavaScript code that executes before popup open
    • close_popup - string with JavaScript code that executes on popup close

Usage

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

add_filter( 'berocket_splash_popup_user_func', 'change_berocket_splash_popup_user_func', 10, 2 );
?>

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

add_filter( 'splash_popup_get_template_part', 'change_splash_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-splash-popup.php

All of these functions is in class BeRocket_splash_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.

  • $name - template name

Default templates places in plugins folder woocommerce-splash-popups/templates.

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

login_reset ()

Remove cookie.

Options

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

public static $defaults = array(
        'display_popup_type'=> 'close',
        'not_logged_page'   => array(0=>'',1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>''),
        'logged_page'       => array(0=>'',1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>''),
        'customer_page'     => array(0=>'',1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>''),
        'not_logged_text'   => array(0=>'',1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>''),
        'logged_text'       => array(0=>'',1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>''),
        'customer_text'     => array(0=>'',1=>'',2=>'',3=>'',4=>'',5=>'',6=>'',7=>''),
        'timer'             => '0',
        'expire'            => '7',
        'login_cookie'      => '1',
        'force_popup'       => '',
        'custom_css'        => '',
        'script'            => array(
            'js_page_load'      => '',
            'before_popup'      => '',
            'close_popup'       => '',
        ),
        'plugin_key'        => '',
    );

Files

  • woocommerce-splash-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
    • jquery.cookie.js - jQuery plugin for cookie
  • templates - templates for settings and other
    • pages.php - settings to select pages for popup on settings page and on pages
    • settings.php - plugin settings page
    • wp_footer_popup.php - popup template, that will be add to page