1. Documenation
  2. Finale WooCommerce Sales Countdown Timer & Scheduler
  3. How To
  4. How to Set default field values of a Campaign?

How to Set default field values of a Campaign?

You can set default campaign fields values. So that set one will come every time you open the page.

Follow this gist, add respective code in active theme functions.php file or add using Snippets plugin.

<?php
/**
* Look into wcct-common class function 'get_default_settings' for other fields
*/
add_filter( 'wcct_campaign_fields_default', 'themename_finale_set_default_campaign_arguments' );
function themename_finale_set_default_campaign_arguments( $default ) {
/**
* Look into wcct-common class function 'get_default_settings' for other fields
*/
$default['_wcct_campaign_type'] = 'fixed_date';
$default['_wcct_campaign_fixed_recurring_start_date'] = date( 'Y-m-d' );
$default['_wcct_campaign_fixed_recurring_start_time'] = '12:00 AM';
$default['_wcct_campaign_fixed_end_date'] = date( 'Y-m-d', strtotime( '+5 days', time() ) );
$default['_wcct_campaign_fixed_end_time'] = '12:00 AM';
$default['_wcct_campaign_recurring_duration_days'] = '1';
$default['_wcct_campaign_recurring_duration_hrs'] = '0';
$default['_wcct_campaign_recurring_duration_min'] = '0';
$default['_wcct_campaign_recurring_gap_days'] = '1';
$default['_wcct_campaign_recurring_gap_hrs'] = '0';
$default['_wcct_campaign_recurring_gap_mins'] = '0';
$default['_wcct_campaign_recurring_ends'] = 'never';
$default['_wcct_campaign_recurring_ends_after_x_days'] = '5';
$default['_wcct_data_end_date_of_deal'] = date( 'Y-m-d', strtotime( '+30 days', time() ) );
$default['_wcct_data_end_time_of_deal'] = '12:00 AM';
$default['_wcct_deal_enable_price_discount'] = '0';
$default['_wcct_deal_amount'] = '5';
$default['_wcct_deal_type'] = 'percentage';
$default['_wcct_deal_mode'] = 'simple';
$default['_wcct_deal_enable_goal'] = '0';
$default['_wcct_deal_custom_mode'] = 'basic';
$default['_wcct_deal_units'] = 'custom';
$default['_wcct_deal_custom_mode'] = 'basic';
$default['_wcct_deal_custom_units'] = '8';
$default['_wcct_deal_range_from_custom_units'] = '8';
$default['_wcct_deal_range_to_custom_units'] = '16';
$default['_wcct_deal_threshold_units'] = '0';
$default['_wcct_deal_end_campaign'] = 'no';
$default['_wcct_deal_inventory_goal_for'] = 'campaign';
$default['_wcct_deal_custom_units_allow_backorder'] = 'no';
$default['_wcct_coupons_enable'] = '0';
$default['_wcct_coupons_apply_mode'] = 'auto';
$default['_wcct_coupons_is_expire'] = 'yes';
$default['_wcct_coupons_is_hide_errors'] = 'yes';
$default['_wcct_coupons_success_message'] = __( 'Instant Offer: Congratulations you just unlocked a lower price. Claim this offer in {{countdown_timer}}', 'finale-woocommerce-sales-countdown-timer-discount' );
$default['_wcct_coupons_failure_message'] = __( 'Sorry! Instant Offer has expired.', 'finale-woocommerce-sales-countdown-timer-discount' );
$default['_wcct_coupons_cart_message'] = __( 'Instant Offer Expires in {{countdown_timer}}', 'finale-woocommerce-sales-countdown-timer-discount' );
$default['_wcct_coupons_empty_cart_message'] = __( 'Please add the product(s) in your cart to avail Instant Offer.', 'finale-woocommerce-sales-countdown-timer-discount' );
$default['_wcct_coupons_notice_after_add_to_cart'] = 'no';
$default['_wcct_coupons_notice_show'] = 'all';
$default['_wcct_location_timer_show_single'] = '0';
$default['_wcct_location_timer_single_location'] = '4';
$default['_wcct_appearance_timer_single_skin'] = 'highlight_1';
$default['_wcct_appearance_timer_single_bg_color'] = '#ffffff';
$default['_wcct_appearance_timer_single_text_color'] = '#dd3333';
$default['_wcct_appearance_timer_single_font_size_timer'] = '26';
$default['_wcct_appearance_timer_single_font_size'] = '14';
$default['_wcct_appearance_timer_single_label_days'] = 'days';
$default['_wcct_appearance_timer_single_label_hrs'] = 'hrs';
$default['_wcct_appearance_timer_single_label_mins'] = 'mins';
$default['_wcct_appearance_timer_single_label_secs'] = 'secs';
$default['_wcct_appearance_timer_single_display'] = '{{countdown_timer}}\nPrices go up when the timer hits zero';
$default['_wcct_appearance_timer_single_border_style'] = 'none';
$default['_wcct_appearance_timer_single_border_width'] = '1';
$default['_wcct_appearance_timer_single_border_color'] = '#dd3333';
$default['_wcct_appearance_timer_mobile_reduction'] = '90';
$default['_wcct_appearance_timer_single_delay_hrs'] = '48';
$default['_wcct_location_bar_show_single'] = '0';
$default['_wcct_location_bar_single_location'] = '4';
$default['_wcct_appearance_bar_single_skin'] = 'stripe_animate';
$default['_wcct_appearance_bar_single_edges'] = 'rounded';
$default['_wcct_appearance_bar_single_orientation'] = 'rtl';
$default['_wcct_appearance_bar_single_bg_color'] = '#dddddd';
$default['_wcct_appearance_bar_single_active_color'] = '#ee303c';
$default['_wcct_appearance_bar_single_height'] = '14';
$default['_wcct_appearance_bar_single_display'] = 'Hurry up! Just <span>{{remaining_units}}</span> items left in stock\n{{counter_bar}}';
$default['_wcct_appearance_bar_single_border_style'] = 'none';
$default['_wcct_appearance_bar_single_border_width'] = '1';
$default['_wcct_appearance_bar_single_border_color'] = '#dd3333';
$default['_wcct_appearance_bar_single_delay_item'] = '1';
$default['_wcct_location_timer_show_sticky_header'] = '0';
$default['_wcct_appearance_sticky_header_wrap_bg'] = '#000000';
$default['_wcct_appearance_sticky_header_headline'] = 'Great time to visit us today!';
$default['_wcct_appearance_sticky_header_headline_font_size'] = '24';
$default['_wcct_appearance_sticky_header_headline_color'] = '#ffffff';
$default['_wcct_appearance_sticky_header_description'] = '';
$default['_wcct_appearance_sticky_header_description_font_size'] = '15';
$default['_wcct_appearance_sticky_header_description_color'] = '#ffffff';
$default['_wcct_appearance_sticky_header_skin'] = 'round_fill';
$default['_wcct_appearance_sticky_header_bg_color'] = '#444444';
$default['_wcct_appearance_sticky_header_text_color'] = '#ffffff';
$default['_wcct_appearance_sticky_header_font_size_timer'] = '18';
$default['_wcct_appearance_sticky_header_font_size'] = '13';
$default['_wcct_appearance_sticky_header_label_days'] = 'days';
$default['_wcct_appearance_sticky_header_label_hrs'] = 'hrs';
$default['_wcct_appearance_sticky_header_label_mins'] = 'mins';
$default['_wcct_appearance_sticky_header_label_secs'] = 'secs';
$default['_wcct_appearance_sticky_header_timer_border_style'] = 'none';
$default['_wcct_appearance_sticky_header_timer_border_width'] = '1';
$default['_wcct_appearance_sticky_header_timer_border_color'] = '#444444';
$default['_wcct_appearance_sticky_header_timer_mobile_reduction'] = '90';
$default['_wcct_appearance_sticky_header_timer_position'] = 'center';
$default['_wcct_appearance_sticky_header_button_skin'] = 'button_1';
$default['_wcct_appearance_sticky_header_button_text'] = 'Get the Offer';
$default['_wcct_appearance_sticky_header_button_bg_color'] = '#d7fe3a';
$default['_wcct_appearance_sticky_header_button_text_color'] = '#000000';
$default['_wcct_appearance_sticky_header_delay'] = '1';
$default['_wcct_location_timer_show_sticky_footer'] = '0';
$default['_wcct_appearance_sticky_footer_wrap_bg'] = '#000000';
$default['_wcct_appearance_sticky_footer_headline'] = 'Grab this latest Offer only for YOU, Expiring soon!';
$default['_wcct_appearance_sticky_footer_headline_font_size'] = '24';
$default['_wcct_appearance_sticky_footer_headline_color'] = '#ffffff';
$default['_wcct_appearance_sticky_footer_description'] = '';
$default['_wcct_appearance_sticky_footer_description_font_size'] = '15';
$default['_wcct_appearance_sticky_footer_description_color'] = '#ffffff';
$default['_wcct_appearance_sticky_footer_skin'] = 'round_fill';
$default['_wcct_appearance_sticky_footer_bg_color'] = '#444444';
$default['_wcct_appearance_sticky_footer_text_color'] = '#ffffff';
$default['_wcct_appearance_sticky_footer_font_size_timer'] = '18';
$default['_wcct_appearance_sticky_footer_font_size'] = '13';
$default['_wcct_appearance_sticky_footer_label_days'] = 'days';
$default['_wcct_appearance_sticky_footer_label_hrs'] = 'hrs';
$default['_wcct_appearance_sticky_footer_label_mins'] = 'mins';
$default['_wcct_appearance_sticky_footer_label_secs'] = 'secs';
$default['_wcct_appearance_sticky_footer_timer_border_style'] = 'none';
$default['_wcct_appearance_sticky_footer_timer_border_width'] = '1';
$default['_wcct_appearance_sticky_footer_timer_border_color'] = '#444444';
$default['_wcct_appearance_sticky_footer_timer_mobile_reduction'] = '90';
$default['_wcct_appearance_sticky_footer_timer_position'] = 'center';
$default['_wcct_appearance_sticky_footer_button_skin'] = 'button_1';
$default['_wcct_appearance_sticky_footer_button_text'] = 'Get the Offer';
$default['_wcct_appearance_sticky_footer_button_bg_color'] = '#d7fe3a';
$default['_wcct_appearance_sticky_footer_button_text_color'] = '#000000';
$default['_wcct_appearance_sticky_footer_delay'] = '1';
$default['_wcct_location_show_custom_text'] = '0';
$default['_wcct_location_custom_text_location'] = '4';
$default['_wcct_appearance_custom_text_description'] = '';
$default['_wcct_appearance_custom_text_text_color'] = '#444444';
$default['_wcct_appearance_custom_text_font_size'] = '16';
$default['_wcct_appearance_custom_text_border_style'] = 'dotted';
$default['_wcct_appearance_custom_text_border_width'] = '3';
$default['_wcct_appearance_custom_text_border_color'] = '#dd3333';
$default['_wcct_misc_add_to_cart_btn_text'] = 'Get it now';
$default['_wcct_misc_cookie_expire_time'] = '1800';
$default['_wcct_misc_timer_label_days'] = 'days';
$default['_wcct_misc_timer_label_hrs'] = 'hrs';
$default['_wcct_misc_timer_label_mins'] = 'mins';
$default['_wcct_misc_timer_label_secs'] = 'secs';
return $default;
}

How can we help?

  • Please go through extensive documentation

    If you are still unable to find answers feel free to raise the ticket.

    For any pre-sales questions please fill out the Contact Form.

  • Drop files here or
  • Relevant links where issue can be seen. For example: link of the product page