This file contains 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 | |
/** | |
* Store terms and conditions value within the database | |
**/ | |
add_action('woocommerce_checkout_update_order_meta', 'woo_save_terms_and_conditions_status'); | |
function woo_save_terms_and_conditions_status( $order_id ) { | |
if ($_POST['terms']) update_post_meta( $order_id, '_terms', esc_attr($_POST['terms'])); | |
} |
This file contains 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 | |
/** | |
* Search by SKU or ID for products. Adapted from code by BenIrvin (Admin Search by ID) | |
* | |
* @access public | |
* @param mixed $wp | |
* @return void | |
*/ | |
function woocommerce_admin_product_search( $wp ) { | |
global $pagenow, $wpdb; |
This file contains 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
/* French initialisation for the jQuery UI date picker plugin. */ | |
/* Written by Keith Wood (kbwood{at}iinet.com.au), | |
Stéhane Nahmani (sholby@sholby.net), | |
Stéphane Raimbault <stephane.raimbault@gmail.com> */ | |
jQuery(function($){ | |
$.datepicker.regional['fr'] = { | |
closeText: 'Fermer', | |
prevText: 'Précédent', | |
nextText: 'Suivant', | |
currentText: 'Aujourd\'hui', |
This file contains 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 | |
/** | |
* Is the user a paying customer? | |
* | |
* @access public | |
* @return bool | |
*/ | |
function is_paying_customer( $user_id ) { | |
This file contains 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 your own function to filter the fields | |
add_filter( 'submit_donation_form_fields', 'custom_submit_donation_form_fields' ); | |
// This is your function which takes the fields, modifies them, and returns them | |
// You can see the fields which can be changed in: includes/forms/class-wpdonations-form-submit-donation.php | |
function custom_submit_donation_form_fields( $fields ) { | |
// Here we target one of the donation fields (donation_amount) and change it's label | |
$fields['donation']['donation_amount']['label'] = "Custom Label"; |
This file contains 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 your own function to filter the fields | |
add_filter( 'submit_donation_form_fields', 'remove_submit_donation_form_fields' ); | |
// This is your function which takes the fields, modifies them, and returns them | |
// You can see the fields which can be changed in: includes/forms/class-wpdonations-form-submit-donation.php | |
function remove_submit_donation_form_fields( $fields ) { | |
// Here we remove one of the donation fields (donation_campaign) | |
unset($fields['donation']['donation_campaign']); |
This file contains 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 your own function to filter the fields | |
add_filter( 'submit_donation_form_fields', 'add_submit_donation_form_fields' ); | |
// This is your function which takes the fields, modifies them, and returns them | |
// You can see the fields which can be changed in: includes/forms/class-wpdonations-form-submit-donation.php | |
function add_submit_donation_form_fields( $fields ) { | |
// Here we register the new field | |
$fields['donor']['donor_phone'] = array( | |
'label' => __('Phone', 'wpdonations'), |
This file contains 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
.progress.striped .bar { | |
background-color: #e844b4 !important; | |
} |
This file contains 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( 'donation_available_amounts', 'my_custom_amounts' ); | |
function my_custom_amounts() { | |
$options = array( | |
'5' => '5', | |
'10' => '10', | |
'20' => '20', | |
'30' => '30', | |
'40' => '40', | |
'50' => '50' |
This file contains 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_action( 'woocommerce_archive_description', 'woocommerce_category_image', 2 ); | |
function woocommerce_category_image() { | |
if ( is_product_category() ){ | |
global $wp_query; | |
$cat = $wp_query->get_queried_object(); | |
$thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true ); | |
$image = wp_get_attachment_url( $thumbnail_id ); |
OlderNewer