This file contains 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
import random | |
# Roll6 function to return random number between 1 and 6 | |
def roll6(): | |
return(random.randint(1,6)) | |
# Roll16 function to call Roll6 function thrice | |
# Our range with 3 dices are 3 - 18, so I am deducting 2 to set the range from 1 to 16 | |
def roll16(): | |
value = (roll6() + roll6() + roll6()) - 2 |
This file contains 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
add_filter( 'woocommerce_cart_item_price', 'kd_custom_price_message' ); | |
add_filter( 'woocommerce_cart_item_subtotal', 'kd_custom_price_message' ); | |
add_filter( 'woocommerce_cart_subtotal', 'kd_custom_price_message' ); | |
add_filter( 'woocommerce_cart_total', 'kd_custom_price_message' ); | |
function kd_custom_price_message( $price ) { | |
$afterPriceSymbol = ' Inc. GST'; | |
return $price . $afterPriceSymbol; | |
} |
This file contains 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
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<style> | |
@page { | |
margin: 480px 50px 150px 50px; | |
} | |
#header { | |
position: fixed; | |
left: 0px; |
This file contains 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 woocommerce_quantity_input() { | |
global $product; | |
$defaults = array( | |
'input_name' => 'quantity', | |
'input_value' => '1', | |
'max_value' => apply_filters( 'woocommerce_quantity_input_max', '20000', $product ), | |
'min_value' => apply_filters( 'woocommerce_quantity_input_min', '1000', $product ), | |
'step' => apply_filters( 'woocommerce_quantity_input_step', '1000', $product ), | |
'style' => apply_filters( 'woocommerce_quantity_style', 'float:left; margin-right:10px;', $product ) | |
); |
This file contains 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
add_action( 'after_setup_theme', 'woocommerce_support' ); | |
function woocommerce_support() { | |
add_theme_support( 'woocommerce' ); | |
} |
This file contains 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
//change the number of Products per page to 12 | |
add_filter( 'loop_shop_per_page', 'change_number_of_products', 20, 1); | |
function change_number_of_products( $cols ) { | |
return 12; | |
} |
This file contains 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
//Enable Tax for local Pickup | |
add_filter( 'woocommerce_apply_base_tax_for_local_pickup', '__return_false' ); |
This file contains 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
// Change the number of Wishlists being displayed | |
add_filter( 'woocommerce_wishlist_posts_per_page', 'change_wishlist_number', 10, 1 ); | |
function change_wishlist_number( $number ){ | |
return 14; //use required number here | |
} |
This file contains 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
// define the woocommerce_coupon_message callback | |
function filter_woocommerce_coupon_message( $msg, $msg_code, $instance ) | |
{ | |
$msg = "Yeah thanks!"; | |
return $msg; | |
}; | |
// add the filter | |
add_filter( 'woocommerce_coupon_message', 'filter_woocommerce_coupon_message', 10, 3 ); |
This file contains 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
// Simple products | |
add_filter( 'woocommerce_quantity_input_args', 'jk_woocommerce_quantity_input_args', 10, 2 ); | |
function jk_woocommerce_quantity_input_args( $args, $product ) { | |
$args['input_value'] = 3; // Starting value | |
$args['max_value'] = 12; // Maximum value | |
$args['min_value'] = 3; // Minimum value | |
$args['step'] = 3; // Quantity steps | |
return $args; | |
} |
NewerOlder