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 new_custom_price_html( $price, $product ){ | |
return 'De: ' . str_replace( ' <ins>', ' Por: <ins> ', $price ); | |
} | |
add_filter( 'woocommerce_get_price_html', 'new_custom_price_html', 100, 2 ); |
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 custom_variable_price_html( $price, $product ) { | |
$price = ''; | |
if ( ! $product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) { | |
$price .= '<span class="from">' . __( 'A partir de' ) . ' </span>'; | |
} | |
$price .= woocommerce_price( $product->get_price() ); | |
if ( $product->max_variation_price && $product->max_variation_price !== $product->min_variation_price ) { |
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 | |
// hide coupon on cart | |
function hide_coupon_on_cart( $enabled ) { | |
if ( is_cart() ) { | |
$enabled = false; | |
} | |
return $enabled; | |
} | |
add_filter( 'woocommerce_coupons_enabled', 'hide_coupon_on_cart' ); |
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 | |
add_action( 'woocommerce_thankyou', 'redirectcustom'); | |
function redirectcustom( $order_id ){ | |
$order = new WC_Order( $order_id ) | |
$url = 'http://marcelototoso.com/custom-url'; | |
if ( $order->status != 'failed' ) { | |
wp_redirect($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
function variable_price_html_custom_text( $price, $product ) { | |
$price = ''; | |
if ( ! $product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) { | |
$price .= '<span class="from">' . __( 'A partir de' ) . ' </span>'; | |
} | |
$price .= woocommerce_price( $product->get_price() ); | |
if ( $product->max_variation_price && $product->max_variation_price !== $product->min_variation_price ) { | |
$price .= '<span class="to"> ' . __( 'até' ) . ' </span>'; | |
$price .= woocommerce_price( $product->max_variation_price ); | |
} |
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 variable_price_html_custom( $price, $product ) { | |
$price = ''; | |
if ( ! $product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) { | |
$price .= '<span class="from">' . __( 'À partir de' ) . ' </span>'; | |
} | |
$price .= woocommerce_price( $product->get_price() ); | |
return $price; |
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
#!/bin/bash | |
echo $1 | grep "http" >/dev/null;chx=$? | |
if [ $chx -eq 0 ];then | |
hostx=$1 | |
else | |
hostx="http://$1" | |
fi | |
echo "Scan $hostx" | |
FCK="rev" |
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 | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly | |
global $post, $product; | |
if ( ! $product->is_in_stock() ) return; | |
$sale_price = get_post_meta( $product->id, '_price', true); | |
$regular_price = get_post_meta( $product->id, '_regular_price', true); | |
if (empty($regular_price)){ | |
$available_variations = $product->get_available_variations(); | |
$variation_id=$available_variations[0]['variation_id']; | |
$variation= new WC_Product_Variation( $variation_id ); |
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
.percentage-bubble { | |
left: 0px; | |
position: absolute; | |
text-transform: uppercase; | |
top: 20px; | |
z-index: 9; | |
} | |
.percentage-bubble .percentage { | |
background-color: #e74c3c; |
NewerOlder