Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
1.7 kB
2
Indexable
Never
add_action('b2bking_bulkorder_cream_custom_heading', function(){
	?>
	<div class="b2bking_bulkorder_form_container_content_header_cream_sku" style="min-width: 140px;">
		<?php esc_html_e('Regular Price', 'b2bking'); ?>
	</div>
	<div class="b2bking_bulkorder_form_container_content_header_cream_sku" style="min-width: 140px">
		<?php esc_html_e('Wholesale Price', 'b2bking'); ?>
	</div>
	<?php
});
add_action('b2bking_bulkorder_cream_custom_column', function($product){
	?>
	<div class="b2bking_bulkorder_cream_sku"><?php 

	$regular_price = get_post_meta($product->get_id(),'_regular_price', true);
	$regular_price = round(floatval(b2bking()->b2bking_wc_get_price_to_display( $product, array( 'price' => $regular_price))),2);
	$price_display = wc_price($regular_price);

	echo $price_display;
	
	?></div>
	<div class="b2bking_bulkorder_cream_sku"><?php 

	$sale_price = $product->get_sale_price();
	$sale_price = round(floatval(b2bking()->b2bking_wc_get_price_to_display( $product, array( 'price' => $sale_price))),2);
	$regular_price = $product->get_regular_price();
	$regular_price = round(floatval(b2bking()->b2bking_wc_get_price_to_display( $product, array( 'price' => $regular_price))),2);

	if ($product->is_on_sale()){
		$price_display = wc_format_sale_price($regular_price, $sale_price);
	} else {
		$price_display = wc_price($regular_price);
	}

	echo $price_display;
	
	?></div>
	<?php
}, 10, 1);
add_action('wp_head', function(){
	?>
	<style type="text/css">
		.b2bking_bulkorder_form_container_content_header_subtotal, .b2bking_bulkorder_form_container_content_line_subtotal {
		    display: none;
		}
		.b2bking_bulkorder_form_container_content_header_product_cream {
		    width: 37% !important;
		}
	</style>
	<?php
});
Leave a Comment