Class Wcap_Common
It will have all the common function needed all over the plugin.
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. |
public static
integer
|
|
public static
integer
|
#
wcap_get_loggedin_abandoned_carts( )
It will fetch the total abandoned cart of the logged in users. |
public static
integer
|
|
public static
integer
|
|
public static
integer
|
|
public static
integer
|
#
wcap_get_loggedin_user_abandoned_cart_amount( )
It will fetch all the loggedin user abandoned cart amount. |
public static
integer
|
#
wcap_get_guest_user_abandoned_cart_amount( )
It will fetch all the Guest user abandoned cart amount. |
public static
integer
|
#
wcap_get_loggedin_user_recovered_cart_amount( )
It will fetch all the loggedin user recovered cart amount. |
public static
integer
|
#
wcap_get_guest_user_recovered_cart_amount( )
It will fetch all the Guest user recovered cart amount. |
public static
string
|
#
wcap_get_amount( array $wcap_result )
It will fetch the Abandoned and Recovered orders total amount. |
public static
integer
|
|
public static
array
|
|
public static
array
|
|
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. |
public static
string
|
|
public static
array
|
|
public static
array
|
|
public static
|
#
wcap_check_user_can_manage_woocommerce( )
Check if user have the permission to access the WooCommerce pages. |
public static
string
|
|
public static
|
|
public static
|
|
public static
string
|
|
public static
string
|
|
public static
string
|
|
public static
string
|
|
public static
string
|
|
public static
integer|string
|
|
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. |
public static
string
|
|
public static
string
|
|
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. |
public static
integer
|
#
wcap_set_session_expiring( integer $seconds )
We have changed the WooCommerce session expiration date. |
public static
integer
|
#
wcap_set_session_expired( integer $seconds )
We have changed the WooCommerce session expiration date. |
public static
|
|
public static
|
|
public static
string
|
#
wcap_get_client_ip( )
We will return the customers IP address. We are using the WooCommerce geoloctaion. |
public static
string
|
|
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. |
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. |
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. |
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. |
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. |
public static
integer
|
#
wcap_get_abandoned_order_count( string $get_section_result )
It will give you the total abandoned carts. |
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. |
public static
string
|
|
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. |
public static
strinig
|
#
wcap_replace_email_body_merge_code( string $body_email_preview )
It will replace the email body merge codes with content. |
public static
string
|
|
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 |
public static
string
|
|
public static
string
|
#
wcap_from_address( string $from_address )
Add the From Emails for WooCommerce Template Emails via Filters |
public static
|
#
wcap_add_wc_mail_header( )
Add the From Name and Emails for WooCommerce Template Emails via Filters |
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 |
public static
|
|
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 |
public static
|
#
wcap_add_restrict_user_meta_field( object $user )
It will restrict the user and do not capture the cart. |
public static
|
#
wcap_save_restrict_user_meta_field( integer|string $wcap_user_id )
Save the setting for the user restriction setting. |
public static
|
#
wcap_set_plaintext_body( PHPMailer $phpmailer )
It will add the plain text in the Abanodned cart reminder emails. |
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 |
public static
string
|
#
wcap_get_price( string $price, string $currency )
Display Prices as per the currency selected during cart creation |
public static
boolean
|
|
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. |
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. |
public static
integer
|
|
public static
array
|
#
get_guest_data( integer $user_id )
Returns the Guest user data for a given user ID from the Guest Table |
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 |
public static
array
|