This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* This has not been tested, but should work in theory. Use with care. | |
*/ | |
/* | |
* Remove the default WooCommerce Action | |
* Valid actions include: | |
* woocommerce_before_checkout_billing_form | |
* woocommerce_after_checkout_billing_form |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function show_content_before_fields(){ | |
$contents = '<h1>Teilnehmer-Daten</h1>'; | |
$contents .= 'Conditional fields here:<br>'; | |
echo $contents; | |
} | |
add_action( 'cwcfp_before_checkout_fields', 'show_content_before_fields' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Our discounts are going to be applied to two products. In this case product IDs 54 & 55. Add/modify the $product_ids array as applicable. | |
* Both products will get the same tiered discounts but we don't want someone to buy 10 of product 54 and 1 of product 55 and get the discount for product 55. | |
* So, we need to create separate discounts only if the criteria is met for each product. | |
* The tiered discount will look like this: | |
* 10-24 of any single product = 25% discount | |
* 25-99 of any single product = 33% discount | |
* 100-249 of any single product = 40% discount | |
* 250-499 of any single product = 45% discount |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function show_before_field_group( $content, $repeat, $field_number ){ | |
return 'This is some <strong>test</strong> info that will show up before each group of fields'; | |
if( $repeat == 1 && $field_number == 2 ){ | |
return 'This is some <strong>test</strong> info will show up only before the first instance of the field with ID 2'; | |
} | |
} | |
add_filter( 'cwcfp_before_conditional_field_grouping', 'show_before_field_group', 10, 3 ); | |
function show_before_each_field_id_one( $content, $repeat, $field_number ){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wpcrm_system_new_calendar_entry( $calendar, $month, $list_day, $year ){ | |
// Display an entry on the calender on December 25th every year. | |
if ( $month == 12 && $list_day == 25 ){ | |
$calendar .= '<li>Christmas</li>'; | |
} | |
// Display an entry on the calendar on September 5th 2017 | |
if ( $month == 9 && $list_day == 5 && $year == 2017 ){ | |
$calendar .= '<li>This is a date specific entry</li>'; | |
} | |
// Display an entry on the calendar on the 15th of every month |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: WP-CRM System Create Task | |
Plugin URI: https://www.wp-crm.com | |
Description: Create a task in WP-CRM System. | |
Version: 1.0 | |
Author: Scott DeLuzio | |
Author URI: https://www.wp-crm.com | |
*/ | |
function wpcrm_system_programmatically_create_task() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'cwcfp_radio_input_filter', 'custom_radio_button_field', 10, 4 ); | |
function custom_radio_button_field( $option_key, $option_text, $key, $value ){ | |
$options = '<label class="radio-input block">' . $option_text . '</label><input type="radio" name="' . $key . '" id="' . $key . '" value="' . $option_key . '" ' . selected( $value, $option_key, false ) . 'class="select">' . $option_text . "\r\n"; | |
return $options; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'wpcrm_system_client_area_registration_redirect', 'my_url_redirect' ); | |
function my_url_redirect( $url ){ | |
$url = 'https://google.com'; | |
return $url; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* This will "normalize" the postcode entered by the customer, if the country seleced is Poland. | |
* Normalize meaning that it doesn't matter if they entered the post code as xx-xxx or xxxxx the | |
* function will be able to format it correctly. Once a "normalized" postcode is generated, the | |
* function will add a hyphen (-) in between the 2nd and 3rd numbers in the post code. | |
* This will always generate a xx-xxx formatted postcode. | |
*/ | |
add_filter( 'woocommerce_format_postcode', 'sd_add_poland_post_code_format', 10, 2 ); | |
function sd_add_poland_post_code_format( $postcode, $country ){ | |
$postcode = wc_normalize_postcode( $postcode ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'wpcrm_system_zapier_contact_data_filter', 'get_contacts_company_url' ); | |
function get_contacts_company_url( $data, $post_id ){ | |
// get the organization's ID number | |
$org_id = get_post_meta( $post_id, '_wpcrm_contact-attach-to-organization', true ); | |
// retrieve the organization's website URL and add to the $data array | |
$data['orgurl'] = get_post_meta( $org_id, '_wpcrm_organization-website', true ); | |
// return $data | |
return $data; | |
} |