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

Packages

  • Abandoned-Cart-Lite-for-WooCommerce
    • Admin
      • Admin-Action
      • Admin-Notice
      • Component
      • Default-Template
      • List-Class
      • Tracking-Data
      • Welcome-Page
    • Common-Functions
    • Core
    • Cron
    • Encrypt-Decrypt-Data
    • Frontend
      • Capture-Guest-Cart
    • Tracking
    • Uninstaller
  • None

Classes

  • Class_Wcal_Ts_Tracker
  • TS_deactivate
  • TS_Faq_Support
  • ts_pro_notices
  • TS_Tracker
  • TS_tracking
  • TS_Welcome
  • TS_Woo_Active
  • WCAL_Abandoned_Orders_Table
  • Wcal_Admin_Notice
  • Wcal_Aes
  • Wcal_Aes_Ctr
  • Wcal_All_Component
  • wcal_common
  • wcal_default_template_settings
  • wcal_delete_bulk_action_handler
  • Wcal_Personal_Data_Eraser
  • Wcal_Personal_Data_Export
  • WCAL_Product_Report_Table
  • wcal_Recover_Orders_Table
  • WCAL_Templates_Table
  • Wcal_Tracking_msg
  • Wcal_TS_Tracking
  • Wcal_Welcome
  • woocommerce_abandon_cart_lite
  • woocommerce_guest_ac

Functions

  • guest_checkout_fields
  • load_ac_ajax
  • save_data
  • user_side_js
  • wcal_add_cron_schedule
  • wcal_send_email_cron
  • woocommerce_ac_delete_lite
 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 
<?php

/**
 * Abandoned Cart Lite for WooCommerce
 *
 * It will add the default template for the plugin.
 *
 * @author  Tyche Softwares
 * @package Abandoned-Cart-Lite-for-WooCommerce/Admin/Default-Template
 * @since 2.5
 */

class wcal_default_template_settings {
   
   /** 
    * This function will load default template while activating the plugin.
    * @globals mixed $wpdb 
    * @since 2.5
    */
   function wcal_create_default_templates() {
       global $wpdb;
       $template_name_array    = 'Initial';
       $site_title             = get_bloginfo( 'name' );
       $site_url               = get_option( 'siteurl' );
       $template_subject_array = $site_title . ": Did you have checkout trouble?"; 
       $active_post_array      = 0;
       $email_frequency_array  = 1;
       $day_or_hour_array      = 'Hours';
       $body_content_array     = addslashes( "<html>                                   
                                    <body>
                                       <p> Hello {{customer.fullname}}, </p>
                                       <p> &nbsp; </p>
                                       <p> We\'re following up with you, because we noticed that on {{cart.abandoned_date}} you attempted to purchase the following products on $site_title. </p>
                                       <p> &nbsp; </p>
                                       <p> {{products.cart}} </p>
                                       <p> &nbsp; </p>
                                       <p> If you had any purchase troubles, could you please Contact to share them? </p>
                                       <p> &nbsp; </p>
                                       <p> Otherwise, how about giving us another chance? Shop <a href= $site_url >$site_title</a>. </p>
                                       <hr></hr>
                                       <p> You may <a href='{{cart.unsubscribe}}'>unsubscribe</a> to stop receiving these emails. </p> 
                                       <p> &nbsp; </p>
                                       <p> <a href=$site_url>$site_title</a> appreciates your business.  </p>
                                    </body>
                                </html>" );
       $is_wc_template          =  1 ;
       $default_template        =  1;
       
       $query = "INSERT INTO `" . $wpdb->prefix . "ac_email_templates_lite`
           ( subject, body, is_active, frequency, day_or_hour, template_name, is_wc_template, default_template )
           VALUES ( '" . $template_subject_array . "',
                   '" . $body_content_array . "',
                   '" . $active_post_array . "',
                   '" . $email_frequency_array . "',
                   '" . $day_or_hour_array . "',
                   '" . $template_name_array . "',
                   '" . $is_wc_template . "',
                   '" . $default_template . "' )";
       $wpdb->query( $query );      
   }
}
API documentation generated by ApiGen