This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\\script para gerar e salvar um pdf dentro do drive. | |
function onOpen() { | |
SpreadsheetApp | |
.getUi() | |
.createMenu('Gerar PDF') | |
.addItem('Gerar PDF', 'printpdf') | |
.addToUi(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add custom column (Custo) to shop_order post type | |
*/ | |
function add_custom_column_to_wc_orders_list($columns){ | |
$new_columns = (is_array($columns)) ? $columns : array(); | |
$new_columns['wc_cog_order_total_cost'] = __('Custo'); | |
return $new_columns; | |
} | |
add_filter('manage_edit-shop_order_columns', 'add_custom_column_to_wc_orders_list'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_check_cart_items', 'spyr_set_min_total' ); | |
function spyr_set_min_total() { | |
if( is_cart() || is_checkout() ) { | |
global $woocommerce; | |
$minimum_cart_total = 31; | |
$total = WC()->cart->subtotal; | |
if( $total <= $minimum_cart_total ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# WPSINGLE BASIC NGINX CONFIGURATION | |
server { | |
server_name ebeard.com.br www.ebeard.com.br; | |
access_log /var/log/nginx/ebeard.com.br.access.log rt_cache; | |
error_log /var/log/nginx/ebeard.com.br.error.log ; | |
root /var/www/ebeard.com.br/htdocs; | |
index index.php index.htm index.html; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add new register fields for WooCommerce registration. | |
* | |
* @return string Register fields HTML. | |
*/ | |
function cs_wc_extra_register_fields() { | |
?> | |
<p class="form-row form-row-first"> | |
<label for="reg_billing_first_name"><?php _e( 'Nome', 'textdomain' ); ?> <span class="required">*</span></label> | |
<input type="text" class="input-text" name="billing_first_name" id="reg_billing_first_name" value="<?php if ( ! empty( $_POST['billing_first_name'] ) ) esc_attr_e( $_POST['billing_first_name'] ); ?>" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* WooCommerce | |
* -------------------------- | |
* Remover a barra de admin dos clientes | |
*/ | |
if (!current_user_can('administrator')): | |
show_admin_bar(false); | |
endif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Order product collections by stock status, instock products first. | |
*/ | |
class iWC_Orderby_Stock_Status | |
{ | |
public function __construct() | |
{ | |
// Check if WooCommerce is active | |
if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* WooCommerce | |
* -------------------------- | |
* redireionar direto para o carrinho depois de click em comprar | |
*/ | |
function redirect_cart_to_checkout() { | |
wp_redirect( get_permalink( get_option( 'woocommerce_checkout_page_id' ) ) ); | |
exit; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Begin Custom Scripting to Move JavaScript from the Head to the Footer | |
function remove_head_scripts() { | |
remove_action('wp_head', 'wp_print_scripts'); | |
remove_action('wp_head', 'wp_print_head_scripts', 9); | |
remove_action('wp_head', 'wp_enqueue_scripts', 1); | |
add_action('wp_footer', 'wp_print_scripts', 5); | |
add_action('wp_footer', 'wp_enqueue_scripts', 5); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define ( 'AUTOMATIC_UPDATER_DISABLED', true ); | |
define( 'WP_MEMORY_LIMIT','128M' ); | |
define('WP_POST_REVISIONS' false); |
OlderNewer