Skip to content

Instantly share code, notes, and snippets.

Avatar

WooCommerce.com Documentation woogist

View GitHub Profile
@woogist
woogist / functions.php
Created Jan 30, 2014
change contact details on superstore theme
View functions.php
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 Feb 3, 2014
register another versions of the secondary menu in canvas under the mobile nevigation area.
View function.sphp
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 Feb 3, 2014
styles for hiding and showing the secondary mobile menu in the right places
View custom.css
@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;
}
}
View wc-elavon-vm-custom-params.php
<?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 Feb 13, 2014
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/
View wc-product-documents-document-access.php
<?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 Feb 21, 2014
add email address and name to the home page contact form submitted email
View theme-actions.php
<?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 Mar 10, 2014
delicious magazine full width slider css
View gist:9465388
#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 Aug 29, 2015
Canvas v5.5.5+ menu right
View gist:9496581
/* 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 Mar 12, 2014
Chrome google font fix
View gist:9505075
<script type="text/javascript" charset="utf-8">
jQuery(function() { jQuery('body').hide().show(); });
</script>
@woogist
woogist / gist:9505104
Created Mar 12, 2014
Google font fix for chrome
View gist:9505104
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; }