Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Hook Reference
  • Docs Home

Packages

  • Abandoned-Cart-Pro-for-WooCommerce
    • Admin
      • Action
      • Activate-plugin
      • Component
      • I18N
      • Import-Pro
      • License
      • Menu
      • Notices
      • Popup-Modal
        • Cart-Detail
      • Recover
      • Report
      • Setting
      • Settings
      • SMS
      • Tab
      • Template
    • Ajax-Functions
    • Classes
    • Common-Functions
    • Database-Layer
    • Encrypt-Decrypt-Data
    • Frontend
      • Cart-Capture
      • Cart-Populate
      • Coupon
      • Place-Order
    • Setting
    • Update
  • None

Classes

  • Wcap_Common

Class Wcap_Common

It will have all the common function needed all over the plugin.

Package: Abandoned-Cart-Pro-for-WooCommerce\Common-Functions
Author: Tyche Softwares
Located at includes/wcap_common.php

Methods summary

public static array
# wcap_deactivate_add_questions( array $wcap_add_questions )

It will add the Questions while admin deactivate the plugin.

It will add the Questions while admin deactivate the plugin.

Parameters

$wcap_add_questions
Blank array

Returns

array
$wcap_add_questions List of all questions.

Hook

ts_deativate_plugin_questions
public static integer
# wcap_get_abandoned_amount( )

Get abandoned amount of all users.

Get abandoned amount of all users.

Returns

integer
$wcap_abandoned_amount All abandoned amount.

Globals

mixed $wpdb
public static integer
# wcap_get_loggedin_abandoned_carts( )

It will fetch the total abandoned cart of the logged in users.

It will fetch the total abandoned cart of the logged in users.

Returns

integer
$wcap_loggedin_users_carts_count Count of loggedin users cart.

Globals

mixed $wpdb
public static integer
# wcap_get_guest_abandoned_carts( )

It will fetch the total abandoned cart of the guest users.

It will fetch the total abandoned cart of the guest users.

Returns

integer
$wcap_guest_user_cart_count Count of guest users carts..

Globals

mixed $wpdb
public static integer
# wcap_get_recovered_amount( )

It will fetch all amount of the recovered orders.

It will fetch all amount of the recovered orders.

Returns

integer
$wcap_recovered_amount All recovered amount.

Globals

mixed $wpdb
public static integer
# wcap_get_send_emails_count( )

Get all sent emails.

Get all sent emails.

Returns

integer
$wcap_emails_sent_count All Sent emails amount.

Globals

mixed $wpdb
public static integer
# wcap_get_loggedin_user_abandoned_cart_amount( )

It will fetch all the loggedin user abandoned cart amount.

It will fetch all the loggedin user abandoned cart amount.

Returns

integer
$wcap_loggedin_abandoned_amount All loggedin users abandoned amount.

Globals

mixed $wpdb
public static integer
# wcap_get_guest_user_abandoned_cart_amount( )

It will fetch all the Guest user abandoned cart amount.

It will fetch all the Guest user abandoned cart amount.

Returns

integer
$wcap_guest_abandoned_amount All Guest users abandoned amount.

Globals

mixed $wpdb
public static integer
# wcap_get_loggedin_user_recovered_cart_amount( )

It will fetch all the loggedin user recovered cart amount.

It will fetch all the loggedin user recovered cart amount.

Returns

integer
$wcap_loggedin_recovered_amount All loggedin users recovered amount.

Globals

mixed $wpdb
public static integer
# wcap_get_guest_user_recovered_cart_amount( )

It will fetch all the Guest user recovered cart amount.

It will fetch all the Guest user recovered cart amount.

Returns

integer
$wcap_guest_recovered_amount All Guest users recovered amount.

Globals

mixed $wpdb
public static string
# wcap_get_amount( array $wcap_result )

It will fetch the Abandoned and Recovered orders total amount.

It will fetch the Abandoned and Recovered orders total amount.

Parameters

$wcap_result
Result of query.

Returns

string
$wcap_amount Total Abandoned | Recovered amount.
public static integer
# wcap_get_sent_sms_count( )

Returns the total number of SMS sent from the plugin

Returns the total number of SMS sent from the plugin

Returns

integer
$sms_count - Total number of SMS sent

Since

7.9
public static array
# wcap_get_sms_templates_data( )

Returns the SMS template data for tracking

Returns the SMS template data for tracking

Returns

array
$wcap_sms_data - SMS Template Data

Since

7.9
public static array
# ts_add_plugin_tracking_data( array $data )

Send the plugin data when the user has opted in

Send the plugin data when the user has opted in

Parameters

$data
All data to send to server

Returns

array
$plugin_data All data to send to server

Hook

ts_tracker_data
public static array
# wcap_get_data_for_opt_out( array $params )

This function used to send the data to the server. It is used for tracking the data when admin do not wish to share the tarcking informations.

This function used to send the data to the server. It is used for tracking the data when admin do not wish to share the tarcking informations.

Parameters

$params
Parameters

Returns

array
$params Parameters

Hook

ts_tracker_opt_out_data
public static string
# wcap_get_version( )

This function returns the AC plugin version number.

This function returns the AC plugin version number.

Returns

string
$plugin_version Current version of plguin

Since

5.0
public static array
# wcap_plugin_action_links( mixed $links )

Show action links on the plugin screen.

Show action links on the plugin screen.

Parameters

$links
Plugin Action links

Returns

array
$action_links

Since

5.0
public static array
# wcap_plugin_row_meta( mixed $links, string $file )

Show row meta on the plugin screen.

Show row meta on the plugin screen.

Parameters

$links
Plugin Action links
$file
Plugin path

Returns

array
$links Plugin Action links

Since

5.0
public static
# wcap_check_user_can_manage_woocommerce( )

Check if user have the permission to access the WooCommerce pages.

Check if user have the permission to access the WooCommerce pages.

Since

5.0
public static string
# wcap_get_action( )

It will return the current action.

It will return the current action.

Returns

string
$wcap_action Action name

Since

5.0
public static
# wcap_get_mode( )

It will return the mode of the plugin.

It will return the mode of the plugin.

Returns


$wcap_mode Mode name

Since

5.0
public static
# wcap_get_section( )

Returns the section set for the admin page

Returns the section set for the admin page

Since

7.9
public static string
# wcap_get_action_two( )

It will retunrn the user selectd action from the below bulk action editor.

It will retunrn the user selectd action from the below bulk action editor.

Returns

string
$wcap_action_two Action name

Since

5.0
public static string
# wcap_get_abandoned_cart_ids_from_get( )

It will return the abandoned cart ids from the url.

It will return the abandoned cart ids from the url.

Returns

string
$wcap_ac_ids Abandoned cart ids

Since

5.0
public static string
# wcap_get_template_ids_from_get( )

It will return the template id from the url.

It will return the template id from the url.

Returns

string
$wcap_template_ids Template ids

Since

5.0
public static string
# wcap_get_email_sent_ids_from_get( )

It will return the email sent id from the url.

It will return the email sent id from the url.

Returns

string
$wcap_email_sent_ids Email sent ids

Since

5.0
public static string
# wcap_get_notice_action( )

It will return the selected action by the admin based on the url.

It will return the selected action by the admin based on the url.

Returns

string
$wcap_notice_action Notice action

Since

5.0
public static integer|string
# wcap_get_ordrer_id( object|array $wcap_order )

It will return the WC order id.

It will return the WC order id.

Parameters

$wcap_order
WooCommerce order

Returns

integer|string
$wcap_order_id Order Id

Since

5.0

Todo

Change the function name

Globals

mixed $woocommerce
public static true
# wcap_check_email_sent_for_order( integer|string $abandoned_order_id )

It will check if the abandoned cart email is sent to the cart id or not.

It will check if the abandoned cart email is sent to the cart id or not.

Parameters

$abandoned_order_id
Abandoned cart id

Returns

true
Email sent
false
Email not sent

Since

5.0

Globals

mixed $wpdb
public static string
# encrypt_validate( string $validate )

This function is used to encode the string.

This function is used to encode the string.

Parameters

$validate
String need to encrypt

Returns

string
$validate_encoded Encrypted string

Since

5.0
public static string
# wcap_get_language( )

It will return the user selected language.

It will return the user selected language.

Returns

string
$wcap_current_user_lang User selected language

Since

5.0
public static
# wcap_cron_time_duration( )

When cron job time changed this function will be called. It is used to reset the cron time again.

When cron job time changed this function will be called. It is used to reset the cron time again.

Since

5.0
public static integer
# wcap_set_session_expiring( integer $seconds )

We have changed the WooCommerce session expiration date.

We have changed the WooCommerce session expiration date.

Parameters

$seconds

Returns

integer
$days_7 7 days in seconds

Since

5.0
public static integer
# wcap_set_session_expired( integer $seconds )

We have changed the WooCommerce session expiration date.

We have changed the WooCommerce session expiration date.

Parameters

$seconds

Returns

integer
$days_7 7 days in seconds

Since

5.0
public static
# wcap_remove_action_hook( )

It will remove the cart updated hook from our plugin.

It will remove the cart updated hook from our plugin.

Since

5.0
public static
# wcap_output_buffer( )

To output the print and preview email template we need it.

To output the print and preview email template we need it.

Since

5.0
public static string
# wcap_get_client_ip( )

We will return the customers IP address. We are using the WooCommerce geoloctaion.

We will return the customers IP address. We are using the WooCommerce geoloctaion.

Returns

string
User IP address

Since

5.0
public static string
# wcap_get_user_role( integer|string $uid )

We will return the user role on the user id.

We will return the user role on the user id.

Parameters

$uid
User Id

Returns

string
$roles User role

Since

5.0

Globals

mixed $wpdb
public static true|false
# wcap_is_ip_restricted( string $wcap_user_ip_address )

We are checking if the customer IP addres is blocked by the admin.

We are checking if the customer IP addres is blocked by the admin.

Parameters

$wcap_user_ip_address
User IP address

Returns

true|false
$wcap_restricted_ip_data_exists IP address restricted | IP address not restricted

Since

5.0
public static true|false
# wcap_is_email_address_restricted( string $current_user_email_address )

We are checking if the customer Email addres is blocked by the admin.

We are checking if the customer Email addres is blocked by the admin.

Parameters

$current_user_email_address
User Email address

Returns

true|false
$wcap_restricted_email_data_exists Email address restricted | Email address not restricted

Since

5.0
public static true|false
# wcap_is_domain_restricted( string $current_user_email_address )

We are checking if the customer Domain name is blocked by the admin.

We are checking if the customer Domain name is blocked by the admin.

Parameters

$current_user_email_address
User Email address

Returns

true|false
$wcap_restricted_domain_data_exists Domain restricted | Domain not restricted

Since

5.0
public static true|false
# block_users( array $user_inputs, string $customer_ip_address )

It will break the bulk of the IP address and verify each email IP is blocked or not.

It will break the bulk of the IP address and verify each email IP is blocked or not.

Parameters

$user_inputs
All blocked IP
$customer_ip_address
User IP address

Returns

true|false
$block IP blocked | IP not blocked
public static integer
# wcap_get_reovered_order_count( date $start_date_range = '' , date $end_date_range = '' , string $get_section_result = '' )

We will return the recovered order amount based on the time period has been given.

We will return the recovered order amount based on the time period has been given.

Parameters

$start_date_range
Admin selected start date
$end_date_range
Admin selected end date
$get_section_result
Section name

Returns

integer
$return_recovered_count Count of recovered order

Since

5.0

Globals

mixed $wpdb
public static integer
# wcap_get_abandoned_order_count( string $get_section_result )

It will give you the total abandoned carts.

It will give you the total abandoned carts.

Parameters

$get_section_result
Section name

Returns

integer
$return_abandoned_count Count of abandoned order

Since

5.0

Globals

mixed $wpdb
public static integer
# wcap_get_sent_emails_count( date $start_date_range, date $end_date_range, string $get_section_result )

It will get the total amount of email sent for the time period.

It will get the total amount of email sent for the time period.

Parameters

$start_date_range
Admin selected start date
$end_date_range
Admin selected end date
$get_section_result
Section name

Returns

integer
$return_sent_email_count Count of email sent

Since

5.0

Globals

mixed $wpdb
public static string
# wcap_get_guest_session_key( )

It will get the session key for the gusst users.

It will get the session key for the gusst users.

Returns

string
$wcap_session_id Session key

Since

5.0
public static array
# guest_checkout_fields( array $fields )

It will automatically populate data of the guest user when user comes from the abandoned cart reminder email.

It will automatically populate data of the guest user when user comes from the abandoned cart reminder email.

Parameters

$fields
List of fields

Returns

array
$fields List of fields

Since

5.0
public static strinig
# wcap_replace_email_body_merge_code( string $body_email_preview )

It will replace the email body merge codes with content.

It will replace the email body merge codes with content.

Parameters

$body_email_preview
Email body

Returns

strinig
$body_email_preview Email body

Since

7.0

Globals

mixed $wpdb
public static string
# wcap_get_current_section( )

It will return the current section.

It will return the current section.

Returns

string
$section Section name
public static string
# wcap_get_product_image( string|integer $id, string $size = 'shop_thumbnail', array $attr = array(), boolean $placeholder = true )

Get the image to be attached to the emails

Get the image to be attached to the emails

Parameters

$id
Product ID or the variation ID
$size
(default: 'shop_thumbnail')
$attr
$placeholder
to return $placeholder if no image is found, or false to return an empty string.

Returns

string

Since

7.6.0
public static string
# wcap_from_name( string $from_name )

Add the From Name for WooCommerce Template Emails via Filters

Add the From Name for WooCommerce Template Emails via Filters

Parameters

$from_name
From name

Returns

string

Since

7.6.0
public static string
# wcap_from_address( string $from_address )

Add the From Emails for WooCommerce Template Emails via Filters

Add the From Emails for WooCommerce Template Emails via Filters

Parameters

$from_address
From address

Returns

string

Since

7.6.0
public static
# wcap_add_wc_mail_header( )

Add the From Name and Emails for WooCommerce Template Emails via Filters

Add the From Name and Emails for WooCommerce Template Emails via Filters

Since

7.6.0
public static
# wcap_remove_wc_mail_header( )

Remove the From Name and Emails for WooCommerce Template Emails via Filters. This will be called after Abandoned Cart Emails are sent

Remove the From Name and Emails for WooCommerce Template Emails via Filters. This will be called after Abandoned Cart Emails are sent

Since

7.6.0
public static
# wcap_add_wp_mail_header( )

Add the From Name and Emails for WordPress Template Emails via Filters

Add the From Name and Emails for WordPress Template Emails via Filters

Since

7.6.0
public static
# wcap_remove_wp_mail_header( )

Remove the From Name and Emails for WordPress Template Emails via Filters. This will be called after Abandoned Cart Emails are sent

Remove the From Name and Emails for WordPress Template Emails via Filters. This will be called after Abandoned Cart Emails are sent

Since

7.6.0
public static
# wcap_add_restrict_user_meta_field( object $user )

It will restrict the user and do not capture the cart.

It will restrict the user and do not capture the cart.

Parameters

$user
User data

Since

7.6
public static
# wcap_save_restrict_user_meta_field( integer|string $wcap_user_id )

Save the setting for the user restriction setting.

Save the setting for the user restriction setting.

Parameters

$wcap_user_id
User Id

Since

7.6
public static
# wcap_set_plaintext_body( PHPMailer $phpmailer )

It will add the plain text in the Abanodned cart reminder emails.

It will add the plain text in the Abanodned cart reminder emails.

Parameters

$phpmailer

Since

7.6
public static
# wcap_updated_recovered_cart( integer $cart_id, integer $order_id, integer $wcap_check_email_sent_to_cart, WC_Order $order )

Updates the Abandoned Cart History table as well as the Email Sent History table to indicate the order has been recovered

Updates the Abandoned Cart History table as well as the Email Sent History table to indicate the order has been recovered

Parameters

$cart_id
  • ID of the Abandoned Cart
$order_id
  • Recovered Order ID
$wcap_check_email_sent_to_cart
  • ID of the record in the Email Sent History table.
$order
  • Order Details

Since

7.7
public static string
# wcap_get_price( string $price, string $currency )

Display Prices as per the currency selected during cart creation

Display Prices as per the currency selected during cart creation

Parameters

$price
Price to be displayed
$currency
Currency in which price needs to be displayed

Returns

string
modified price with currency symbol

Since

7.7
public static boolean
# wcap_validate_cart( mixed $cart_info )

Validate Cart and check if its not empty

Validate Cart and check if its not empty

Parameters

$cart_info
Cart Info Object

Returns

boolean
true if valid else false

Since

7.7.0
public static
# wcap_insert_cart_id( $cart_id )

Adds the Abandoned Cart ID to the list of carts for which SMS reminders need to be sent.

Adds the Abandoned Cart ID to the list of carts for which SMS reminders need to be sent.

Since

7.9
public static
# wcap_delete_cart_notification( integer $cart_id )

Removes the Cart ID from the list of carts for which SMS reminders need to be sent.

Removes the Cart ID from the list of carts for which SMS reminders need to be sent.

Parameters

$cart_id
  • Abandoned Cart ID

Since

7.9
public static integer
# get_user_id_from_cart( integer $cart_id )

Returns the User ID for a given abandoned cart ID

Returns the User ID for a given abandoned cart ID

Parameters

$cart_id
  • Abandoned Cart ID

Returns

integer
$user_id - User ID

Since

7.9
public static array
# get_guest_data( integer $user_id )

Returns the Guest user data for a given user ID from the Guest Table

Returns the Guest user data for a given user ID from the Guest Table

Parameters

$user_id
  • User ID

Returns

array
$guest - Array containing guest user details array

Since

7.9
public static integer
# get_recovered_id_for_user( integer $user_id )

Returns the recovered cart ID for an abadoned cart record for which the user ID is passed

Returns the recovered cart ID for an abadoned cart record for which the user ID is passed

Parameters

$user_id
  • User ID (Guest & Registered)

Returns

integer
$recovered_order - Recovered Order ID

Since

7.9
public static array
# wcap_country_code_map( )

Returns an array with mapped Country codes with ISD codes

Returns an array with mapped Country codes with ISD codes

Returns

array
Mapped Array

Since

7.9
API documentation generated by ApiGen