Be aware that it's not recommended to redirect or serve HTTP 404 for out of stock products. Read more in How to Optimize Out of Stock Product Pages.
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 | |
add_filter('woocommerce_correios_shipping_additional_time', function($additional_time, $package){ | |
$has_outofstock_item = false; | |
foreach( $package['contents'] as $item ) { | |
if ( 'onbackorder' === wc_get_product($item['product_id'])->get_stock_status() ){ | |
$has_outofstock_item = true; | |
break; |
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
A partir do painel de controle de sua conta, você pode ver suas <a href="%1$s">compras recentes</a>, gerenciar seus <a href="%2$s">endereços de entrega e cobrança</a>, e <a href="%3$s">edite sua senha e detalhes da conta</a>. |
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 | |
add_action('init', function(){ | |
function hide_correios_shipping_methods($rates, $package) { | |
$correios_methods_list = array( | |
'correios-pac', | |
'correios-sedex', | |
'correios-sedex10-envelope', | |
'correios-sedex10-pacote', |
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
Show hidden characters
// SublimeLinter Settings - User | |
{ | |
"paths": | |
{ | |
"linux": ["~/.config/composer/vendor/bin"] | |
} | |
} |
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 | |
function test_methods_array(){ | |
return [ | |
'wpmelhorenvio_Correios_PAC' => 'Encomenda normal', | |
'wpmelhorenvio_Correios_EXPRESSO' => 'Encomenda expressa', | |
'wpmelhorenvio_JadLog_.Com' => 'JadLog Bar', | |
'wpmelhorenvio_JadLog_.Package' => 'JadLog Foo', | |
]; |
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 | |
$args = array( | |
'post_type' => 'cardapio', | |
'posts_per_page' => 999, | |
'orderby' => 'title', | |
'order' => 'ASC', | |
'tax_query' => array( | |
array( | |
'taxonomy' => 'cardapio_category', | |
'field' => 'term_id', |
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
javascript: (function() { | |
var htmlStyle = document.documentElement.style; | |
var adminBarStyle = document.getElementById('wpadminbar').style; | |
if(undefined == window.hasAdminBar){ | |
window.hasAdminBar = true; | |
} | |
var cssText, display; |
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
source /opt/wp-completion.bash | |
export DEV=/var/www/html | |
export EDITOR=subl | |
export PS1="\[$(tput bold)\]\[\033[38;5;58m\]\u\[$(tput sgr0)\]\[\033[38;5;15m\]@\[$(tput sgr0)\]\[\033[38;5;58m\]\H\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\] [\t] \w \\$\n> \[$(tput sgr0)\]" | |
# function to set terminal title | |
function set-title() { | |
if [[ -z "$ORIG" ]]; then | |
ORIG=$PS1 |
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
using System.Data.Entity; | |
using System.Data.Entity.ModelConfiguration.Conventions; | |
namespace Test.Models { | |
public DbSet<Friendship> Friendships { get; set; } | |
protected override void OnModelCreating(DbModelBuilder modelBuilder) { | |
/* USER */ | |
modelBuilder.Entity<User>().HasMany(u => u.Friends).WithMany(); |