Select Page

WooCommerce Terms and Conditions Popup

For Users

Installation of Free Version

Plugin installation Method 1:

  1. Download the plugin from berocket.com or wordpress.org.
  2. Open your website’s admin bar and follow: Plugins Add new Upload plugin.
  3. Click on Browser Dialog to open it, select the downloaded zip-file and click Install.
  4. Click on Activate Plugin.

Plugin installation method 2 :  

  1. Download the plugin from berocket.com or wordpress.org.
  2. Access your website using FTP.
  3. Navigate to WordPress/wp-content/plugins folder.
  4. Open the downloaded zip-file and unzip its content and copy the unzipped files to WordPress/wp-content/plugins folder.
  5. Open your website’s admin bar and open Plugins.
  6. Browse to select Plugin and click on Activate.

Settings

To find the WooCommerce Products Compare settings follow: admin bar WooCommerce Terms and Conditions.

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”
  • Shortcode – [br_terms_and_conditions] – shortcode to add the terms and conditions block.

Templates

Contains templates for the popups.

  • Full Footer Buttons
  • Grey Gradient
  • Nice Blue
  • Nice Green
  • Separate Footer
  • Simple & Nice
  • Simple Shadow
  • Sweet Alert

Advanced

  • Hide main scroll – enable/disable – hide body scroll when popup is opened. This will make scroll experience better.
  • Show print button – enable/disable – by clicking on it the user will be able to print (or save to PDF) popup content
  • Scroll to close – enable/disable – close popup only when scrolled to the end

Custom CSS

  • Disable Font Awesome: do not upload the CSS file for Font Awesome to the site. Disable it only if you do not use Font Awesome icons in widgets or you have Font Awesome in your theme.
  • Font Awesome Version – version of Font Awesome, which will be used in the settings and the front end pages of the shop. Please select the version that is in your theme.
  • Custom CSS – field for custom CSS; contains custom CSS code settings to be displayed on the front end pages. Custom CSS is the CSS as you want it to be.

Add-ons

  • Contact Content – use one popup for both “Terms and Conditions” and “Privacy Policy”. The content of these two popups will be placed in one popup one after another. 
  • Policy Pages – replace Privacy Policy Page with other pages using Conditions by:
    1. User Role
    2. User Status
    3. Shipping Zone
    4. Customer Country
    5. Day of the Week
    6. Products in Cart
  • Popup Show Variants – additional variant of showing popup:
    1. Open popup on page load
    2. Open popup after scrolling by some amount of px
    3. Open popup after scrolling to some block on checkout
  • Terms Pages – replace the Terms and Conditions page with other pages using Conditions by:
    1. User Role
    2. User Status
    3. Shipping Zone
    4. Customer Country
    5. Day of the Week
    6. Products in Cart
  • Old Popup – DEPRECATED

Shortcode

[br_terms_and_conditions] – shortcode to add terms and conditions block

For Developers

Action Hooks

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 are in the BeRocket_terms_cond_popup class as static functions.

init ()

Function for initializing scripts.

admin_init ()

Function for initializing scripts and settings page in admin bar.

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 are placed 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 place new template with identical name in this folder.

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 is used 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 );
?>

Files

  • woocommerce-terms-and-conditions-popup.php – main plugin file
  • css – folder with CSS files
    • admin.css – styles for admin bar
    • 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 bar settings
    • colpick.js – Javascript for color picker in admin bar settings
    • frontend.js – Javascript for frontend
  • templates – templates for settings and popup
    • popup.php – widget template
    • settings.php – plugin settings page