Below, you’ll find a detailed guide on how to add the Cyclone Demo Importer Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Cyclone Demo Importer Plugin shortcodes not to show or not to work correctly.
Before starting, here is an overview of the Cyclone Demo Importer Plugin and the shortcodes it provides:
"Cyclone Demo Importer is a handy WordPress plugin that simplifies the process of importing demo content. It's a perfect tool for developers who want to speed up their website building process."
- [bizberg_product_search_box]
- [bizberg_woocommerce_account_menu]
- [bizberg_woocommerce_wishlist]
- [bizberg_woocommerce_compare]
- [bizberg_woocommerce_mini_cart]
Cyclone Demo Importer [bizberg_product_search_box] Shortcode
The Bizberg Product Search Box shortcode is a powerful tool designed to enhance the user experience on your website. It generates a search box specifically tailored for product searches. This shortcode works by creating a form where users can input their search queries. It also includes a dropdown menu that lists all product categories, allowing users to refine their search. This function is particularly useful for WooCommerce-enabled sites, enhancing product discoverability.
Shortcode: [bizberg_product_search_box]
Examples and Usage
Basic example – The basic usage of the bizberg_product_search_box shortcode. This will display a search box where users can search for products on your website.
[bizberg_product_search_box /]
PHP Function Code
In case you have difficulties debugging what causing issues with [bizberg_product_search_box]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'bizberg_product_search_box', 'bizberg_product_search_box' );
Shortcode PHP function:
function bizberg_product_search_box(){
ob_start(); ?>
<div id='bizberg-product-search-box'>
<form
action='<?php echo esc_url( home_url( '/' ) ); ?>'
id='search-form'
class="woocommerce-product-search"
method='get'>
<input
id='search-text'
autocomplete="off"
name='s'
placeholder='<?php echo esc_attr( get_theme_mod( 'header_woo_search_placeholder' , esc_attr_x( 'Search for Product', 'placeholder', 'bizberg' ))); ?>'
class="form-control"
value='<?php echo esc_attr( get_search_query() ); ?>'
type='text' />
<div class="vert-brd" ></div>
<?php
if ( class_exists( 'WooCommerce' ) ):
$args = array(
'taxonomy' => 'product_cat',
'name' => 'product_cat',
'value_field' => 'slug',
'class' => 'something',
'show_option_all' => esc_attr( get_theme_mod( 'header_woo_search_dropdown_text' , __( 'All Category','bizberg' ) ) ),
'selected' => get_query_var( 'product_cat' )
);
wp_dropdown_categories( $args );
endif; ?>
<button id='search-button' value="<?php echo esc_attr_x( 'Submit','submit button', 'bizberg' ); ?>" type='submit'>
<?php esc_html_e( 'Search','bizberg' ); ?>
</button>
<input type="hidden" name="post_type" value="product" />
</form>
</div>
<?php
return ob_get_clean();
}
Code file location:
cyclone-demo-importer/cyclone-demo-importer/woocommerce.php
Cyclone Demo Importer [bizberg_woocommerce_account_menu] Shortcode
The ‘bizberg_woocommerce_account_menu’ shortcode from the cyclone-demo-importer plugin creates a dynamic navigation menu for WooCommerce accounts. Depending on the user’s login status, different menus are displayed. The menu displays ‘Login / Register’ for non-logged in users. For logged-in users, it shows ‘My Account’ and a drop-down menu with additional options including logout. Customization options for icons and page links are available.
Shortcode: [bizberg_woocommerce_account_menu]
Examples and Usage
The ‘bizberg_woocommerce_account_menu’ shortcode is a powerful tool that allows you to customize your WooCommerce account menu. This shortcode is versatile and can be used in different ways depending on your needs.
Basic example – Displaying the default WooCommerce account menu
[bizberg_woocommerce_account_menu /]
PHP Function Code
In case you have difficulties debugging what causing issues with [bizberg_woocommerce_account_menu]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'bizberg_woocommerce_account_menu', 'bizberg_woocommerce_account_menu' );
Shortcode PHP function:
function bizberg_woocommerce_account_menu(){
ob_start(); ?>
<div class="header_dropdown_wrapper">
<?php
if( !is_user_logged_in() ){
$parent_menu_not_logged_in = get_theme_mod( 'woocommerce_account_parent_menu_not_logged_in' );
$parent_menu_not_logged_in_icon = get_theme_mod( 'woocommerce_account_parent_menu_not_logged_in_icon' , 'far fa-user' );
if( empty( $parent_menu_not_logged_in ) ){ ?>
<a
class="bizberg_woocommerce_header_menu"
href="<?php echo esc_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>">
<i class="<?php echo esc_attr( $parent_menu_not_logged_in_icon ); ?>"></i>
<?php esc_html_e( 'Login / Register', 'bizberg' ); ?></a>
<?php
} else { ?>
<a
class="bizberg_woocommerce_header_menu"
href="<?php echo esc_url( get_permalink( $parent_menu_not_logged_in ) ); ?>">
<i class="<?php echo esc_attr( $parent_menu_not_logged_in_icon ); ?>"></i>
<?php echo esc_html( get_the_title( $parent_menu_not_logged_in ) ); ?></a>
<?php
}
} else {
$parent_menu_logged_in = get_theme_mod( 'woocommerce_account_parent_menu_logged_in' );
$parent_menu_logged_in_icon = get_theme_mod( 'woocommerce_account_parent_menu_logged_in_icon' , 'far fa-user' );
if( empty( $parent_menu_logged_in ) ){ ?>
<a
class="bizberg_woocommerce_header_menu"
href="<?php echo esc_url( get_permalink( wc_get_page_id( 'myaccount' ) ) ); ?>">
<i class="<?php echo esc_attr( $parent_menu_logged_in_icon ); ?>"></i>
<?php esc_html_e( 'My Account', 'bizberg' ); ?>
</a>
<?php
} else { ?>
<a
class="bizberg_woocommerce_header_menu"
href="<?php echo esc_url( get_permalink( $parent_menu_logged_in ) ); ?>">
<i class="<?php echo esc_attr( $parent_menu_logged_in_icon ); ?>"></i>
<?php echo esc_html( get_the_title( $parent_menu_logged_in ) ); ?>
</a>
<?php
}
$dropdown_menu_pages = get_theme_mod( 'woocommerce_account_drop_down_menu_header' );
$dropdown_menu_pages = is_array( $dropdown_menu_pages ) ? $dropdown_menu_pages : json_decode( urldecode( $dropdown_menu_pages ), true );
$logout_header_menu = get_theme_mod( 'woocommerce_disable_logout_header_menu' );
$hide_logout_icon_header_menu = get_theme_mod( 'woocommerce_hide_logout_icon_header_menu' ); ?>
<ul>
<?php cdi_get_woocommerce_header_dropdown( $dropdown_menu_pages );
if( empty( $logout_header_menu ) ){ ?>
<li>
<a href="<?php echo wp_logout_url(); ?>">
<?php echo ( empty( $hide_logout_icon_header_menu ) ? '<i class="fas fa-sign-out-alt"></i>' : '' ); ?>
<?php esc_html_e( 'Logout', 'bizberg' ); ?>
</a>
</li>
<?php
} ?>
</ul>
<?php
} ?>
</div>
<?php
return ob_get_clean();
}
Code file location:
cyclone-demo-importer/cyclone-demo-importer/woocommerce.php
Cyclone Demo Importer [bizberg_woocommerce_wishlist] Shortcode
The Bizberg WooCommerce Wishlist shortcode is part of the Cyclone Demo Importer plugin. It displays a wishlist icon linked to the user’s wishlist page, along with the total number of products added.
Shortcode: [bizberg_woocommerce_wishlist]
Examples and Usage
Basic example – Displaying a wishlist icon with the number of items in the wishlist.
[bizberg_woocommerce_wishlist /]
PHP Function Code
In case you have difficulties debugging what causing issues with [bizberg_woocommerce_wishlist]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'bizberg_woocommerce_wishlist', 'bizberg_woocommerce_wishlist_shortcode' );
Shortcode PHP function:
function bizberg_woocommerce_wishlist_shortcode(){
ob_start();
$icon = cdi_get_theme_data() ? 'fal fa-heart' : 'far fa-heart'; ?>
<div class="bizberg_wishlist_wrapper">
<a href="<?php echo esc_url( YITH_WCWL()->get_wishlist_url() ); ?>" data-toggle="tooltip" title="<?php esc_attr_e( 'My Wishlist' , 'bizberg' ) ?>">
<i class="<?php echo esc_attr( $icon ); ?>"></i>
<span class="wishlist_count"><?php echo esc_html( yith_wcwl_count_all_products() ); ?></span>
</a>
</div>
<?php
return ob_get_clean();
}
Code file location:
cyclone-demo-importer/cyclone-demo-importer/woocommerce.php
Cyclone Demo Importer [bizberg_woocommerce_compare] Shortcode
The ‘bizberg_woocommerce_compare’ shortcode is a feature of the cyclone-demo-importer plugin. It generates a comparison button for WooCommerce products. This button displays the count of products added for comparison. On click, it opens a comparison table in a new window. The icon for the button can be customized.
Shortcode: [bizberg_woocommerce_compare]
Examples and Usage
Basic example – A simple usage of the ‘bizberg_woocommerce_compare’ shortcode is to display the compare products icon and count on your website.
[bizberg_woocommerce_compare /]
PHP Function Code
In case you have difficulties debugging what causing issues with [bizberg_woocommerce_compare]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'bizberg_woocommerce_compare', 'bizberg_woocommerce_compare_shortcode' );
Shortcode PHP function:
function bizberg_woocommerce_compare_shortcode(){
ob_start();
global $yith_woocompare;
$count = !empty( $yith_woocompare->obj->products_list ) && is_array( $yith_woocompare->obj->products_list ) ? count( $yith_woocompare->obj->products_list ) : '0';
$icon = cdi_get_theme_data() ? 'fal fa-sync' : 'fas fa-sync-alt'; ?>
<div class="bizberg_compare_wrapper yith-woocompare-widget">
<a
href="<?php echo esc_url( site_url() ); ?>/?action=yith-woocompare-view-table&iframe=yes"
class="compare"
onclick="return false"
data-toggle="tooltip"
title="<?php esc_attr_e( 'Compare Products' , 'bizberg' ); ?>">
<i class="<?php echo esc_attr( $icon ); ?>"></i>
<span class="compare_count"><?php echo absint( $count ); ?></span>
</a>
</div>
<?php
return ob_get_clean();
}
Code file location:
cyclone-demo-importer/cyclone-demo-importer/woocommerce.php
Cyclone Demo Importer [bizberg_woocommerce_mini_cart] Shortcode
The ‘bizberg_woocommerce_mini_cart’ shortcode from the cyclone-demo-importer plugin creates a mini shopping cart in your WordPress site. It displays the cart icon, the number of items in the cart, and the total cart value. The cart also expands into a dropdown on click, showing the items added.
Shortcode: [bizberg_woocommerce_mini_cart]
Examples and Usage
Basic example – Show the mini cart with default settings.
[bizberg_woocommerce_mini_cart /]
PHP Function Code
In case you have difficulties debugging what causing issues with [bizberg_woocommerce_mini_cart]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'bizberg_woocommerce_mini_cart', 'bizberg_woocommerce_mini_cart' );
Shortcode PHP function:
function bizberg_woocommerce_mini_cart(){
ob_start();
global $woocommerce;
$icon = cdi_get_theme_data() ? 'fal fa-shopping-cart' : 'fas fa-shopping-cart'; ?>
<div class="bizberg_header_mini_cart_wrapper">
<a class="cart-contents"
href="<?php echo esc_url( wc_get_cart_url() ); ?>"
data-toggle="tooltip"
title="<?php esc_attr_e( 'Shopping Cart','bizberg' ); ?>">
<span class="bizberg_header_cart_icon">
<i class="<?php echo esc_attr( $icon ); ?>"></i>
<span class="cart_content_count">
<?php echo absint( WC()->cart->get_cart_contents_count() ); ?>
</span>
</span>
<span class="bizberg_mini_cart_content_total">
<?php echo wp_kses_post( WC()->cart->get_cart_total() ); ?>
</span>
</a>
<div class="bizberg_mini_cart_dropdown">
<?php
woocommerce_mini_cart();
?>
</div>
</div>
<?php
return ob_get_clean();
}
Code file location:
cyclone-demo-importer/cyclone-demo-importer/woocommerce.php
Conclusion
Now that you’ve learned how to embed the Cyclone Demo Importer Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.
Leave a Reply