WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Need to change Price Values (3 posts)

  1. hridaya
    Member
    Posted 1 year ago #

    Hello,

    I need to change the price values globally, i have a 2 fields for price one for non members and another for members ( _pricr and _price_member) so i need to change the price values according to the user logged in or not. I already done the database sections .
    Now i only need to know that how can i change the price values globally may be using some hooks.

    I tried to use this filter
    add_filter('woocommerce_get_price', 'managePrice', 1, 2);
    and determines price values according to post id but it only works on details page other page not working not working on cart page.

    Please anyone have any idea about it

    Thank you

    http://wordpress.org/extend/plugins/woocommerce/

  2. bheadrick
    Member
    Posted 1 year ago #

    filters will only affect what the price is displayed as, and not what the price actually is (in the cart). There is a set_price() function on the product class, but I haven't been successful in using this. What I have done is to dynamically generate a coupon for each product when it is added to the cart to make the price what I want it to be.

    as for display, the filter you want to use is woocommerce_get_price_html

  3. hridaya
    Member
    Posted 1 year ago #

    Hello,
    Thanks @bheadrick

    I need to display 2 price based on logged in members or not logged in members globally ie, display as well as on cart checkout everywhere.

    I used woocommerce_get_price_html filter as well but not works all the place .

    Thank you

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.