Skip to content

Instantly share code, notes, and snippets.

Marcio Duarte pagelab

Block or report user

Report or block pagelab

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View wc-ninja-conditional-checkout-fields.php
<?php
/**
* Plugin Name: Conditional WooCommerce Checkout Fields
* Description: Adds the abilitiy to conditionally show / hide checkout fields.
* Version: 1.0
* Author: Caleb Burks
* Author URI: http://calebburks.com
*/
@pagelab
pagelab / skip-to-check-out.php
Created Oct 8, 2019 — forked from micc83/skip-to-check-out.php
Skip cart and redirect to direct checkout on WooCommerce
View skip-to-check-out.php
<?php
/**
* Skip cart and redirect to direct checkout
*
* @package WooCommerce
* @version 1.0.0
* @author Alessandro Benoit
*/
// Skip the cart and redirect to check out url when clicking on Add to cart
View woocommerce-ajax-checkout-spinner.css
/*
* Custom AJAX spinner on WooCommerce checkout
* The class used to load the overlay is .blockUI .blockOverlay
* The class used to load the spinner is .woocommerce .loader:before
*
*/
.woocommerce .blockUI.blockOverlay:before,.woocommerce .loader:before {
height: 3em;
width: 3em;
position: absolute;
@pagelab
pagelab / functions.php
Created Sep 19, 2019
Adicionando um link de login/logout no menu principal do tema.
View functions.php
<?php // Don't add this line if inserting in a functions.php file.
add_filter( 'wp_nav_menu_items', function( $items, $args ) {
// Only used on main menu
if ( 'main_menu' != $args->theme_location ) {
return $items;
}
// Add custom item
@pagelab
pagelab / woocommerce_get_shop_page_permalink.php
Created Sep 11, 2019 — forked from jessepearson/woocommerce_get_shop_page_permalink.php
This will turn the shop page permalink into a link for the home page.
View woocommerce_get_shop_page_permalink.php
@pagelab
pagelab / remove_checkout_fields.php
Created Sep 5, 2019 — forked from cryptexvinci/remove_checkout_fields.php
Remove fields from WooCommerce checkout page.
View remove_checkout_fields.php
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' );
function custom_remove_woo_checkout_fields( $fields ) {
// remove billing fields
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_1']);
unset($fields['billing']['billing_address_2']);
@pagelab
pagelab / woocommerce-optimize-scripts.php
Created Sep 4, 2019 — forked from DevinWalker/woocommerce-optimize-scripts.php
Only load WooCommerce scripts on shop pages and checkout + cart
View woocommerce-optimize-scripts.php
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@pagelab
pagelab / functions.php
Created Sep 4, 2019 — forked from lukecav/functions.php
Add in a custom prefix and suffix to WooCommerce Order Number
View functions.php
add_filter( 'woocommerce_order_number', 'change_woocommerce_order_number', 1, 2);
function change_woocommerce_order_number( $order_id, $order ) {
$prefix = '#SAM-';
$suffix = '-' . date(Y);
return $prefix . $order->id . $suffix;
}
@pagelab
pagelab / functions.php
Created Aug 12, 2019 — forked from tessak22/functions.php
Hero Gutenberg Block using Advanced Custom Fields 5.8 Pro
View functions.php
/**
* Register hero block
*/
add_action('acf/init', 'hero');
function hero() {
// check function exists
if( function_exists('acf_register_block') ) {
// register a hero block
@pagelab
pagelab / wp-mailhog.php
Created Aug 5, 2019 — forked from bishless/wp-mailhog.php
Configure WordPress on Valet to use MailHog
View wp-mailhog.php
<?php
/**
* @link
* @since 1.0.0
* @package TODO
*
* @wordpress-plugin
* Plugin Name: Use MailHog
* Description: Configure WordPress on Valet to use MailHog
* Version: 1.0.0
You can’t perform that action at this time.