Skip to content

Instantly share code, notes, and snippets.

<?php echo $order->email_order_items_table( array(
'show_sku' => $sent_to_admin,
'show_image' => false,
'image_size' => array( 32, 32 ),
'plain_text' => $plain_text,
'sent_to_admin' => $sent_to_admin
) ); ?>
#featured-content .entry-author {
display: none;
}
.post.type-post .entry-author {
display: none;
}
.site-title a, .header-left .site-description, .main-header a, .main-header a:hover {
color: #fff;
}
.navbar-trigger .icon-bar, .navbar-trigger:hover .icon-bar {
background-color: #fff;
}
@SirDarcanos
SirDarcanos / untitled
Created November 6, 2015 10:04
functions.php
add_action( 'woocommerce_checkout_order_processed', 'log_ninja_forms_error' );
function log_ninja_forms_error( $order_id ) {
$log = new WC_Logger();
$log->add( 'ninja-test', 'Order #' . $order_id . ' - ' . $_SERVER['HTTP_USER_AGENT'] );
}
@SirDarcanos
SirDarcanos / untitled
Created November 6, 2015 10:03
functions.php
add_action( 'woocommerce_checkout_order_processed', 'log_ninja_forms_error' );
function log_ninja_forms_error() {
$log = new WC_Logger();
$log->add( 'ninja-test', $_SERVER['HTTP_USER_AGENT'] );
}
@SirDarcanos
SirDarcanos / functions.php
Created October 27, 2015 10:30
temporary fix upstart cart
/**
* Cart link
*/
function woo_wc_cart_link() {
?>
<a class="cart-contents" href="<?php echo WC()->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>"><?php echo WC()->cart->get_cart_subtotal(); ?> <span class="count"><?php echo sprintf( _n('%d item', '%d items', WC()->cart->get_cart_contents_count(), 'woothemes' ), WC()->cart->get_cart_contents_count() );?></span></a>
<?php
}
/* Date */
#wc-bookings-booking-form .wc-bookings-date-picker span.label {
color: #FF0000;
}
/* Month / Year */
#wc-bookings-booking-form .wc-bookings-date-picker .ui-datepicker .ui-datepicker-title {
color: #FF0000;
}
add_filter( 'woocommerce_product_tabs', 'woo_rename_vendor_tab', 20 );
function woo_rename_vendor_tab( $tabs ) {
if ( isset( $tabs['vendor'] ) ) {
$tabs['vendor']['title'] = __( 'Your Label Here' );
}
return $tabs;
}
add_action( 'woocommerce_process_product_meta', 'wc_custom_save_custom_fields' );
function wc_custom_save_custom_fields( $post_id ) {
if ( ! empty( $_POST['_custom_text_field'] ) ) {
update_post_meta( $post_id, '_custom_text_field', esc_attr( $_POST['_custom_text_field'] ) );
}
}
add_action( 'woocommerce_product_options_general_product_data', 'wc_custom_add_custom_fields' );
function wc_custom_add_custom_fields() {
// Print a custom text field
woocommerce_wp_text_input( array(
'id' => '_custom_text_field',
'label' => 'Custom Text Field',
'description' => 'This is a custom field, you can write here anything you want.',
'desc_tip' => 'true',
'placeholder' => 'Custom text'
) );