Skip to content

Instantly share code, notes, and snippets.

View rickslayer's full-sized avatar
🏠
Working from home

PAULO RICARDO RUBE DE ALMEIDA rickslayer

🏠
Working from home
View GitHub Profile
@rickslayer
rickslayer / rck_remove_product_meta_wc.php
Last active September 12, 2018 15:00
Remove Product Meta from Woocommerce Product Page
/* Remove product meta on page product*/
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
@rickslayer
rickslayer / rck_change_title_separator_wordpress.php
Created September 12, 2018 23:40
Change the separator title site Wordpress
// Change the separator title site
// Mudar o separador do título do site
add_filter( 'document_title_separator', 'change_title_separator' );
function change_title_separator() {
return '|';
}
@rickslayer
rickslayer / rck_remove_tabs_product_wc.php
Created September 12, 2018 23:42
Remove tabs on products woocommerce page
// Remove the additional information tab
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['additional_information'] );
return $tabs;
}
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
@rickslayer
rickslayer / rck_remove_password_strength_wc.php
Created September 12, 2018 23:43
Remove strength password register user woocommerce
// Remove strength password register woocommerce
function fa_remove_password_strength() {
wp_dequeue_script( 'wc-password-strength-meter' );
wp_deregister_script( 'wc-password-strength-meter' );
}
add_action( 'wp_enqueue_scripts', 'fa_remove_password_strength', 99999 );
@rickslayer
rickslayer / rck_show_newest_reviews_product_on_top_wc.php
Last active December 17, 2020 22:46
Show newest product reviews on top Woocommerce Product page
// MOSTRAR OS REVIEWS DE PRODUTOS NO WOOCOMMERCE DO MAIS NOVO PRO MAIS VELHO
add_filter( 'woocommerce_product_review_list_args', 'newest_reviews_first' );
function newest_reviews_first($args) {
$args['reverse_top_level'] = true;
return $args;
}
@rickslayer
rickslayer / rck_add_element_before_cart_button_wc.php
Created September 12, 2018 23:47
Add any HTML element before cart button on product page
//adiciona botão na página do produto
//add button before cart button on product page
function botao_medida()
{
echo 'any HTML element';
}
add_action('woocommerce_before_add_to_cart_button', 'botao_medida', 11);
@rickslayer
rickslayer / rck_angular_shortcuts_tips.txt
Last active September 18, 2018 22:03
Angular Atalhos e dicas
//Run server
ng serve
//Create project
ng new nameproject
//Create new component
ng generate component namecomponent
short version: ng g c namecomponent
@rickslayer
rickslayer / rck_input_number_with_maxlength.html
Created September 13, 2018 22:47
Input number com maxlength
<p>Number Input</p>
<input type="number" id="el_number" min="1" max="99" maxlength="2" />
<style>
input{
width : 200px;
height: 30px;
}
</style>
<script>
let numb = document.getElementById("el_number");
@rickslayer
rickslayer / rck_style_woocommerce.css
Last active September 15, 2018 14:03
Oculta campos país, estado e cidade no calculo de frete no carrinho do Woocommerce
/* força mostrar o formulário de cálculo de frete no carrinho */
.shipping-calculator-form{
display:block !important;
}
/*Oculta os campos de país, estado e cidade*/
.shipping-calculator-button,
#calc_shipping_country_field,
#calc_shipping_state_field,
#calc_shipping_city_field{
display: none !important;
@rickslayer
rickslayer / rck_Ship_to_a_different_address_wc.php
Created March 2, 2019 20:30
Retirar o checkbox marcado como padrão endereço de cobrança no Checkout Woocommerce
<?php
add_filter( 'woocommerce_ship_to_different_address_checked', '__return_true' );
?>