Skip to content

Instantly share code, notes, and snippets.

View woogist's full-sized avatar

WooCommerce.com Documentation woogist

View GitHub Profile
@woogist
woogist / functions.php
Created January 30, 2014 12:28
change contact details on superstore theme
function superstore_contact() {
global $woo_options;
?>
<ul class="contact">
<?php if ( isset($woo_options['woo_contact_number']) && $woo_options['woo_contact_number'] != '' ) { ?><li class="phone"><a href="tel:<?php echo esc_html( $woo_options['woo_contact_number'] ); ?>"><?php echo esc_html( $woo_options['woo_contact_number'] ); ?></a></li><?php } ?>
<?php if ( isset($woo_options['woo_contact_fax']) && $woo_options['woo_contact_fax'] != '' ) { ?><li class="fax"><?php echo esc_html( $woo_options['woo_contact_fax'] ); ?></li><?php } ?>
<?php if ( isset( $woo_options['woo_contact_twitter'] ) && $woo_options['woo_contact_twitter'] != '' ) { ?><li class="twitter"><a href="http://twitter.com/<?php echo esc_attr( $woo_options['woo_contact_twitter'] ); ?>">@<?php echo esc_html( $woo_options['woo_contact_twitter'] ); ?></a></li><?php } ?>
@woogist
woogist / function.sphp
Created February 3, 2014 12:29
register another versions of the secondary menu in canvas under the mobile nevigation area.
add_action( 'woo_nav_inside', 'woo_custom_add_secondary_menu_to_mobile_nav', 10 );
function woo_custom_add_secondary_menu_to_mobile_nav () {
$menu_location = 'secondary-menu'; // Change this to be whichever menu location you want to add.
if ( has_nav_menu( $menu_location ) ) {
echo '<div id="' . $menu_location . '-container-mobile" class="col-full custom-menu-location">' . " ";
echo '<h3 class="secondary-menu">Secondary Menu</h3>';
@woogist
woogist / custom.css
Created February 3, 2014 12:32
styles for hiding and showing the secondary mobile menu in the right places
@media only screen and (min-width: 768px) {
/* Desktop styles go below this line */
#secondary-menu-container{
display: block !important;
}
#secondary-menu-container-mobile{
display: none !important;
}
}
<?php
add_filter( 'wc_payment_gateway_elavon_vm_request_xml', 'wc_payment_gateway_elavon_vm_add_custom_fields', 10, 2 );
function wc_payment_gateway_elavon_vm_add_custom_fields( $request_xml, $request ) {
$request_xml->addChild( 'ssl_name_on_card', str_replace( array( '&', '<', '>' ), '', $request->ssl_first_name . ' ' . $request->ssl_last_name ) );
return $request_xml;
}
@woogist
woogist / wc-product-documents-document-access.php
Created February 13, 2014 20:57
Add the following to your theme's functions.php to show product documents only for logged in users. Note that this is a very simple example, and could be expanded upon to show documents only for a particular user role, only for particular products, anything! http://www.woothemes.com/products/product-documents/
<?php
add_filter( 'wc_product_documents_get_sections', 'show_documents_only_for_logged_in_users', 10, 3 );
/**
* Don't return document sections unless there is a logged in user.
*
* @param array $sections array of sections
* @param WC_Product_Documents_Collection $collection the collection object
* @param boolean $include_empty whether to include empty sections in the result
@woogist
woogist / theme-actions.php
Created February 21, 2014 06:16
add email address and name to the home page contact form submitted email
<?php
if ( ! defined( 'ABSPATH' ) ) exit;
/*-----------------------------------------------------------------------------------
TABLE OF CONTENTS
- Theme Setup
- Load style.css in the <head>
- Load responsive <meta> tags in the <head>
@woogist
woogist / gist:9465388
Created March 10, 2014 13:56
delicious magazine full width slider css
#slide-nav {display: none !important }
#slides_container { width: 960px !important }
.slide { width: 960px !important }
.slide img { width: 960px !important }
.slide .caption { width: 950px !important }
@woogist
woogist / gist:9496581
Last active August 29, 2015 13:57
Canvas v5.5.5+ menu right
/* DESKTOP STYLES
-----------------
Add styles inside the media query below that you only want to be applied to the desktop layout of your site */
@media only screen and (min-width: 768px) {
/* Desktop styles go below this line */
#header {
float: left !important;
max-width: 20%;
position: absolute !important;
@woogist
woogist / gist:9505075
Created March 12, 2014 11:27
Chrome google font fix
<script type="text/javascript" charset="utf-8">
jQuery(function() { jQuery('body').hide().show(); });
</script>
@woogist
woogist / gist:9505104
Created March 12, 2014 11:30
Google font fix for chrome
body {
-webkit-animation-duration: 0.1s;
-webkit-animation-name: fontfix;
-webkit-animation-iteration-count: 1;
-webkit-animation-timing-function: linear;
-webkit-animation-delay: 0.1s;
}
@-webkit-keyframes fontfix {
from{ opacity: 1; }