Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter ribamar23

    (@ribamar23)

    i tried this

    public static function woocommerce_get_price( $product_id ) {
    		$price = get_post_meta($product_id, '_price', true );
    	 }

    and then

    $amount = round( floatval( $referral_rate ) * floatval( $price ), AFFILIATES_REFERRAL_AMOUNT_DECIMALS );

    but it’s not working

    I’m using Affiliates Integration with Woocommerce
    I need to define different comissions for each product…

    I can create a custom field when inserting a new product called commission then insert the commission, then in the file affiliates-woocommerce-light.php I need to access to that value defined for commission……

    any help please?

    Thread Starter ribamar23

    (@ribamar23)

    or may it’s better if I in the order class have a variable to calculate toal product commissions (commission product A + commission product B + …) and then access that variable in affiliates-woocommerce-light.php….. what do you think?

    Thread Starter ribamar23

    (@ribamar23)

    how is it possible to return a value of a custom field?

    Thread Starter ribamar23

    (@ribamar23)

    var $product_custom_fields;

    is that it?

    Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    If I define a custom field named “xpto”, how can I get its data to a variable?

    get_post_meta( $order_id, 'xpto', true );

    You need to know the $order_id though of course.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: WooCommerce – excelling eCommerce] get_post_meta to get custom field data’ is closed to new replies.