Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Teo Dereta

    (@tdereta)

    One other thing I noticed is that embedded videos and uploaded audio files open in Komplex-Layout with no problems, but PDFs show a broken image icon in Komplex-Layout. Do you know why? Look at your demo site, the same problem https://odude.com/demo/flexi/flexi/sample-pdf-file/

    Thank you!

    Thread Starter Teo Dereta

    (@tdereta)

    The embedding is too complicated for users who don’t have a clue what they are doing. Thanks anyway! I will wait for the update.

    Thread Starter Teo Dereta

    (@tdereta)

    I tried the code, but it doesn’t work. I’ll try other solutions. Thanks anyway!

    Thread Starter Teo Dereta

    (@tdereta)

    Hi Andrew,

    Thank you for your reply!

    Yes, I have already tried your suggestion and switched it to “no”. But then all products including the memberships are affected because it says “Apply Member Discounts to Woocommerce subscriptions and Membership Products”. All products in my woocommerce are membership products. If it only affected memberships, than it would be a solution.

    I googled a little bit and found your code snippet on github that finally resolves this issue. I hope it will help others too. You can close this topic since I found the resolution.

    Thank you and bye!
    Teo

    /**
     * This will exclude products that belong to a specific category from the membership discount.
     * Add the below code to your PMPro Customizations Plugin - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
     */
     
    function my_pmpro_exclude_woocommerce_discounts_for_categories( $price, $level_id, $original_price, $product ) {
    
    	// Array of categories to exclude, uses category slug.
    	$exclude_categories = array( 'category-1', 'category-2', 'category-3' );
    
    	// Figure out if product is a variation or simple product.
    	if ( $product->get_type() === 'variation' ) {
    		$product_id = $product->get_parent_id();
    	} else {
    		$product_id = $product->get_id();
    	}
    
    	$category_data = wp_get_post_terms( $product_id, 'product_cat' );
    
    	// Check if product belongs to a category and remove discounted pricing.
    	foreach( $category_data as $key => $value ) {
    		if ( in_array( $value->slug, $exclude_categories ) ) {
    			$price = $original_price;
    		}
    	}
    
    	return $price;
    }
    add_filter( 'pmprowoo_get_membership_price', 'my_pmpro_exclude_woocommerce_discounts_for_categories', 10, 4 );
Viewing 4 replies - 1 through 4 (of 4 total)