Skip to content

Instantly share code, notes, and snippets.

View stacklast's full-sized avatar
:electron:
Keep It Simple!

Edwin Benalcázar E. stacklast

:electron:
Keep It Simple!
View GitHub Profile
@stacklast
stacklast / woocomerce-add-back-button-on-single-product.php
Created July 9, 2021 23:56
[WooComerce] - Add Back Button on the top before Sigle Product content
<?php
add_action( 'woocommerce_before_single_product', 'my_function_sample', 10);
function my_function_sample() {
global $product;
echo ' <button style="margin-top: 1.5em;" class="weforms_submit_btn" type="button" onclick="history.back();"> Go Back </button>' ;
}
@stacklast
stacklast / wp-change-any-text.php
Created July 9, 2021 23:52
[WordPress] - Change text founded for any other text
<?php
add_filter('gettext', 'translate_text');
add_filter('ngettext', 'translate_text');
function translate_text($translated) {
$translated = str_ireplace('También te recomendamos', 'Productos Relacionados', $translated);
return $translated;
}
@stacklast
stacklast / woocomerce-add-text-after-before-price.php
Created July 9, 2021 23:45
[WooComerce] - Add Text After and Before the Price Value
<?php
// add text after and before price value
add_filter( 'woocommerce_get_price_html', 'text_after_price' );
function text_after_price($price){
global $post;
$text_to_add_after_price = '/Mes + IVA';
$text_to_add_before_price = 'Desde ';
return $text_to_add_before_price . $price . $text_to_add_after_price;
}
@stacklast
stacklast / woocomerce-rename-single-product-tabs.php
Last active July 9, 2021 23:44
[WooComerce] - Rename Titles Tabs on Single Product
<?php
// Woocomerce Versión 5.4.1 tested with astra theme
// Rename Title Tabs on Single Product
add_filter( 'woocommerce_product_tabs', 'woo_rename_tabs', 98 );
function woo_rename_tabs( $tabs ) {
$tabs['description']['title'] = __( 'Características' ); // Rename the description tab
//$tabs['reviews']['title'] = __( 'Ratings' ); // Rename the reviews tab
$tabs['additional_information']['title'] = __( '¿Qué incluye este renting?' ); // Rename the additional information tab
return $tabs;
}
@stacklast
stacklast / validar_cedula_ecuador.js
Created April 24, 2020 17:26 — forked from vickoman/validar_cedula_ecuador.js
Algoritmo para validar cedulas ecuatorianas.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script>
<script>
$(function(){
/**
* Algoritmo para validar cedulas de Ecuador
* @Author : Victor Diaz De La Gasca.
* @Fecha : Quito, 15 de Marzo del 2013
* @Email : vicmandlagasca@gmail.com
* @Pasos del algoritmo