Skip to content

Instantly share code, notes, and snippets.

# WPFC NGINX CONFIGURATION
# DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee)
set $skip_cache 0;
# POST requests and URL with a query string should always go to php
if ($request_method = POST) {
set $skip_cache 1;
}
if ($query_string != "") {
set $skip_cache 1;
}
@juniorthiesen
juniorthiesen / wpfcwoo
Last active February 16, 2017 12:58
easyengine woocommerce
# WPFC NGINX WOOCOMMERCE CONFIGURATION
set $skip_cache 0;
# POST requests and URL with a query string should always go to php
if ($request_method = POST) {
set $skip_cache 1;
}
if ($query_string != "") {
/**
* arquivo class-wc-admin-post-types.php
* editar o arquivo para add o link do whatsapp
*/
if ( $the_order->get_billing_phone() ) {
$replacements = array( '(', ')', ' ', '-' );
$customer_whatsapp = str_replace( $replacements, '', $the_order->get_billing_phone() );
echo '<small class="meta"><a href="' . esc_url( 'https://api.whatsapp.com/send?phone=55' . $customer_whatsapp ) . '">' . esc_html( $the_order->get_billing_phone() ) . '</a></small>';
@juniorthiesen
juniorthiesen / functions.php
Created May 8, 2017 22:07
Add custom column to shop_order post type
<?php
function add_custom_column_to_shop_order( $columns ) {
$new_columns = is_array( $columns ) ? $columns : array();
$new_columns['software_key'] = __( 'WhatsApp' );
return $new_columns;
}
add_filter( 'manage_edit-shop_order_columns', 'add_custom_column_to_shop_order' );
function add_custom_column_value_to_shop_order( $column ) {
@juniorthiesen
juniorthiesen / functions.php
Created August 15, 2017 19:19
ADICIONA CAMPO DE NCM AO PRODUTO
// ADICIONA CAMPO DE NCM AO PRODUTO
add_action('add_meta_boxes', 'add_product_metaboxes');
// Add the Beast Selling Meta Boxes
function add_product_metaboxes()
{
add_meta_box('wc_ncm', 'NCM', 'wc_ncm', 'product', 'side', 'high');
}
function wc_ncm()
{
global $post;
@juniorthiesen
juniorthiesen / functions.php
Created August 15, 2017 19:25
Cria opção de filtro de rastreamento
//Cria opção de filtro de rastreamento
add_action( 'restrict_manage_posts', 'admin_posts_filter_restrict_manage_posts' );
function admin_posts_filter_restrict_manage_posts(){
$type = 'shop_order';
if (isset($_GET['post_type'])) {
$type = $_GET['post_type'];
}
if ('shop_order' == $type){
$values = array(
'Com' => 'tracking',
@juniorthiesen
juniorthiesen / style.css
Created August 17, 2017 19:15
css site duofashion
.attachment-shop_thumbnail.size-shop_thumbnail.wp-post-image {
border-width: 1px;
border-style: solid;
border-color: #d9d9d9;
}
#billing_country_field {
visibility: hidden;
}
@juniorthiesen
juniorthiesen / functions.php
Created September 18, 2017 14:57
add coluna para exportação csv
/**
* Add the custom column to the exporter and the exporter column menu.
*
* @param array $columns
* @return array $columns
*/
function add_export_column( $columns ) {
// column slug => column name
$columns['custom_column'] = 'Custom Column';
function ContactToGoogle() {
var nome = $('#Nome').val();
var email = $('#Email').val();
var telefone = $('#Telefone').val();
var pergunta1 = $('#pergunta1').val();
var pergunta2 = $('#pergunta2').val();
var pergunta3 = $('#pergunta3').val();
var pergunta4 = $('#pergunta4').val();
var pergunta5 = $('#pergunta5').val();
var pergunta6 = $('#pergunta6').val();
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name www.domain.com;
include /var/www/domain.com/conf/nginx/*.conf;
return 301 https://domain.com$request_uri;
}
server {
listen 443 ssl http2;