• Resolved mpcom

    (@mpcom)


    Hello,

    I use WooCommerce Role Based Pricing de Meow Crew

    1/ I need a shortcode to display regular prices and the sale price by user role.

    My goal is for the customer to understand the interest in joining role XYZ.

    On the same page, I therefore need to have:
    sale price for you (according to role):

    but also classic sale price:
    sale price role A:
    sale price role B:
    etc…

    Can you help me please?

    2/ Can you also tell me where in my PHP my Admin database the price information by role is stored (in which table?)?

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Support Andrew Young

    (@meowsupport)

    Hello,

    1. There are no shortcodes available to display pricing rules based on each user role. The plugin adjusts prices dynamically for user role\account using WooCommerce hooks. There are no database records that explicitly store “price for role X = XXX,” which could be used to create shortcodes with parameters for each role. We will add this feature to our backlog and may deliver it in the future.

    2. The role-based pricing data is located in the wp_postmeta table, meta-key for role-based pricing rules is _role_based_pricing_rulesand_custome_based_pricing_rules for customer based pricing. 

    Those are serialized strings associated with post_id (product id), and look something like this: 

    a:2{s:13:"administrator";a:8{s:12:"pricing_type";s:4:"flat";s:13:"regular_price";d:10;s:10:"sale_price";
    d:9;s:8:"discount";N;s:7:"minimum";i:2;s:7:"maximum";i:4;s:8:"group_of";i:1;s:10:"product_id"
    ;N;}s:6:"editor";a:8{s:12:"pricing_type";s:10:"percentage";s:13:"regular_price";N;s:10:"sale_price"
    ;N;s:8:"discount";d:20;s:7:"minimum";N;s:7:"maximum";N;s:8:"group_of";N;s:10:"product_id";N;}}

    You can find there: 

    • user role associated with pricing rule; 
    • pricing_type can be “flat” and “percentage” 
    • for flat pricing type – regular_price and sale_price
    • for percentage pricing type – discount value
    • and qty rules further – min qty, max qty and “gruoup_of” stands for qty step 
    • This reply was modified 7 months, 1 week ago by Andrew Young.
Viewing 1 replies (of 1 total)
  • The topic ‘Shortcode price by user role’ is closed to new replies.