Woocommecre Category Fix

jQuery(document).ready(function( $ ){ var checkCategory = jQuery(“body.archive.tax-product_cat .product-category”); if(checkCategory.length > 0){ jQuery(“body”).addClass(“only-products-cat”); } });Continue reading

Disable the “grab image” setting for Divi on checkout

add_filter( ‘et_grab_image_setting’, ‘prefix_disable_image_setting_on_checkout’, 100 ); /** * Disable the Divi image setting on checkout. * * @param bool $setting * @return bool */ function prefix_disable_image_setting_on_checkout( $setting ) { return edd_is_checkout() ? false : $setting; }Continue reading

Search Filter by Genre and Artist

add_action( ‘pre_get_posts’, ‘softcomplexmusic_custom_search_filter’ ); function softcomplexmusic_custom_search_filter( $query ) { if ( !is_admin() && $query->is_main_query() && $query->is_search ) { $tax_query = []; if ( !empty($_GET[‘genre’]) ) { $tax_query[] = array( ‘taxonomy’ => ‘genre’, // Ensure this matches your site’s taxonomy slug…Continue reading

Allow mixed cart support with Stripe Payment Elements

add_filter( ‘edd_gateway_supports’, ‘prefix_maybe_add_mixed_cart_support’, 999, 2 ); /** * Allow Stripe to support mixed carts. * Requires EDD 3.2.7. */ function prefix_maybe_add_mixed_cart_support( $supports, $gateway ) { if ( ‘stripe’ === $gateway ) { $supports[] = ‘mixed_cart’; } return $supports; }Continue reading

Prevent Duplicate Purchases

function pw_edd_prevent_duplicate_purchase( $valid_data, $posted ) { $cart_contents = edd_get_cart_contents(); foreach( $cart_contents as $item ) { if( edd_has_user_purchased( get_current_user_id(), $item[‘id’] ) ) { edd_set_error( ‘duplicate_item’, ‘You have already purchased this item so may not purchase it again’ ); } } }…Continue reading

Disable delayed customer recalculations

/** * Bypasses the CRON event that is scheduled 5 minutes after a purchase that recalculates a customers stats. * * Note: This may impact the performance of the checkout process. */ add_filter( ‘edd_recalculate_bypass_cron’, ‘__return_true’ );Continue reading

Increase After Order Actions Delay

add_filter( ‘edd_after_payment_actions_delay’, function( $delay ) { // Change this to the number of seconds you want to delay by. Suggested values are 60 or 90. $delay = 60; return $delay; } );Continue reading

Add Wallet Deposit Levels

function custom_wallet_desposit_levels( $levels ) { // add comma-separated deposit levels to default list // 2000 and 5000 are dollar value examples – adjust as needed $more_levels = array( ‘2000’, ‘5000’ ); return array_merge( $levels, $more_levels ); } add_filter( ‘edd_wallet_deposit_levels’, ‘custom_wallet_desposit_levels’…Continue reading