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 ($) { | |
| var AddMask = { | |
| masks: { | |
| phone: function(value) { | |
| var new_value = '', | |
| value = this.number(value); | |
| if (value.length <= 0) { | |
| new_value = ''; | |
| } else if (value.length < 3) { |
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 | |
| /** | |
| * | |
| * Plugin Name: WooCommerce Enable Reviews - Bulk Edit | |
| * Description: Allow enable reviews by bulk edit into WooCommerce | |
| * Version: 1.0.0 | |
| * Author: Mário Valney | |
| * Author URI: http://mariovalney.com | |
| * Text Domain: woo-enable-reviews-bulk-edit | |
| * |
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 | |
| /** | |
| * Adiciona as taxas ao subtotal no carrinho | |
| */ | |
| function vta_cart_item_subtotal( $wc, $cart_item, $cart_item_key ) { | |
| $_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key ); | |
| $subtotal = wc_get_price_including_tax( $_product, array( 'qty' => $cart_item['quantity'] ) ); |
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 putDots(num) { | |
| if (num == 0) { | |
| return "0" | |
| } else { | |
| return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "."); | |
| } | |
| } | |
| function putDotsToMoney(num) { | |
| num = parseFloat(num); |
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 | |
| /** | |
| * ContentFactory | |
| * Classe responsável pela criação de conteúdo personalizado | |
| * | |
| * @author Mário Valney <[email protected]>. | |
| */ | |
| if (!defined( 'ABSPATH' )) { |
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 | |
| /** | |
| * Função que checa se um CPF é válido | |
| * Criado em fevereiro/2016 | |
| */ | |
| function check_cpf_is_valid( $string ) { | |
| $cpf = pm_sanitize_number($string); |
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 validateCPF(number) { | |
| var cpf = number.toString().replace(/[^0-9]/g, ''); | |
| if (cpf.length != 11) { | |
| return false; | |
| } | |
| var digitoTestado = cpf.slice(9, 11); | |
| var digitoValidado = ''; | |
| var sum1 = sum2 = dig1 = dig2 = 0; |
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 change_post_type_slug() { | |
| $post_type_portfolio_object = get_post_type_object( 'portfolio' ); | |
| $post_type_portfolio_object->rewrite['slug'] = 'produto'; | |
| register_post_type( $post_type_object->name, $post_type_object ); | |
| } | |
| add_action( 'init', 'change_post_type_slug', 20 ); |
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
| $.fn.scroller = function(offsetTop) { | |
| if (offsetTop == null) { | |
| offsetTop = 0; | |
| } | |
| this.each( function() { | |
| var id = this.id; | |
| $("a[href=#" + id + "]").on('click', function(event) { | |
| event.preventDefault(); |