Skip to content

Instantly share code, notes, and snippets.

@LeoLopesWeb
LeoLopesWeb / functions.php
Created August 13, 2018 21:39
esconde o campo de cupom se já estiver um ativo
add_filter( 'woocommerce_coupons_enabled', 'woocommerce_coupons_enabled_checkout' );
function woocommerce_coupons_enabled_checkout( $coupons_enabled ) {
global $woocommerce;
if ( ! empty( $woocommerce->cart->applied_coupons ) ) {
return false;
}
return $coupons_enabled;
}
@LeoLopesWeb
LeoLopesWeb / js.js
Created August 29, 2018 18:18
desabilitar submit se o campo estiver vazio
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
// By default submit is disabled
$('.btn').prop('disabled', true);
$('.search').keyup(function() {
if($(this).val().length !=0 ) {
<a target="_blank" href="whatsapp://send?text=TEXTO e URL">whatsapp</a>
add_action('init', 'remove_parent_theme_shortcodes');
function remove_parent_theme_shortcodes() {
remove_shortcode( 'ux_image_box' );
add_shortcode( 'ux_image_box', 'ux_image_box_custom' );
}
<?php
add_action('init', 'remove_parent_theme_shortcodes');
function remove_parent_theme_shortcodes() {
remove_shortcode( 'blog_posts' );
add_shortcode( 'blog_posts', 'blog_posts_custom' );
}
function blog_posts_custom($atts) {
add_action( 'init', 'bbloomer_delay_remove' );
function bbloomer_delay_remove() {
remove_action( 'flatsome_category_title_alt', 'woocommerce_result_count', 20 );
remove_action( 'flatsome_category_title_alt', 'woocommerce_catalog_ordering', 30 );
}