function wb_woo_bag_admin_template()
        {
            $wb_data = wb_product_dummp_data();
            $wb_total_product = sizeof($wb_data);
            $wb_total_price = 0;
            $wb_total_tax = 0;
            if (function_exists('get_woocommerce_currency_symbol')) {
                $wb_currency_symbol = get_woocommerce_currency_symbol();
            } else {
                $wb_currency_symbol = '$';
            }
            foreach ($wb_data as $data) {
                $wb_total_price += $data['product_price'] * $data['product_quantity'];
                $wb_total_tax += $data['product_tax'];
            }
            ?>
<div class="wb_backend_template_preview_wrapper" id="wb_backend_template_preview_wrapper">
                <div class="wb_display_widget_cart">
                    <div class="cart_list product_list_widget wb_cart_product" id="wb_cart_back_end_wrapper">
                        <!--<span class="arrow"></span>-->
                        <?php 
            $wb_template_name_part = WB()->wb_get_setting_name();
            $wb_all_option = wb_get_all_setting($wb_template_name_part);
            $wb_show_product_no = $wb_all_option[$wb_template_name_part . '_product_setting_wb_show_product_no'];
            $wb_single_product_height = $wb_all_option[$wb_template_name_part . '_product_setting_wb_single_product_height'];
            $woobag_loader_icon = $wb_all_option[$wb_template_name_part . '_general_setting_woobag_loader_icon'];
            $wb_close_bag_icon = $wb_all_option[$wb_template_name_part . '_header_setting_wb_close_bag_icon'];
            $footer_text = $wb_all_option[$wb_template_name_part . '_footer_setting_footer_text'];
            $wb_subtotal_label = $wb_all_option[$wb_template_name_part . '_subtotal_setting_wb_subtotal_label'];
            $wb_ordertotal_label = $wb_all_option[$wb_template_name_part . '_subtotal_setting_wb_ordertotal_label'];
            $viewbag_button_text = $wb_all_option[$wb_template_name_part . '_subtotal_setting_viewbag_button_text'];
            $checkout_button_text = $wb_all_option[$wb_template_name_part . '_subtotal_setting_checkout_button_text'];
            $empty_cart_button_text = $wb_all_option[$wb_template_name_part . '_subtotal_setting_empty_cart_button_text'];
            $custom_button_text = $wb_all_option[$wb_template_name_part . '_subtotal_setting_custom_button_text'];
            $custom_button_url = $wb_all_option[$wb_template_name_part . '_subtotal_setting_custom_button_url'];
            $header_text_multiple = $wb_all_option[$wb_template_name_part . '_header_setting_header_text_multiple'];
            if ($wb_show_product_no == 'unlimited') {
                $wb_show_product_no = 4;
            }
            if ($wb_show_product_no == 1) {
                $wb_style = '.mCSB_scrollTools .mCSB_dragger{
                            height:' . $wb_single_product_height / 2 . 'px !important;
                        }';
                echo '<style>' . $wb_style . '</style>';
            }
            $wb_scroll_option = $wb_all_option[$wb_template_name_part . '_scroll_setting_wb_scroll_option'];
            if ($wb_scroll_option == 'wheel') {
                echo $wb_style = "<style>.woobagcontainer{padding-right:0 !important;}</style>";
            }
            ?>

                        <table>
                            <tr class="wb_header_tr">
                                <td class="wb_window_top">
                                    <table>
                                        <tr>
                                            <td class="wb_top_text">
                                                <b><?php 
            _e($wb_total_product, 'woo-bag');
            ?>
</b> 
                                                <span class="wb_single_multiple_top_text">
                                                    <?php 
            _e($header_text_multiple, 'woo-bag');
            ?>

                                                </span>
                                            </td>
                                            <td class="wb_close_window">
                                                <i class="<?php 
            echo $wb_close_bag_icon;
            ?>
"></i>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr class="wb_contact_tr">
                                <td class="woobagcontainer">
                                    <table>
                                        <tr>
                                            <td class="wb_scroll_button_wrapper">
                                                <?php 
            if ($wb_total_product > $wb_show_product_no || $wb_total_product >= 3) {
                ?>

                                                    <div id="bag_carousel_prev" class="wb_scroll_button bag_carousel_prev">
                                                        <div id="prev_button" class="bag_prev_button">
                                                            <i class="fa fa-chevron-up"></i>
                                                        </div>
                                                    </div>
                                                <?php 
            }
            ?>

                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <div class="wb_all_product_wrapper" >
                                                    <div class="wb_all_product_cover" id="wb_all_products">
                                                        <?php 
            include_once 'woo-bag-admin-display-content.php';
            ?>

                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="wb_scroll_button_wrapper">
                                                <?php 
            if ($wb_total_product > $wb_show_product_no || $wb_total_product >= 3) {
                ?>

                                                    <div id="bag_carousel_next" class="next_button wb_scroll_button bag_carousel_next">
                                                        <div class="bag_next_button" id="next_button"><i class="fa fa-chevron-down"></i></div>
                                                    </div>
                                                <?php 
            }
            ?>

                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr class="wb_subtotal_tr">
                                <td class="wb_cart_total_wrapper">
                                    <table>
                                        <tr>
                                            <td class="total">
                                                <?php 
            $wb_toal = $wb_total_tax + $wb_total_price;
            ?>

                                                <div class="wb_total_content">
                                                    <div class="wb_subtotal_only_price">
                                                        <strong>
                                                            <?php 
            if ($wb_subtotal_label) {
                ?>

                                                                <?php 
                _e($wb_subtotal_label, 'woo-bag');
                ?>

                                                            <?php 
            }
            ?>

                                                        </strong> 
                                                        <span>
                                                            <?php 
            _e($wb_currency_symbol . $wb_total_price, 'woo-bag');
            ?>

                                                        </span>
                                                    </div>
                                                    <div class="wb_total_content_table">
                                                        <strong>
                                                            <?php 
            if ($wb_ordertotal_label) {
                ?>

                                                                <?php 
                _e($wb_ordertotal_label, 'woo-bag');
                ?>

                                                            <?php 
            }
            ?>

                                                        </strong> 
                                                        <span>
                                                            <?php 
            _e($wb_currency_symbol . $wb_toal, 'woo-bag');
            ?>

                                                        </span>
                                                    </div>
                                                    <span class="number hidden"><?php 
            _e($wb_toal, 'woo-bag');
            ?>
</span>
                                                    <span class="wb_current_currency hidden"><?php 
            _e($wb_currency_symbol, 'woo-bag');
            ?>
</span>
                                                    <span class="wb_count_product hidden"><?php 
            _e($wb_total_product, 'woo-bag');
            ?>
</span>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr class="wb_cart_buttons">
                                            <td class="buttons">
                                                <a href="#" class="wb_viewbag_button">
                                                    <span>
                                                        <?php 
            if ($viewbag_button_text) {
                ?>

                                                            <?php 
                _e($viewbag_button_text, 'woo-bag');
                ?>

                                                        <?php 
            } else {
                ?>

                                                            <?php 
                _e('', 'woo-bag');
                ?>

                                                        <?php 
            }
            ?>

                                                    </span>
                                                </a><!--
                                                --><a href="#" class="checkout wb_checkout_button">
                                                    <span><?php 
            if ($checkout_button_text) {
                ?>

                                                            <?php 
                _e($checkout_button_text, 'woo-bag');
                ?>

                                                        <?php 
            } else {
                ?>

                                                            <?php 
                _e('', 'woo-bag');
                ?>

                                                        <?php 
            }
            ?>

                                                    </span>
                                                </a><!--
                                                --><a href="#" class="empty_cart wb_empty_cart_button">
                                                    <span><?php 
            if ($empty_cart_button_text) {
                ?>

                                                            <?php 
                _e($empty_cart_button_text, 'woo-bag');
                ?>

                                                        <?php 
            } else {
                ?>

                                                            <?php 
                _e('', 'woo-bag');
                ?>

                                                        <?php 
            }
            ?>

                                                    </span>
                                                </a><!--
                                                --><a href="<?php 
            echo $custom_button_url;
            ?>
" class="custom wb_custom_button">
                                                    <span><?php 
            if ($custom_button_text) {
                ?>

                                                            <?php 
                _e($custom_button_text, 'woo-bag');
                ?>

                                                        <?php 
            } else {
                ?>

                                                            <?php 
                _e('', 'woo-bag');
                ?>

                                                        <?php 
            }
            ?>

                                                    </span>
                                                </a>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr class="wb_footer_tr">
                                <td class="wb_window_bottom">
                                    <div class="wb_bottom_text"><?php 
            _e($footer_text, 'woo-bag');
            ?>
</div>
                                </td>
                            </tr>
                        </table>

                        <div class="wb_message_wrapper"><div class="wb_message"></div></div>
                        <div class="wb_loading_image">
                            <div class="wb_display_loading_image">
                                <?php 
            if ($woobag_loader_icon) {
                ?>

                                    <i class="<?php 
                echo $woobag_loader_icon;
                ?>
 "></i>
                                <?php 
            } else {
                ?>

                                    <i class="fa fa-spinner fa-spin"></i>
                                <?php 
            }
            ?>

                            </div>
                        </div>

                    </div>
                </div>
            </div>
            <?php 
        }
/**
 * Write active js setting to file
 * 
 * @param String $wb_call_option
 */
function wb_write_user_script($wb_call_option = NULL, $wb_setting_name = NULL)
{
    if (!$wb_setting_name) {
        $wb_setting_name = 'wb_setting';
    }
    $wb_all_option = wb_get_all_setting($wb_setting_name);
    $wb_template_name_part = WB()->wb_get_setting_name();
    /** General Setting */
    $wb_scroll_option = $wb_all_option[$wb_template_name_part . '_scroll_setting_wb_scroll_option'];
    $wb_onclick_scroll_option = $wb_all_option[$wb_template_name_part . '_scroll_setting_wb_onclick_scroll_option'];
    $wb_single_product_height = $wb_all_option[$wb_template_name_part . '_product_setting_wb_single_product_height'];
    /** Product Remove Conformation */
    $wb_section_id = 'product_setting';
    $show_conform = $wb_all_option[$wb_template_name_part . '_' . $wb_section_id . '_' . 'show_conform'];
    $conform_header_text = $wb_all_option[$wb_template_name_part . '_' . $wb_section_id . '_' . 'conform_header_text'];
    $conform_message = $wb_all_option[$wb_template_name_part . '_' . $wb_section_id . '_' . 'conform_message'];
    $conform_btn_ok = $wb_all_option[$wb_template_name_part . '_' . $wb_section_id . '_' . 'conform_btn_ok'];
    $conform_btn_cancle = $wb_all_option[$wb_template_name_part . '_' . $wb_section_id . '_' . 'conform_btn_cancle'];
    $show_woobag_small_screen = $wb_all_option[$wb_template_name_part . '_smallscreen_setting_show_woobag_small_screen'];
    $wb_user_script = '';
    $wb_user_script .= "(function(\$, window) {";
    /**
     * Show Bag When Add To Cart Button Click
     */
    $wb_user_script .= "\$(document).on('click','.add_to_cart_button',function() {";
    $wb_user_script .= "if (\$('#wb_all_content_in_footer .wb_display_widget_cart').length) {";
    $wb_user_script .= "\$.wb_show_woo_bag();\r\r\n        };\r\r\n        });\r\r\n        ";
    /**
     * Write WooBag Show Function
     */
    $wb_user_script .= "\$.wb_show_woo_bag = function () {";
    $wb_user_script .= '$("#wb_all_content_in_footer .wb_display_widget_cart").css("top", "initial");
                $("#wb_all_content_in_footer .wb_display_widget_cart").css("bottom", "initial");
                $("#wb_all_content_in_footer .wb_display_widget_cart").css("lrft", "initial");
                $("#wb_all_content_in_footer .wb_display_widget_cart").css("right", "initial");';
    $wb_user_script .= '$("#wb_all_content_in_footer .wb_display_widget_cart").fadeIn(500);';
    $wb_user_script .= '$("#wb_all_content_in_footer .wb_display_widget_cart").wb_bag_position("");';
    $wb_user_script .= 'var menu = $("#wb_all_content_in_footer .wb_display_widget_cart").show();
        var pos = $.PositionCalculator({
            target: ".wb_show_bag",
            targetAt: "bottom center",
            item: menu,
            itemAt: "top left",
            flip: "both"
        }).calculate();
        menu.css({
            top: parseInt(menu.css("top")) + pos.moveBy.y + "px",
            left: parseInt(menu.css("left")) + pos.moveBy.x + "px"
        });';
    $wb_user_script .= "};";
    /**
     * Smaill Screen Script
     */
    if ($show_woobag_small_screen === 'no') {
        $wb_user_script .= "";
    }
    $wb_user_script .= " })(jQuery, window, document);";
    /**
     * Write Scrolling Script
     */
    $wb_user_script .= "function wb_scrolling_option(){";
    if ($wb_scroll_option === 'wheel') {
        $wb_user_script .= "jQuery('.wb_all_product_wrapper').mCustomScrollbar({\r\r\n            theme: 'minimal-dark',\r\r\n            mouseWheelPixels: 100\r\r\n        });";
    } elseif ($wb_onclick_scroll_option == 'scroll_to_next_product') {
        if (empty($wb_single_product_height)) {
            $wb_single_product_height = 120;
        }
        $wb_user_script .= "var scrolled = 0;\r\r\n        jQuery('.bag_carousel_next').on('click', function () {\r\r\n            var wb_all_product = jQuery(this).closest('tbody').children().find('.wb_all_product_wrapper');\r\r\n            scrolled = scrolled + " . $wb_single_product_height . ";\r\r\n            jQuery(wb_all_product).animate({\r\r\n                scrollTop: scrolled\r\r\n            });\r\r\n        });\r\r\n\r\r\n        jQuery('.bag_carousel_prev').on('click', function () {\r\r\n            var wb_all_product = jQuery(this).closest('tbody').children().find('.wb_all_product_wrapper');\r\r\n            scrolled = scrolled - " . $wb_single_product_height . ";\r\r\n            jQuery(wb_all_product).animate({\r\r\n                scrollTop: scrolled\r\r\n            });\r\r\n        });\r\r\n        ";
    } elseif ($wb_onclick_scroll_option == 'scroll_onkeypress') {
        $wb_user_script .= '
            var amount = "";
            jQuery(".bag_carousel_next").on("mousedown mouseup mouseleave", function mouseState(e) {
                var wb_current_elem = jQuery(this).closest("tbody");
                if (e.type == "mousedown") {
                    amount = "+=10";
                    scroll(wb_current_elem);
                } else {
                    amount = 0;
                }
            });

            jQuery(".bag_carousel_prev").on("mousedown mouseup mouseleave", function mouseState(e) {
                var wb_current_elem = jQuery(this).closest("tbody");
                if (e.type == "mousedown") {
                    amount = "-=10";
                    scroll(wb_current_elem);
                } else {
                    amount = 0;
                }
            });
            function scroll(wb_current_elem) {
                var wb_scroll_elem = jQuery(wb_current_elem).children().find(".wb_all_product_wrapper");
                jQuery(wb_scroll_elem).animate({
                    scrollTop: amount
                }, 100, "linear", function () {
                    if (amount != 0) {
                        scroll(wb_current_elem);
                    }
                });
            }
        ';
    } elseif ($wb_onclick_scroll_option == 'scroll_slowly') {
        $wb_user_script .= "var scrolled = 0;\r\r\n            jQuery('.bag_carousel_next').on('click', function () {\r\r\n                var wb_all_product = jQuery(this).closest('tbody').children().find('.wb_all_product_wrapper');\r\r\n                scrolled = scrolled + 100;\r\r\n                jQuery(wb_all_product).animate({\r\r\n                    scrollTop: scrolled\r\r\n                });\r\r\n            });\r\r\n\r\r\n            jQuery('.bag_carousel_prev').on('click', function () {\r\r\n                var wb_all_product = jQuery(this).closest('tbody').children().find('.wb_all_product_wrapper');\r\r\n                scrolled = scrolled - 100;\r\r\n                jQuery(wb_all_product).animate({\r\r\n                    scrollTop: scrolled\r\r\n                });\r\r\n            });\r\r\n        ";
    } else {
        $wb_user_script .= "var amount = '';\r\r\n        function scroll(wb_current_elem) {\r\r\n            var wb_scroll_elem = jQuery(wb_current_elem).children().find('.wb_all_product_wrapper');\r\r\n            jQuery(wb_scroll_elem).animate({\r\r\n                scrollTop: amount\r\r\n            }, 100, 'linear', function () {\r\r\n                if (amount != '') {\r\r\n                    scroll(wb_current_elem);\r\r\n                }\r\r\n            });\r\r\n        }\r\r\n        jQuery('.bag_carousel_prev').hover(function () {\r\r\n            amount = '-=10';\r\r\n            var wb_current_elem = jQuery(this).closest('tbody');\r\r\n            scroll(wb_current_elem);\r\r\n        }, function () {\r\r\n            amount = '';\r\r\n        });\r\r\n        jQuery('.bag_carousel_next').hover(function () {\r\r\n            amount = '+=10';\r\r\n            var wb_current_elem = jQuery(this).closest('tbody');\r\r\n            scroll(wb_current_elem);\r\r\n        }, function () {\r\r\n            amount = '';\r\r\n        });";
    }
    $wb_user_script .= "}";
    /**
     *  Product Remove Conformation
     */
    if (!$conform_header_text) {
        $conform_header_text = 'Conformation Required';
    }
    if ($conform_message) {
        $conform_message = str_replace('"', "'", $conform_message);
    } else {
        $conform_message = 'Are you sure you want to remove product from cart!';
    }
    if (!$conform_btn_ok) {
        $conform_btn_ok = 'Yes I am';
    }
    if (!$conform_btn_cancle) {
        $conform_btn_cancle = 'Cancel';
    }
    if ($show_conform === 'yes') {
        $wb_user_script .= '
            function wb_remove_conform(wb_product_link) {
                jQuery.confirm({
                    title: "' . $conform_header_text . '",
                    text: "' . $conform_message . '", confirm: function (button) {
                        wb_remove_product(wb_product_link, "");
                    },
                    cancel: function (button) {
                        // nothing to do
                    },
                    confirmButton: "' . $conform_btn_ok . '",
                    cancelButton: "' . $conform_btn_cancle . '",
                    post: true,
                    confirmButtonClass: "btn-danger",
                    cancelButtonClass: "btn-default",
                    zIndex: 99999
               });
           }';
    } else {
        $wb_user_script .= 'function wb_remove_conform(wb_product_link) {
                wb_remove_product(wb_product_link, "");
            }';
    }
    /**
     * Write Script in File
     */
    $wb_user_file = WB()->wb_get_setting_name('new');
    if ($wb_call_option == 'activate_template' || $wb_call_option == 'activate' || $wb_call_option == 'new') {
        $wb_file_path = WB()->wb_plugin_path() . '/admin/js/';
        $wb_file_name = wb_create_file_name() . '.js';
        $wb_file_db_name = $wb_user_file . '_active_script';
        $wb_old_file_name = get_option($wb_file_db_name);
        wb_write_file_content($wb_file_path, $wb_user_script, $wb_file_name, $wb_file_db_name, $wb_old_file_name);
    } else {
        $wb_file_path = WB()->wb_plugin_path() . '/admin/js/';
        $wb_file_name = wb_create_file_name() . '.js';
        $wb_file_db_name = $wb_user_file . '_edit_script';
        $wb_old_file_name = get_option($wb_file_db_name);
        wb_write_file_content($wb_file_path, $wb_user_script, $wb_file_name, $wb_file_db_name, $wb_old_file_name);
    }
    return;
}
/**
 * Provide a public-facing view for the plugin
 *
 * This file is used to markup the Main Content of the WooBag.
 *
 * @author Gatelogixs
 * @package Woo_Bag/
 * @subpackage Woo_Bag/public/templates
 * @version 1.0.0
 */
function wb_built_bag($wb_call_option = NULL)
{
    $wb_new_product_id = '';
    $wb_count_product = 0;
    if (isset($wb_call_option) && !empty($wb_call_option)) {
        if ($wb_call_option['add_cart'] == 'yes') {
            if (isset($_SESSION) && isset($_SESSION['wb_user_id']) && !empty($_SESSION['wb_user_id'])) {
            } else {
                $wb_user_id = md5(time() . uniqid());
                $_SESSION['wb_user_id'] = $wb_user_id;
            }
            $wb_new_product_id = $wb_call_option['product_id'];
        }
    }
    $wb_woocommerce = wb_woocommerce_data();
    $wb_p_data = $wb_woocommerce->cart->get_cart();
    $wb_products_data = array_reverse($wb_p_data);
    $wb_total_product = sizeof($wb_products_data);
    $wb_currency_symbol = get_woocommerce_currency_symbol();
    $wb_data = '';
    $wb_template_name_part = WB()->wb_get_setting_name();
    $wb_all_option = wb_get_all_setting($wb_template_name_part);
    $wb_show_product_no = $wb_all_option[$wb_template_name_part . '_product_setting_wb_show_product_no'];
    if ($wb_show_product_no == 'unlimited') {
        $wb_show_product_no = 3;
    }
    $woobag_loader_icon = $wb_all_option[$wb_template_name_part . '_general_setting_woobag_loader_icon'];
    $show_header_text = $wb_all_option[$wb_template_name_part . '_header_setting_show_header_text'];
    $wb_close_bag_icon = $wb_all_option[$wb_template_name_part . '_header_setting_wb_close_bag_icon'];
    $wb_show_footer = $wb_all_option[$wb_template_name_part . '_footer_setting_wb_show_footer'];
    $footer_text = $wb_all_option[$wb_template_name_part . '_footer_setting_footer_text'];
    $show_subtotal = $wb_all_option[$wb_template_name_part . '_subtotal_setting_show_subtotal'];
    $wb_subtotal_label = $wb_all_option[$wb_template_name_part . '_subtotal_setting_wb_subtotal_label'];
    $wb_ordertotal_label = $wb_all_option[$wb_template_name_part . '_subtotal_setting_wb_ordertotal_label'];
    $viewbag_button_text = $wb_all_option[$wb_template_name_part . '_subtotal_setting_viewbag_button_text'];
    $show_viewbag_button = $wb_all_option[$wb_template_name_part . '_subtotal_setting_show_viewbag_button'];
    $show_checkout_button = $wb_all_option[$wb_template_name_part . '_subtotal_setting_show_checkout_button'];
    $show_empty_cart_button = $wb_all_option[$wb_template_name_part . '_subtotal_setting_show_empty_cart_button'];
    $show_custom_button = $wb_all_option[$wb_template_name_part . '_subtotal_setting_show_custom_button'];
    $checkout_button_text = $wb_all_option[$wb_template_name_part . '_subtotal_setting_checkout_button_text'];
    $empty_cart_button_text = $wb_all_option[$wb_template_name_part . '_subtotal_setting_empty_cart_button_text'];
    $custom_button_text = $wb_all_option[$wb_template_name_part . '_subtotal_setting_custom_button_text'];
    $custom_button_url = $wb_all_option[$wb_template_name_part . '_subtotal_setting_custom_button_url'];
    $header_text = $wb_all_option[$wb_template_name_part . '_header_setting_header_text'];
    $header_text_multiple = $wb_all_option[$wb_template_name_part . '_header_setting_header_text_multiple'];
    $show_woobag_small_screen = $wb_all_option[$wb_template_name_part . '_smallscreen_setting_show_woobag_small_screen'];
    if ($wb_show_product_no == 'unlimited') {
        $wb_show_product_no = 4;
    }
    $wb_data .= '<table>';
    if ($show_woobag_small_screen == 'yes') {
        $wb_data .= '<span class="hidden wb_small_scrren_link" ></span>';
    }
    if (isset($show_header_text) && $show_header_text === 'yes') {
        $wb_data .= '<tr>
                            <td class="wb_window_top">
                                <table>
                                    <tr>
                                        <td class="wb_top_text">';
        $wb_data .= '<b>' . __($wb_total_product, 'woo-bag') . ' </b>';
        if ($header_text) {
            if (isset($wb_total_product) && !empty($wb_total_product) && $wb_total_product > 1) {
                $wb_data .= '<span class="wb_single_multiple_top_text">
                                    ' . __($header_text_multiple, 'woo-bag') . '
                                </span>';
            } else {
                $wb_data .= '<span class="wb_single_product_top_text">
                                    ' . __($header_text, 'woo-bag');
                $wb_data .= '</span>';
            }
        }
        $wb_data .= '</td>
                                        <td class="wb_close_window">';
        if ($wb_close_bag_icon) {
            $wb_data .= '<i class="' . $wb_close_bag_icon . '"></i>';
        } else {
            $wb_data .= '<i class="fa fa-times"></i>';
        }
        $wb_data .= '</td>
                                    </tr>
                                </table>
                            </td>
                        </tr>';
    }
    if ($wb_total_product > 0) {
        $wb_data .= '<tr>
                                <td class="woobagcontainer">
                                    <div>
                                        <table>
                                            <tr class="wb_scolls">
                                                <td class="wb_scroll_button_wrapper">';
        if ($wb_total_product > $wb_show_product_no || $wb_total_product > 3) {
            $wb_data .= '<div id="bag_carousel_prev" class="wb_scroll_button bag_carousel_prev">
                                                            <div id="prev_button" class="bag_prev_button">
                                                                <i class="fa fa-chevron-up"></i>
                                                            </div>
                                                        </div>';
        }
        $wb_data .= '</td>
                                            </tr>
                                            <tr class="wb_all_items">
                                                <td>
                                                    <div class="wb_all_product_wrapper" >
                                                        <div class="wb_all_product_cover" id="wb_all_products">';
        $wb_all_product = wb_product_list($wb_call_option, $wb_all_option, $wb_template_name_part);
        if (isset($wb_call_option) && !empty($wb_call_option) && $wb_call_option['add_cart'] == 'yes') {
            $wb_data .= $wb_all_product["product_data"];
        } else {
            $wb_data .= $wb_all_product;
        }
        $wb_data .= '</div>
                                                    </div>
                                                </td>
                                            </tr>
                                            <tr class="wb_scolls">
                                                <td class="wb_scroll_button_wrapper">';
        if ($wb_total_product > $wb_show_product_no || $wb_total_product > 3) {
            $wb_data .= '<div id="bag_carousel_next" class="next_button wb_scroll_button bag_carousel_next">
                                                            <div class="bag_next_button" id="next_button"><i class="fa fa-chevron-down"></i></div>
                                                        </div>';
        }
        $wb_data .= '</td>
                                            </tr>
                                        </table>
                                    </div>
                                </td>
                            </tr>
                            <tr class="wb_subtotal_tr">
                                <td class="wb_cart_total_wrapper">
                                        <table>
                                            <tr>
                                                <td class="total">';
        $wb_total_tax = 0;
        $wb_total_amount = $wb_woocommerce->cart->cart_contents_total;
        if ($wb_woocommerce->cart->tax_display_cart == 'excl') {
            foreach ($wb_woocommerce->cart->get_tax_totals() as $code => $tax) {
                $wb_total_tax += $tax->amount;
            }
        }
        $wb_toal = $wb_total_tax + $wb_total_amount;
        $wb_data .= '<div class="wb_total_content">';
        if (isset($show_subtotal) && $show_subtotal == 'only_price' || $show_subtotal == 'both') {
            $wb_data .= '<div class="wb_subtotal_only_price">';
            if ($wb_subtotal_label) {
                $wb_data .= '<strong>' . __($wb_subtotal_label, 'woo-bag') . '</strong> ';
            }
            $wb_data .= '<span>';
            $wb_data .= __($wb_currency_symbol . number_format($wb_total_amount, 2), 'woo-bag');
            $wb_data .= '</span>';
            $wb_data .= '</div>';
        }
        if (isset($show_subtotal) && $show_subtotal == 'price_tax' || $show_subtotal == 'both') {
            $wb_data .= '<div class="wb_total_content_table">';
            if ($wb_ordertotal_label) {
                $wb_data .= '<strong>' . __($wb_ordertotal_label, 'woo-bag') . '</strong>';
            }
            $wb_data .= '<span>';
            $wb_data .= __($wb_currency_symbol . number_format($wb_toal, 2), 'woo-bag');
            $wb_data .= '</span>
                                                            </div>';
        }
        if (isset($show_subtotal) && $show_subtotal === 'price_tax') {
            $wb_data .= '<span class="number hidden" >' . __(number_format($wb_toal, 2), 'woo-bag') . '</span>';
        } else {
            $wb_data .= '<span class="number hidden" >' . __(number_format($wb_total_amount, 2), 'woo-bag') . '</span>';
        }
        $wb_data .= '</div>
                                                </td>
                                            </tr>
                                            <tr class="wb_cart_buttons">
                                                <td class="buttons">';
        if ($show_viewbag_button == 'yes') {
            $wb_data .= '<a href="' . $wb_woocommerce->cart->get_cart_url() . '" class="wb_viewbag_button">';
            $wb_data .= '<span>';
            if ($viewbag_button_text) {
                $wb_data .= __($viewbag_button_text, 'woo-bag');
            } else {
                $wb_data .= __('', 'woo-bag');
            }
            $wb_data .= '</span>
                                                        </a>';
        }
        if ($show_checkout_button == 'yes') {
            $wb_data .= '<a href="' . $wb_woocommerce->cart->get_checkout_url() . '" class="checkout wb_checkout_button">';
            $wb_data .= '<span>';
            if ($checkout_button_text) {
                $wb_data .= __($checkout_button_text, 'woo-bag');
            } else {
                $wb_data .= __('', 'woo-bag');
            }
            $wb_data .= '</span>
                                                        </a>';
        }
        if ($show_empty_cart_button == 'yes') {
            $wb_data .= '<a href="#" class="empty_cart wb_empty_cart_button">
                                                            <span>';
            if ($empty_cart_button_text) {
                $wb_data .= __($empty_cart_button_text, 'woo-bag');
            } else {
                $wb_data .= __('', 'woo-bag');
            }
            $wb_data .= '</span>
                                                        </a>';
        }
        if ($show_custom_button == 'yes') {
            $wb_data .= '<a href="' . $custom_button_url . '" class="custom wb_custom_button">
                                                            <span>';
            if ($custom_button_text) {
                $wb_data .= __($custom_button_text, 'woo-bag');
            } else {
                $wb_data .= __('', 'woo-bag');
            }
            $wb_data .= '</span>
                                                        </a>';
        }
        $wb_data .= ' </td>
                                            </tr>';
        $wb_data .= '</table>
                                </td>
                            </tr>';
    } else {
    }
    $wb_data .= '<p class="wb_count_product">' . $wb_total_product . '</p>';
    $wb_data .= '<span class="wb_current_currency">' . __($wb_currency_symbol, 'woo-bag') . '</span>';
    if ($wb_show_footer === 'yes') {
        if (!isset($footer_text) && empty($footer_text)) {
            $footer_text = 'FREE RETURNS AVAILABLE ON ALL ORDERS';
        }
        $wb_data .= '<tr><td class="wb_window_bottom">';
        $wb_data .= '<div class="wb_bottom_text">' . __($footer_text, 'woo-bag') . '</div>';
        $wb_data .= '</td></tr>';
    }
    $wb_data .= '<div class="wb_message_wrapper" id="wb_message_wrapper"></div><div class="wb_message"></div>';
    $wb_data .= '<div class="wb_display_loading_image">';
    if ($woobag_loader_icon) {
        $wb_data .= '<i class="' . $woobag_loader_icon . ' "></i>';
    } else {
        $wb_data .= '<i class="fa fa-spinner fa-spin"></i>';
    }
    $wb_data .= '</div>';
    $wb_data .= '</table>';
    if (isset($wb_call_option) && !empty($wb_call_option) && $wb_call_option['add_cart'] == 'yes') {
        $wb_full_cart = array();
        $wb_full_cart['product_data'] = $wb_data;
        return $wb_full_cart;
    } else {
        return $wb_data;
    }
}