Skip to content

Instantly share code, notes, and snippets.

@DevinVinson
DevinVinson / cart-on-checkout
Created March 31, 2013 15:32
Add the woocommerce cart on top of the checkout page.
// Add Cart to Checkout //
add_action( 'woocommerce_before_checkout_form', 'lk_show_cart', 5 );
function lk_show_cart()
{
global $woocommerce;
?>
<form action="<?php echo esc_url( $woocommerce->cart->get_cart_url() ); ?>" method="post">
@DevinVinson
DevinVinson / gist:6238339
Created August 15, 2013 04:49
Function based on this topic http://wordpress.org/support/topic/restrict-payment-options-based-on-product Small changes and fix to get the function to loop through all categories
/**
*
* Filter gateways on specific category ID
*
**/
function filter_gateways($gateways){
@DevinVinson
DevinVinson / Unset woocommerce gateway for specific country
Created August 15, 2013 04:53
Remove woocommerce gateways for $country, remove gateways for anything else
function lk_aussie_gateways( $available_gateways ) {
global $woocommerce;
if ($woocommerce->customer->get_country() == 'AU') {
unset( $available_gateways['cod'] );
}
return $available_gateways;
@DevinVinson
DevinVinson / gist:7175338
Created October 26, 2013 22:32
Custom page template for Enfold
<?php
/*
* Template Name: Example Custom Template
* See the codex entry on custom template for more information: http://codex.wordpress.org/Page_Templates#Custom_Page_Template
*
* Add html above or below the_content inside the comments
* Add php snippets as well with their own opening and closing php
*/
global $avia_config, $post;
<ol>
<li>
<div class="fade-in one">
<div class="box" style="background:#d10000;"></div>
</div>
</li>
<li>
<div class="fade-in two">
<div class="box" style="background:#ff6622;"></div>
@DevinVinson
DevinVinson / template-fullwidth.php
Created November 19, 2013 04:47
Full width Template for Enfold
<?php
/*
* Template Name: Full width
* See the codex entry on custom template for more information: http://codex.wordpress.org/Page_Templates#Custom_Page_Template
*
* Add html above or below the_content inside the comments
* Add php snippets as well with their own opening and closing php
*/
global $avia_config, $post;
@DevinVinson
DevinVinson / Print.css
Last active December 20, 2016 15:52
Print.css working file for Enfold
/*
* Print Styling
*/
.page-break { display: block; page-break-before: always; }
p, a, strong{
color: black !important;
}
a{
@DevinVinson
DevinVinson / gist:9266284
Created February 28, 2014 06:25
Change single product page to have right sidebar
#
# wrap single product image in an extra div
#
add_action( 'woocommerce_before_single_product_summary', 'avia_add_image_div', 2);
add_action( 'woocommerce_before_single_product_summary', 'avia_close_image_div', 20);
function avia_add_image_div()
{
echo "<div class='four units single-product-main-image alpha'>";
}
@DevinVinson
DevinVinson / gist:9559479
Created March 14, 2014 23:51
Change the Enfold single product page layout
#
# wrap single product image in an extra div
#
add_action( 'woocommerce_before_single_product_summary', 'avia_add_image_div', 2);
add_action( 'woocommerce_before_single_product_summary', 'avia_close_image_div', 20);
function avia_add_image_div()
{
echo "<div class='four units single-product-main-image alpha'>";
}
@DevinVinson
DevinVinson / designer.html
Last active August 29, 2015 14:18
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;