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( 'wcasn_form_fields', 'wcasn_custom_form_fields' ); | |
function wcasn_custom_form_fields( $order_id ) { ?> | |
<label>Nota Fiscal</label> | |
<input type="text" name="nota_fiscal" class="wcasn-custom-fields" value="" /> | |
<?php } | |
add_filter( 'wc_any_shipping_notify_shipping_company_url', 'filter_wcasn_custom_url_fields', 20, 4 ); | |
function filter_wcasn_custom_url_fields( $url, $slug, $tracking_code, $order ) { | |
if ( $custom_url = $order->get_meta( '_wcasn_' . $tracking_code . '_custom_url' ) ) { | |
return $custom_url; |
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('wp_footer', 'image_swap_on_hover_script'); | |
function image_swap_on_hover_script() { | |
if (!is_product()) return; | |
?> | |
<script> | |
jQuery(document).ready(function($) { | |
$(window).load(function() { | |
$('.flexslider').flexslider({ | |
animation: "slide", | |
controlNav: "thumbnails", |
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
function sv_add_my_account_order_actions( $actions, $order ) { | |
$trackingCode = $order->get_meta('_wc_any_shipping_notify_tracking_code'); | |
if(!empty($trackingCode)) { | |
$actions['help'] = array( | |
// adjust URL as needed | |
'url' => 'https://englobasistemas.com.br/sistema/gestao/Rastreamento.html?chaveNfe=' . key($trackingCode), | |
'name' => __( 'Rastreio', 'my-textdomain' ), | |
); | |
} |
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
var destination = "instagram://user?username={USERNAME}"; | |
if( navigator.userAgent.match(/Android/i) ) { | |
// use Android's redirect | |
document.location = destination; | |
} | |
else { | |
// use iOS redirect | |
window.location.replace( destination ); | |
} |
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
function my_wc_free_shipping_by_shipping_class( $rates, $package ) { | |
$shipping_class = 'entrega-gratuita'; // Slug da sua classe de entrega. | |
$allow_free_shipping = true; | |
// Verifica se todos os produtos precisam ser entregues e se possuem a class de entrega selecionada. | |
foreach ( $package['contents'] as $value ) { | |
$product = $value['data']; | |
if ( $product->needs_shipping() && $shipping_class !== $product->get_shipping_class() ) { | |
$allow_free_shipping = false; |
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
/** | |
* Triggers Purchase for payment transaction complete and for the thank you page in cases of delayed payment. | |
* | |
* @param int $order_id order identifier | |
*/ | |
public function inject_purchase_event( $order_id ) { | |
if ( ! self::$isEnabled || $this->pixel->check_last_event( 'Purchase' ) ) { | |
return; | |
} |
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 | |
// Set cookie for new users | |
add_action( 'init', 'set_newuser_cookie'); // Run when WordPress loads | |
function set_newuser_cookie() { | |
$cookie_value = $_SERVER["HTTP_REFERER"]; // Get URL the user came to your site for | |
if ( !is_admin() && !isset($_COOKIE['origin'])) { // If not an admin or if cookie doesn't exist already | |
setcookie( 'origin', $cookie_value, time()+3600*24*30, COOKIEPATH, COOKIE_DOMAIN, false); // Set cookie for 30 days | |
setcookie( 'utm_source', sanitize_key( $_GET['utm_source'] ), time() + ( 3 * 86400 ), COOKIEPATH, COOKIE_DOMAIN ); |
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
<html> | |
<head> | |
<script type="text/javascript"> | |
setTimeout(function(){window.top.location="ifood://restaurant/COLA-AQUI-O-CODIGO} , 1000); | |
</script> | |
</head> | |
<body class="vsc-initialized">Conectando ao melhor restaurante... | |
</body> | |
</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
.attachment-shop_thumbnail.size-shop_thumbnail.wp-post-image { | |
border-width: 1px; | |
border-style: solid; | |
border-color: #d9d9d9; | |
background-color: #ffffff; | |
} | |
#pass-strength-result.short { | |
display: none !important; | |
} |
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
/** | |
* 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')))) { | |
add_filter('posts_clauses', array($this, 'order_by_stock_status'), 2000); |