get_id(), 'edit' ); } else { $tiered_pricing = PriceManager::getFixedPriceRules( $product->get_id(), 'edit' ); } $str = ''; foreach ( $tiered_pricing as $quantity => $price ) { $str .= $quantity . ':' . $price . ','; } return ( mb_strlen( $str ) > 0 ? trim( $str, ',' ) : null ); } /** * Export fixed pricing rules * * @param mixed $value * @param WC_product $product * * @return mixed */ public function addExportFixedData( $value, $product ) { return $this->addExportData( $product, 'fixed' ); } /** * Export percentage pricing rules * * @param mixed $value * @param WC_product $product * * @return mixed */ public function addExportPercentageData( $value, $product ) { return $this->addExportData( $product, 'percentage' ); } /** * Export tiered pricing type * * @param mixed $value * @param WC_product $product * * @return mixed */ public function addExportPricingTypeData( $value, $product ) { $type = PriceManager::getPricingType( $product->get_id(), false, 'edit' ); return ( $type ? $type : '' ); } /** * Export tiered pricing minimum product quantity * * @param mixed $value * @param WC_product $product * * @return mixed */ public function addExportPricingMinimumData( $value, $product ) { return PriceManager::getProductQtyMin( $product->get_id(), 'edit' ); } }