3,
'columns' => $columns,
);
$args = wp_parse_args( $defaults, $args );
return $args;
}
add_filter( 'woocommerce_output_related_products_args', 'arya_multipurpose_woocommerce_related_products_args' );
if ( ! function_exists( 'arya_multipurpose_woocommerce_product_columns_wrapper' ) ) {
/**
* Product columns wrapper.
*
* @return void
*/
function arya_multipurpose_woocommerce_product_columns_wrapper() {
$columns = arya_multipurpose_woocommerce_loop_columns();
echo '
';
}
}
add_action( 'woocommerce_before_shop_loop', 'arya_multipurpose_woocommerce_product_columns_wrapper', 40 );
if ( ! function_exists( 'arya_multipurpose_woocommerce_product_columns_wrapper_close' ) ) {
/**
* Product columns wrapper close.
*
* @return void
*/
function arya_multipurpose_woocommerce_product_columns_wrapper_close() {
echo '
';
}
}
add_action( 'woocommerce_after_shop_loop', 'arya_multipurpose_woocommerce_product_columns_wrapper_close', 40 );
/**
* Remove default WooCommerce wrapper.
*/
remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10 );
remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10 );
remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
if ( ! function_exists( 'arya_multipurpose_woocommerce_wrapper_before' ) ) {
/**
* Before Content.
*
* Wraps all WooCommerce content in wrappers which match the theme markup.
*
* @return void
*/
function arya_multipurpose_woocommerce_wrapper_before() {
?>
*/
if ( ! function_exists( 'arya_multipurpose_woocommerce_cart_link_fragment' ) ) {
/**
* Cart Fragments.
*
* Ensure cart contents update when products are added to the cart via AJAX.
*
* @param array $fragments Fragments to refresh via AJAX.
* @return array Fragments to refresh via AJAX.
*/
function arya_multipurpose_woocommerce_cart_link_fragment( $fragments ) {
ob_start();
arya_multipurpose_woocommerce_cart_link();
$fragments['a.cart-contents'] = ob_get_clean();
return $fragments;
}
}
add_filter( 'woocommerce_add_to_cart_fragments', 'arya_multipurpose_woocommerce_cart_link_fragment' );
if ( ! function_exists( 'arya_multipurpose_woocommerce_cart_link' ) ) {
/**
* Cart Link.
*
* Displayed a link to the cart including the number of items present and the cart total.
*
* @return void
*/
function arya_multipurpose_woocommerce_cart_link() {
?>
cart->get_cart_contents_count(), 'arya-multipurpose' ),
WC()->cart->get_cart_contents_count()
);
?>
cart->get_cart_subtotal() ); ?>