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
// Get The Page ID You Need | |
get_option( 'woocommerce_shop_page_id' ); | |
get_option( 'woocommerce_cart_page_id' ); | |
get_option( 'woocommerce_checkout_page_id' ); | |
get_option( 'woocommerce_pay_page_id' ); | |
get_option( 'woocommerce_thanks_page_id' ); | |
get_option( 'woocommerce_myaccount_page_id' ); | |
get_option( 'woocommerce_edit_address_page_id' ); | |
get_option( 'woocommerce_view_order_page_id' ); | |
get_option( 'woocommerce_terms_page_id' ); |
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
// This will generate a private PEM | |
openssl genrsa -out PATH-LOCATION/file_name_private.pem 1024 | |
// Now extract public key from the private pem and save it to a file | |
openssl rsa -in PATH-LOCATION/file_name_private.pem -pubout > PATH-LOCATION/file_name_public.pem |
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
// Gravity Forms Custom Addresses (Australia) | |
// Credit: The Web Princess - http://thewebprincess.com/ | |
function australian_address( $address_types, $form_id ) { | |
$address_types['australia'] = array( | |
'label' => 'Australia', //labels the dropdown | |
'country' => 'Australia', //sets Australia as default country | |
'zip_label' => 'Post Code', //what it says | |
'state_label' => 'State', //as above | |
'states' => array( |
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 bd_woocommerce_quantity_input_args( $args, $product ) { | |
$args['input_value'] = 1; // Starting value | |
$args['max_value'] = 800; // Maximum value | |
$args['min_value'] = 1; // Minimum value | |
$args['step'] = 1; // Quantity steps | |
return $args; | |
} | |
add_filter( 'woocommerce_quantity_input_args', 'bd_woocommerce_quantity_input_args', 10, 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 the div to wrap the image on the archive pages | |
add_action( 'woocommerce_before_shop_loop_item_title', create_function('', 'echo "<div class=\"archive-img-wrap\">";'), 5, 2); | |
add_action( 'woocommerce_before_shop_loop_item_title',create_function('', 'echo "</div>";'), 12, 2); | |
// If there is sub categories on the archive page add a wrap around their images as well | |
add_action( 'woocommerce_before_subcategory_title', create_function( '', 'echo "<div class=\"sub-archive-img-wrapper\">";'), 5, 2 ); | |
add_action( 'woocommerce_before_subcategory_title', create_function( '', 'echo "</div>";' ), 12, 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
$('a').each(function () { | |
if ($(this).attr('target') == '_blank') { | |
if ($(this).attr('rel')) { | |
this.rel += ' noopener noreferrer'; | |
} else { | |
$('a').attr('rel', 'noopener noreferrer'); | |
} | |
}; | |
}); |
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 text before regular price and sale price | |
function bd_rrp_sale_price_html( $price, $product ) { | |
if ( $product->is_on_sale() ) : | |
$has_sale_text = array( | |
'<del>' => '<del>RRP: ', | |
'<ins>' => '<br>Sale Price: <ins>' | |
); | |
$return_string = str_replace(array_keys( $has_sale_text ), array_values( $has_sale_text ), $price); | |
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
// Replace WooCommerce product placeholder | |
function _custom_woocommerce_placeholder_img_src( $src ) { | |
$src = trailingslashit( get_template_directory_uri() ) . 'includes/images/placeholder.jpg'; // Change to required path and name | |
return $src; | |
} | |
add_filter( 'woocommerce_placeholder_img_src', '_custom_woocommerce_placeholder_img_src' ); |
NewerOlder