Skip to content

Instantly share code, notes, and snippets.

View bolderelements's full-sized avatar

Erica Dion bolderelements

View GitHub Profile
@bolderelements
bolderelements / betrs-add-dimensions-sum-condition.php
Last active December 4, 2017 04:08
Add new condition to Table Rate settings page
/**
* Add ability to compare the sum of all dimensions to Table Rate shipping
* https://codecanyon.net/item/table-rate-shipping-for-woocommerce/3796656?ref=bolderelements
*
* Code should be added to theme's functions.php file
*/
function betrs_add_dimensions_sum_cond( $conditions ) {
// add new option to list
$conditions['dimensions_sum'] = 'Dimensions Sum';
@bolderelements
bolderelements / form-restocking.php
Last active January 27, 2018 02:12
Restocking Form Override (No Hooks)
<?php
// Add restocking form container
if( class_exists( 'BE_Product_Alerts_Form_Restocking' ) ) {
// check if enabled
$bepa_settings = get_option( 'woocommerce_product-alerts-restocking_settings' );
if( ! is_admin() && $bepa_settings['enabled'] !== 'no' ) {
// check if the single product is out of stock
if( ! $product->is_type( 'variable' ) && ! $product->is_in_stock() ) {