Repository Forums Support WooCommerce Extended Coupon Features PRO Free Product Variable Name

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1065
    Richard
    Participant

    Is there a way to include the variable name/color with the FREE item title? It only shows the product title and product image. Can I include the variable name info somehow? Thanks!

    #1067
    Soft79
    Keymaster

    Hi Richard,

    copies the contents of the wp-content/woocommerce-auto-added-coupons-pro/template/ directory to wp-content/YOUR_CHILD_THEME/woocommerce-auto-added-coupons/

    this will yield:
    wp-content/YOUR_CHILD_THEME/woocommerce-auto-added-coupons/cart/select-free-product.php
    wp-content/YOUR_CHILD_THEME/woocommerce-auto-added-coupons/checkout/select-free-product.php

    in these files find:

    
    echo esc_html__( $product->get_title(), 'woocommerce' ) . '<br>' . $product->get_image();
    

    and replace with:

    echo esc_html__( $product->get_title(), 'woocommerce' );
    
    if ( $product instanceof WC_Product_Variation ) { 
    	echo "<br>" . $product->get_formatted_variation_attributes( true );
    }
    
    echo '<br>' . $product->get_image();
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.