Skip to content

Instantly share code, notes, and snippets.


Bruno ANTUNES bantunesm

View GitHub Profile
DWboutin / functions.php
Created Aug 18, 2014
Woocommerce get regular and sale price
View functions.php
function the_product_price($product){
//get the sale price of the product whether it be simple, grouped or variable
$sale_price = '<span class="new">'.get_post_meta( get_the_ID(), '_price', true).'</span>';
//get the regular price of the product, but of a simple product
$regular_price = get_post_meta( get_the_ID(), '_regular_price', true);
//oh, the product is variable to $sale_price is empty? Lets get a variation price
claudiosanches / functions.php
Last active Jun 4, 2022
WooCommerce - Add Order Again button to My Orders actions
View functions.php
* Add order again button in my orders actions.
* @param array $actions
* @param WC_Order $order
* @return array
function cs_add_order_again_to_my_orders_actions( $actions, $order ) {
if ( $order->has_status( 'completed' ) ) {
lopspower /
Last active Jan 30, 2023
Hexadecimal color code for transparency

Hexadecimal color code for transparency


How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

smutek / content-page.blade.php
Last active Feb 16, 2022
Simple Sage 9 Slider with Slick
View content-page.blade.php
webdados / shop_as_client_pro_customer_data.php
Last active Feb 24, 2022
How to add custom fields to the Shop as Client PRO add-on ajax call
View shop_as_client_pro_customer_data.php
/* Add this to you (child-)theme functions.php file, on a (mu-)plugin or with a plugin like Code Snippets */
add_filter( 'shop_as_client_pro_customer_data', 'my_shop_as_client_pro_customer_data', 10, 3 );
function my_shop_as_client_pro_customer_data( $data, $customer = null, $order = null ) {
//Are we getting a "customer" object?
if ( $customer ) {
//Custom checkout field with id "billing_xpto"
$data['billing']['xpto'] = $customer->get_meta( 'billing_xpto' );
kepano / obsidian-web-clipper.js
Last active Jan 30, 2023
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
View obsidian-web-clipper.js
javascript: Promise.all([import(''), import(''), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */