• Resolved shoshana100

    (@shoshana100)


    I need an option to add each product price according user role programmability (because I import items from another site) – Is there a built-in function that enables it ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author meowcrew

    (@meowcrew)

    Hi,

    How exactly do you plan to migrate prices?
    There is an option to import prices based on user role through WooCommerce importer or WP All Import, in the premium version of the plugin.

    Thread Starter shoshana100

    (@shoshana100)

    I want to import prices in my custom code .
    Do you have a function or an API that can do it ?

    Plugin Author meowcrew

    (@meowcrew)

    Hi,
    There is a special class to get&update the pricing data:

    MeowCrew\RoleAndCustomerBasedPricing\Admin\ProductPage\PricingRulesManager

    it has a bunch of methods to work with:

    $pricingRules = PricingRulesManager::getProductRoleSpecificPricingRules($product_id);

    // $type must be either “customer” or “role”
    PricingRulesManager::updateProductPricingRules($product_id, $pricing_rules, $pricing_type);

    Check the file for yourself to find the rest methods here: src/Admin/ProductPage/PricingRulesManager.php

    Thread Starter shoshana100

    (@shoshana100)

    OK, thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Adding product role price programmability’ is closed to new replies.