• Wil

    (@limecanvas)


    If you add a product that has just variants, the plugin returns zero.

    The plugin does not look for any variants of the product, only the price and special price.

    Modified the following class function to return variant price

    public function get_product_price($productid) {
    		$org_price = get_product_meta($productid, 'price', true );
    		$special_price = get_product_meta($productid, 'special_price', true );
    		$price = (!empty($special_price)) ? $special_price : $org_price;
    
    		// Account for variants
    		if ( empty( $price ) ){
    			$price = wpsc_product_variation_price_available( $productid );
    			return $price;
    		} else {
    			return 	wpsc_currency_display( $price );
    		}
    
    	}

    Tested with WPEC 3.8x

    Can you add this into the next plugin update please?

    Thanks,
    Wil.

    https://www.ads-software.com/plugins/wp-e-commerce-featured-product/

  • The topic ‘Returns zero price on product variants’ is closed to new replies.