Skip to content

Instantly share code, notes, and snippets.

View mikeyarce's full-sized avatar

Mikey Arce mikeyarce

View GitHub Profile
@mikeyarce
mikeyarce / woocommerce-smallscreen-filter-breakpoint.php
Last active May 19, 2017 15:25
Change the breakpoint for woocommerce-smallscreen.css
// Don't add this opening PHP tag unless your file doesn't already have one
<?php
// Define a new breakpoint for woocommerce-smallscreen.css
function marce_filter_woocommerce_style_smallscreen_breakpoint( $breakpoint ) {
$breakpoint = '200px';
return $breakpoint;
};
add_filter( 'woocommerce_style_smallscreen_breakpoint', 'marce_filter_woocommerce_style_smallscreen_breakpoint', 10, 1 );
add_action( 'woocommerce_before_add_to_cart_button', 'marce_add_text', 20 );
function marce_add_text() {
echo '<p>Hello World.</p>';
}
@mikeyarce
mikeyarce / woocommerce-bookings-styles.css
Last active April 9, 2022 13:09 — forked from MindyPostoff/woocommerce-bookings-styles.css
Bookings Datepicker Color Styles
/*
Modify the color styles of the WooCommerce Bookings datepicker calendar.
Add any/all of these styles to your theme's custom CSS, but be sure to change
the color hex codes to your choice. They're all black here.
*/
/* Month header background color */
#wc-bookings-booking-form .wc-bookings-date-picker .ui-datepicker-header {
background-color: #000000;
}
.storefront-handheld-footer-bar ul li.search .site-search {
bottom: 100%;
}
.storefront-handheld-footer-bar {
top: 0;
}
.storefront-handheld-footer-bar ul li.search.active .site-search {
bottom::-6em;
}
<?php
if ( function_exists( 'wc_memberships_is_user_active_member' ) && wc_memberships_is_user_active_member( get_current_user_id(), 'Platinum' ) ) {
//all of the code for the shop archive is here
} else {
//here you would output something other than the shop loop, perhaps instructions on how to join and/or login
}
<?php
function wc_limit_account_menu_items() {
// Administrator and Shop Manager roles
if ( current_user_can( 'manage_woocommerce' ) ) {
$items = array(
'dashboard' => __( 'Dashboard', 'woocommerce' ),
'orders' => __( 'Orders', 'woocommerce' ),
// 'downloads' => __( 'Downloads', 'woocommerce' ),
'edit-address' => __( 'Addresses', 'woocommerce' ),
@mikeyarce
mikeyarce / storefront-custom-footer.php
Created October 11, 2016 18:02
Storefront Custom Footer Credit
@mikeyarce
mikeyarce / restrict.php
Created September 28, 2016 22:43
WooCommerce Memberships restrict through template
<?php
$user_id = get_current_user_id();
if ( wc_memberships_is_user_active_member( $user_id, 'gold' ) ) {
get_template_part( 'template', 'gold' );
} else {
echo "You are not allowed to view this content";
}
?>
jQuery( function( $ ) {
$(function() {
$pay_in_full = ( $('#wc-option-pay-full') );
console.log($pay_in_full.val());
if ( 'no' === $pay_in_full.val() ) {
$( '.wc-deposits-payment-plans' ).hide();
}
});
$( '.wc-deposits-wrapper' )
.on( 'change', 'input[name="wc_deposit_option"]', function() {
@mikeyarce
mikeyarce / storefront-full-width-slider.php
Last active June 24, 2017 00:43
Add a full-width slider to Storefront (meta slider in example)
// Don't copy this opening PHP tag if your file already has one. That breaks things.
<?php
function marce_slider_before_storefront_content () {
// If the template is not the homepage (template-homepage.php), don't display.
if ( ! is_page_template( 'template-homepage.php' ) ) {
return false;
}
// If it is the homepage, add this meta slider shortcode
echo do_shortcode( '[metaslider id=586]');