Skip to content

Instantly share code, notes, and snippets.

View nickkuijpers's full-sized avatar

Nick Kuijpers nickkuijpers

View GitHub Profile
@nickkuijpers
nickkuijpers / gist:5d07ecf9b0a0678b4f4c
Created April 17, 2015 15:21
WooCommerce Bootstrap Checkout Form
add_filter('woocommerce_checkout_fields', 'addBootstrapToCheckoutFields' );
function addBootstrapToCheckoutFields($fields) {
foreach ($fields as &$fieldset) {
foreach ($fieldset as &$field) {
// if you want to add the form-group class around the label and the input
$field['class'][] = 'form-group';
// add form-control to the actual input
$field['input_class'][] = 'form-control';
@nickkuijpers
nickkuijpers / gist:6851e047050f5087ca38
Last active August 29, 2015 14:19
Unyson Get Value
// settings page
$footerid = fw_get_db_settings_option('element');
// get page option
$post_id = get_the_ID();
$o = fw_get_db_post_option($post_id, 'opdrachtgever', $default_value = null);
@nickkuijpers
nickkuijpers / gist:18dd4c7f0b23316467ab
Created April 14, 2015 22:09
WooCommerce Change Terms Positions Above Button
.woocommerce #payment #place_order, .woocommerce-page #payment #place_order {
position:relative;
top:80px;
}
#payment .terms {
position:relative;
top:-40px;
}
@nickkuijpers
nickkuijpers / gist:6a6d19dd6cddb85827fb
Created April 12, 2015 16:49
WooCommerce Cart Info
<a href="<?php echo WC()->cart->get_cart_url(); ?>" class="mini-card-icon">
<?php echo sprintf (_n( '%d', '%d', WC()->cart->cart_contents_count ), WC()->cart->cart_contents_count ); ?>
</a>
<?php
$imagearray = wp_get_attachment_image_src( get_post_thumbnail_id(), 'medium' );
?>
<a href="<?php the_permalink(); ?>">
<img class="img-responsive" src="<?php echo $imagearray[0]; ?>">
</a>
@nickkuijpers
nickkuijpers / gist:4f6988646f24f8155302
Created April 12, 2015 12:53
WooCommerce get Attribute
global $product;
$merk = $product->get_attribute( 'pa_merk' );
@nickkuijpers
nickkuijpers / gist:2c6d11921bd40d6497e3
Created April 12, 2015 10:58
WooCommerce Rating HTML
/**
* Change WooCommerce rating output
*/
add_action('woocommerce_after_shop_loop_item', 'get_star_rating' );
function get_star_rating()
{
global $woocommerce, $product;
@nickkuijpers
nickkuijpers / gist:60791e65ec0670bdd952
Created April 5, 2015 19:05
.htaccess HTTPS 2 HTTP Redirection
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
@nickkuijpers
nickkuijpers / gist:ec3daaa88a021d81e8d7
Created March 29, 2015 20:41
jQuery Make sure all JS is loaded before executing
document.addEventListener( "DOMContentLoaded", function() {
JS
}, false );
@nickkuijpers
nickkuijpers / gist:21766f42cf8989b2c01e
Created March 24, 2015 10:07
.htaccess redirection
Redirect 301 /path http://newdomain.com