Skip to content

Instantly share code, notes, and snippets.

View DanielSantoro's full-sized avatar

Danny Santoro DanielSantoro

View GitHub Profile
@DanielSantoro
DanielSantoro / functions.php
Created November 3, 2017 17:44
Automatically set orders to Processing
/**
* Set all WooCommerce orders to Processing
* Based on https://docs.woocommerce.com/document/automatically-complete-orders/
*/
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );
function custom_woocommerce_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}
@DanielSantoro
DanielSantoro / variation-price-display.php
Created October 13, 2017 20:10
Change Variation Price Range to "Starting Price: "
<?php
/*
* Change Variable Product Display Price to "From: ____" using minimum price
*/
function 171013_variable_price_format( $price, $product ) {
$prefix = sprintf('%s: ', __('Starting Price:', '171013'));
$min_price_regular = $product->get_variation_regular_price( 'min', true );
@DanielSantoro
DanielSantoro / lindseyfoard.php
Created October 12, 2017 19:01
Lindsey Foard PHP
<?php
/**
* Change the number of Related Products per Page to 5
*/
add_filter( 'woocommerce_output_related_products_args', 'lf_related_products_args', 20 );
function lf_related_products_args( $args ) {
$args['posts_per_page'] = 5; // 5 related products
$args['columns'] = 5; // arranged in 5 columns
return $args;
@DanielSantoro
DanielSantoro / lindseyfoard-alt.css
Created October 12, 2017 18:56
Lindsey Foard CSS Alternate
table.variations td#ed_wc_pa_choose-print-size .ed__variation__button__wrp {
max-width: 70px;
max-height: 70px;
display: inline-block;
float: left;
}
table.variations td#ed_wc_pa_choose-print-size .ed__variation__button__wrp label i {
font-size: 14px;
}
@DanielSantoro
DanielSantoro / lindseyfoard.css
Created October 12, 2017 18:53
Lindsey Foard CSS
/* This CSS will change the max box width in the selector from 100px to 70px. Note that it changes both sets of boxes so they're the same size - if you want to leave the framing options the 100px size, then use the modified CSS sheet. */
.ed__variation__button__wrp {
max-width: 70px;
max-height: 70px;
}
/* This command makes it so all of the 5 options for the sizes line up. */
table.variations td#ed_wc_pa_choose-print-size .ed__variation__button__wrp {
display: inline-block;
float: left;
}
@DanielSantoro
DanielSantoro / functions.php
Created October 11, 2017 15:12
Removes WooCommerce Reviews
<?php
add_filter( 'woocommerce_product_tabs', 'remove_wc_reviews_tab', 98 );
function remove_wc_reviews_tab($tabs) {
unset($tabs['reviews']);
return $tabs;
}
@DanielSantoro
DanielSantoro / storefrontparallaxherodemo.html
Last active October 9, 2017 17:52
Storefront Parallax Hero Demo Shortcode
[parallax_hero heading_text="Coats and Sweatshirts" description_text="Bundle up with some awesome Woo apparel!" description_text_color="white" background_img="https://path-to.img" alignment="left" parallax="0" overlay_color="#96588a" overlay_opacity=".25" layout="fixed" full_height="0" style="border: 1em solid #e6e6e6;"]
@DanielSantoro
DanielSantoro / fix.css
Created August 22, 2017 17:21
Storefront Modifications for halalsnoepen.nl
body.home span.posted-on, body.single span.posted-on, body.blog span.posted-on {
display: none;
}
body.home aside.entry-meta, body.single aside.entry-meta, body.blog aside.entry-meta {
display: none;
}
body.home .hentry.type-post .entry-content, body.single .hentry.type-post .entry-content, body.blog .hentry.type-post .entry-content {
width: 100%;
@DanielSantoro
DanielSantoro / button.css
Created August 1, 2017 18:27
Button Style
.wc-memberships-message .button {
background-color: #5b5b25;
padding: 10px;
border-radius: 10px;
font-weight: bold;
}
@DanielSantoro
DanielSantoro / style.css
Created July 14, 2017 16:09
Hide Password Hint
small.woocommerce-password-hint {
display: none;
}