• Resolved prendekz

    (@prendekz)


    Hello how are you?

    I developed a custom plugin to bring all products from another database and it works perfectly, but I have the “Role Based Price For WooCommerce” plugin installed, and I am importing 2 records of each product in the “postmeta” table with the following information:

    $wpdb->insert($tablepostmeta,
    array(
    ‘post_id’ => $id_product,
    ‘meta_key’ => “_enable_role_based_price”,
    ‘meta_value’ => 1,
    )
    );

    $wpdb->insert($tablepostmeta, array(
    ‘post_id’ => $id_product,
    ‘meta_key’ => “_role_based_price”,
    ‘meta_value’ => ‘a:2:{s:8:”customer”;a:2:{s:13:”regular_price”;s:5:”‘.$product[“precio2″].'”;s:13:”selling_price”;s:0:””;}s:12:”distribuidor”;a:2:{s:13:”regular_price”;s:5:”‘.$product[“precio1″].'”;s:13:”selling_price”;s:0:””;}}’,
    )
    );

    When creating these 2 records would not enable Role Based Price?

    When entering the product by the WordPress admin, if you enable Role Based but do not place the 2 product prices. Could you help me (screenshots attached that does not raise prices).

    https://prnt.sc/q2jh68
    https://prnt.sc/q2jh8v
    https://prnt.sc/q2jhbh

    Thank you!

    • This topic was modified 5 years, 3 months ago by prendekz.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error import from PHP’ is closed to new replies.