Get a quick single-click solution to share your products on various social media platforms.Buy Now!
Public Ticket #3786

Ramsy Dahla

I want to conditionally hide the bulk cart total based on if a customer is logged into my site or not.

Is there a filter hook for me to call the bulk total?

wpxteam

wpxteam

Hi Ramsy,

I hope that you are doing great.

Please add the following snippet to your child theme's functions.php file.

function bulk_cart_condition(){
revove_action('pvtfw_after_table_block', 'pvtfw_table_top_part', 99);
remove_action('pvtfw_before_table_block', 'pvtfw_table_top_part', 99);
if( is_user_logged_in() ){
if( PVTFW_PRO_COMMON::pvtfw_pro_get_options()->bulkCartPosition === 'bulk_cart_bottom' ){
add_action('pvtfw_after_table_block', 'pvtfw_table_top_part', 99);
}
elseif( PVTFW_PRO_COMMON::pvtfw_pro_get_options()->bulkCartPosition === 'bulk_cart_top' ){
add_action('pvtfw_before_table_block', 'pvtfw_table_top_part', 99);
}
else{
add_action('pvtfw_after_table_block', 'pvtfw_table_top_part', 99);
add_action('pvtfw_before_table_block', 'pvtfw_table_top_part', 99);
}
}
}
add_action('template_redirect', 'bulk_cart_condition');
Let us know if this helps achieve your goal.
Thank you