cartpops_assistant_content

Filter or add items to the Assistant window.

/**
 * Add or filter (specific) items in the Assistant window.
 *
 * @param array $items Array of Assistant items.
 */
function my_prefix_assistant_items( $items ) {
	ob_start();
	?>
	<h2>Hello world!</h2>
	<?php
	$custom_template = ob_get_clean();

	$items['custom_content'] = array(
		'classes'  => array( 'assistant-custom-content', 'another-class' ), // Array of custom CSS classes.
		'title'    => __( 'My title', 'cartpops' ), // Assistant header title.
		'template' => $custom_template, // Custom HTML template to be shown in the Assistant.
	);

	return $items;
}
add_filter( 'cartpops_drawer_classes', 'my_prefix_assistant_items', 10, 1 );

It's time to improve your WooCommerce Cart

CartPops is a WooCommerce Add To Cart Popup, that helps every shop owner improve their user experience, increase conversions & maximize profits.

Was this page helpful?