Untitled
webwizards
plain_text
04/13/2026 6:05 PM
1.4 KB
8
Indexable
// get price tiers
$tieredpricing = get_post_meta($product_id,'b2bking_product_pricetiers_group_'.$currentusergroupidnr, true);
// if no tiers AND no group price exists, get B2C tiered pricing
$grregprice = get_post_meta($product_id, 'b2bking_regular_product_price_group_'.$currentusergroupidnr, true );
$grsaleprice = get_post_meta($product_id, 'b2bking_sale_product_price_group_'.$currentusergroupidnr, true );
$grpriceexists = 'no';
if (!empty($grregprice) && b2bking()->tofloat($grregprice) !== 0){
$grpriceexists = 'yes';
}
if (!empty($grsaleprice) && b2bking()->tofloat($grsaleprice) !== 0){
$grpriceexists = 'yes';
}
if (empty($tieredpricing) && $grpriceexists === 'no'){
$tieredpricing = get_post_meta($product_id, 'b2bking_product_pricetiers_group_b2c', true );
}
$tieredpricing = b2bking()->convert_price_tiers($tieredpricing, $product);
if (empty($tieredpricing)){
$tieredpricing = 0;
}
$tieredpricing = b2bking()->apply_tax_to_tiers($tieredpricing, $product);
$results[$product_id.'B2BTIERPRICE'] = $tieredpricing;Editor is loading...
Leave a Comment