Example #1
0
 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     // Bind theme path to Container
     $this->app->bind('themes.path', function () {
         return WB() ? $this->guessPackagePath() . '/themes' : base_path('themes');
     });
 }
/**
 * Restore To Default setting
 * 
 * @param string $wb_call_option
 * @return void
 * @access public
 */
function wb_activate_plugin($wb_call_option)
{
    $wb_template_name_part = WB()->wb_get_setting_name($wb_call_option);
    $wb_default_options = wb_default_options($wb_call_option);
    if (get_option($wb_template_name_part)) {
        update_option($wb_template_name_part, $wb_default_options);
    } else {
        add_option($wb_template_name_part, $wb_default_options);
    }
    wb_write_user_style($wb_call_option);
}
 /**
  * Register the stylesheets for the public-facing side of the site.
  *
  * @since    1.0.0
  */
 public function enqueue_scripts()
 {
     $wb_plugin_url = WB()->wb_plugin_url();
     wp_enqueue_script($this->name . '-bootstrap.min', plugin_dir_url(__FILE__) . 'js/bootstrap.min.js', array('jquery'), '', TRUE);
     wp_enqueue_script($this->name . '-jquery.mCustomScrollbar.concat.min', plugin_dir_url(__FILE__) . 'js/jquery.mCustomScrollbar.concat.min.js', array('jquery'), '', TRUE);
     wp_enqueue_script($this->name . '-jquery.confirm', plugin_dir_url(__FILE__) . 'js/jquery.confirm.min.js', array('jquery'), '', TRUE);
     wp_enqueue_script($this->name . '-position-calculator', plugin_dir_url(__FILE__) . 'js/woo-bag-public-position-calculator.js', array('jquery'), '', TRUE);
     wp_enqueue_script($this->name . '-jquery.cookie', plugin_dir_url(__FILE__) . 'js/jquery.cookie.js', array('jquery'), '', TRUE);
     wp_enqueue_script($this->name . '-functions', plugin_dir_url(__FILE__) . 'js/woo-bag-public-functions.js', array('jquery'), $this->version, TRUE);
     wp_enqueue_script($this->name . '-user-script', $wb_plugin_url . '/admin/js/' . wb_get_user_script_name('_active_script'), array('jquery'), $this->version, TRUE);
     wp_enqueue_script($this->name . '-frontend', plugin_dir_url(__FILE__) . 'js/woo-bag-public.js', array('jquery'), $this->version, TRUE);
     wp_localize_script($this->name . '-frontend', 'wb_ajax_url', array('ajaxurl' => admin_url('admin-ajax.php')), $this->version, TRUE);
 }
Example #4
0
 /**
  * Execute the console command.
  *
  * @return void
  */
 public function fire()
 {
     // In vendor as package
     if (!WB()) {
         // Themes path
         $themes_to_copy = base_path('vendor/pongocms/site/src/themes');
         // Copy dir
         \File::copyDirectory($themes_to_copy, base_path('themes'));
         $this->info('Themes folder exported to root!');
     } else {
         $this->info('This command only run under vendor/package!');
     }
     return;
 }
 /**
  * Default options
  *
  * Sets up the default options used on the settings page
  */
 public static function wb_default_create_options($wb_call_option = NULL)
 {
     $wb_template_part = WB()->wb_get_setting_name($wb_call_option);
     if ($wb_call_option == 'new') {
     } else {
         if (!get_option('wb_setting_install')) {
             add_option('wb_setting_install', 'yes');
         } else {
             update_option('wb_setting_install', 'yes');
         }
     }
     if (!get_option($wb_template_part)) {
         if ($wb_call_option == 'new') {
             wb_activate_plugin($wb_call_option);
         } else {
             wb_activate_plugin('activate');
         }
     }
 }
 /**
  * Register the JavaScript for the dashboard.
  *
  * @since    1.0.0
  */
 public function enqueue_scripts($hook)
 {
     if ('toplevel_page_woo-bag' != $hook && 'woobag_page_woo-setting' != $hook && 'woobag_page_woo-templates' != $hook && 'woobag_page_woo-premium-features' != $hook) {
         return;
     }
     $wb_plugin_url = WB()->wb_plugin_url();
     wp_enqueue_script($this->name . '-style', plugin_dir_url(__FILE__) . 'js/style.js', array('jquery'), $this->version, true);
     wp_enqueue_script($this->name . '-bootstrap.min', $wb_plugin_url . '/public/js/bootstrap.min.js', array('jquery'), $this->version, true);
     wp_enqueue_script($this->name . '-jquery.mCustomScrollbar.concat.min', $wb_plugin_url . '/public/js/jquery.mCustomScrollbar.concat.min.js', array('jquery'), $this->version, true);
     wp_enqueue_script($this->name . '-colpick', plugin_dir_url(__FILE__) . 'js/colpick.js', array('jquery'), $this->version, true);
     wp_enqueue_script($this->name . 'woo-bag-public-functions', $wb_plugin_url . '/public/js/woo-bag-public-functions.js', array('jquery'), $this->version, true);
     if ($_GET && isset($_GET['action']) && $_GET['action'] == 'edit') {
         wp_enqueue_script($this->name . '-user-script', plugin_dir_url(__FILE__) . 'js/' . wb_get_user_script_name('_edit_script'), array('jquery'), $this->version, true);
     } else {
         wp_enqueue_script($this->name . '-user-active-script', plugin_dir_url(__FILE__) . 'js/' . wb_get_user_script_name('_active_script'), array('jquery'), $this->version, true);
     }
     wp_enqueue_script($this->name . 'woo-bag-public', $wb_plugin_url . '/public/js/woo-bag-public.js', array('jquery'), $this->version, true);
     wp_enqueue_script($this->name, plugin_dir_url(__FILE__) . 'js/woo-bag-admin.js', array('jquery'), $this->version, true);
     wp_enqueue_script($this->name . '-woo-bag-admin-show', plugin_dir_url(__FILE__) . 'js/woo-bag-admin-show.js', array('jquery'), $this->version, true);
     wp_localize_script($this->name, 'wb_admin_ajax_url', array('wb_ajax' => admin_url('admin-ajax.php')), $this->version);
 }
function wb_get_user_script_name($wb_db_name)
{
    $wb_setting_name = WB()->wb_get_setting_name('new');
    $wb_user_script_name = '';
    if (get_option($wb_setting_name . $wb_db_name)) {
        return get_option($wb_setting_name . $wb_db_name);
    } else {
        return $wb_user_script_name;
    }
}
<?php

$wb_plugin_url = WB()->wb_plugin_url();
?>

<div class="wb_about_wrapper wb_premium_wrapper">
    <div class="row nopadding">
        <div class="col-lg-12 nopadding">
            <div class="col-md-3 wb_about_logo_wrapper">
                <div class="wb_about_logo">
                    <img class="img-responsive" src="<?php 
echo $wb_plugin_url;
?>
/admin/images/wb_logo.png" />
                </div>
            </div>
            <div class="col-md-9 wb_about_title nopadding">
                <div class="col-md-12 nopadding">
                    <h1 class=""> WooBag <?php 
_e('Templates', 'woo-bag');
?>
</h1>
                </div>
                <div class="col-md-12 wb_about_text_wrapper">
                    <div class="about-text wb_about_text">
                        <?php 
_e('Templates are only available in Premium Version ', 'woo-bag');
?>

                        <a class="" href="http://codecanyon.net/item/woobag-customize-your-cart-easily/12908527?ref=gatelogix">
                            <?php 
function wb_about_template()
{
    ?>

    <div class="wb_about_wrapper">
        <div class="row nopadding">
            <div class="col-lg-12 nopadding">
                <div class="col-md-3 wb_about_logo_wrapper">
                    <div class="wb_about_logo">
                        <img class="img-responsive" src="<?php 
    echo WB()->wb_plugin_url();
    ?>
/admin/images/wb_logo.png" />
                    </div>
                </div>
                <div class="col-md-9 wb_about_title nopadding">
                    <div class="col-md-12 nopadding">
                        <h1 class=""> <?php 
    _e('About WooBag', 'woo-bag');
    ?>
</h1>
                    </div>
                    <div class="col-md-12 wb_about_text_wrapper">
                        <div class="about-text wb_about_text">
                            <?php 
    _e('WooBag Lite is a must have Wordpress WooCommerce Addon Plugin that gives you full control over design and behaviour of your cart popup.', 'woo-bag');
    ?>


                        </div>
                    </div>
                    <div class="col-md-12 nopadding">
                        <div class="wb_about_actions">
                            <?php 
    $wb_setting_url = admin_url('admin.php?page=woo-setting');
    ?>

                            <p class="wb_actions">
                                <a class="button" href="<?php 
    echo $wb_setting_url;
    ?>
"><?php 
    _e('Edit Settings  ', 'woo-bag');
    ?>
</a>
                            </p>
                            <p class="wb_actions">
                                <a class="button" href="http://codecanyon.net/item/woobag-customize-your-cart-easily/12908527?ref=gatelogix">WooBag <?php 
    _e('Premium', 'woo-bag');
    ?>
</a>
                            </p>
                            <p class="wb_actions">
                                <a class="button" href="http://woobag.gatelogix.com/documentation/" target="_blank"><?php 
    _e('Help  ', 'woo-bag');
    ?>
</a>
                            </p>
                        </div>
                    </div>
                </div>

            </div>
            <div class="col-lg-12 nopadding">
                <div class="text-center">
                    <hr class="fancy-line"/>
                </div>
            </div>
        </div>
        <div class="row nopadding">
            <div class="col-lg-12 nopadding">
                <div class="wb_features">
                    <div class="feature-section col four-col col-md-12 nopadding">
                        <div>
                            <h4><?php 
    _e('Fully Customizable', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Customize background, text, color, size, font, borders, buttons etc.', 'woo-bag');
    ?>

                            </p>
                        </div>
                        <div>
                            <h4><?php 
    _e('Preview Options', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Amazing previewing option at the backend before making it live on your shop.', 'woo-bag');
    ?>

                            </p>
                        </div>
                        <div>
                            <h4><?php 
    _e('Scroll Options', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Set the scroll feature and Set the number of items to list above the fold.', 'woo-bag');
    ?>

                            </p>
                        </div>
                        <div>
                            <h4><?php 
    _e('Custom Alerts', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Improve conversion by setting custom alerts on cart item removal.', 'woo-bag');
    ?>

                            </p>
                        </div>

                    </div>
                    <div class="feature-section col four-col col-md-12 nopadding">
                        <div>
                            <h4><?php 
    _e('Custom Attributes', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Full control on Showing Custom Attributes of cart items.', 'woo-bag');
    ?>

                            </p>
                        </div>
                        <div>
                            <h4><?php 
    _e('Responsive Design', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Multiscreen friendly design to show your cart on small screens', 'woo-bag');
    ?>

                            </p>
                        </div>
                    </div>
                    <div class="feature-section col one-col col-md-12 nopadding">
                        <div class="text-center">
                            <h2><?php 
    _e('Premium Features', 'woo-bag');
    ?>
</h2>
                            <p>Not Available in Lite Version</p>
                        </div>
                    </div>
                    <div class="feature-section col four-col col-md-12 nopadding">
                        <div>
                            <h4><?php 
    _e('Cart in Menu', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Show Ajax dropdown cart in menu of your site. Also set pages where you need to show it in menu. ', 'woo-bag');
    ?>

                            </p>
                        </div>
                        <div>
                            <h4><?php 
    _e('Cart in Fixed Position', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Show Ajax cart in fixed position using shortcode. ', 'woo-bag');
    ?>

                            </p>
                        </div>
                        <div>
                            <h4><?php 
    _e('Cart in Sidebars', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Show Ajax cart in siderbars using Widget.', 'woo-bag');
    ?>

                            </p>
                        </div>
                        <div>
                            <h4><?php 
    _e('Cart Icon Customization', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Customize Cart icons image, color, size, text etc. ', 'woo-bag');
    ?>

                            </p>
                        </div>


                    </div>
                    <div class="feature-section col four-col col-md-12 nopadding">
                        <div>
                            <h4><?php 
    _e('Shortcodes and Widgets', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Shortcode and widgets to help you easily use the WooBag cart anywhere you want. ', 'woo-bag');
    ?>

                            </p>
                        </div>
                        <div>
                            <h4><?php 
    _e('Import/Export', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Export your template designs and easily import them on the same or another site. ', 'woo-bag');
    ?>

                            </p>
                        </div>
                        <div>
                            <h4><?php 
    _e('Templating System', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Create unlimited cart designs of your shop using the built-in templating system.', 'woo-bag');
    ?>

                            </p>
                        </div>
                        <div>
                            <h4><?php 
    _e('Cart Countdown', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Create scarcity using countdown and reserve product features.', 'woo-bag');
    ?>

                            </p>
                        </div>
                    </div>
                    <div class="feature-section col four-col col-md-12 nopadding">
                        <div>
                            <h4><?php 
    _e('Customize Empty Cart', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('Many options to Customize Empty cart to improve conversions.', 'woo-bag');
    ?>

                            </p>
                        </div>
                    </div>
                    <div class="feature-section col one-col col-md-12 nopadding">
                        <div class="text-center">
                            <h4>...<?php 
    _e('and Many More', 'woo-bag');
    ?>
</h4>
                            <p>
                                <?php 
    _e('To see all other features go to ', 'woo-bag');
    ?>

                                <a href="http://woobag.gatelogix.com/lite">
                                    <?php 
    _e('Demo ', 'woo-bag');
    ?>

                                </a>
                                <?php 
    _e('or check ', 'woo-bag');
    ?>

                                <a href="http://woobag.gatelogix.com/documentation">
                                    <?php 
    _e('Documentation. ', 'woo-bag');
    ?>

                                </a>
                            </p>
                            <div class="wb_cart_setting_banner ">
                                <a class="button-primary" href="http://codecanyon.net/item/woobag-customize-your-cart-easily/12908527?ref=gatelogix">
                                    GET WOOBAG PREMIUM
                                </a>
                            </div>
                        </div>
                    </div>

                </div>

            </div>
        </div>
    </div>
    <?php 
}
Example #10
0
        {
            // Do your settings validation here
            return $input;
        }
        /**
         * Get first part of settings
         * 
         * @since     1.0.0
         * 
         * @param type $wb_call
         * @return type
         */
        public function wb_get_setting_name($wb_call = null)
        {
            return $this->wb_setting_name;
        }
    }
}
/**
 * Returns the main instance of WB to prevent the need to use globals.
 *
 * @since  1.0.0
 * @return Woo_Bag
 */
function WB()
{
    $plugin = new Woo_Bag();
    return $plugin;
}
WB()->wb_run();
        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 
        }
Example #12
0
 /**
  * Get the path to the cms/config folder.
  *
  * @param   string  $path
  * @return  string
  */
 function config_path($file = '')
 {
     if (WB()) {
         return __DIR__ . '/config/' . $file;
     } else {
         return app_path('config/packages/pongocms/cms/' . $file);
     }
 }
 /**
  * Get a setting from an option group
  *
  * @param string option group id
  * @param string section id
  * @param string field id
  * @return mixed setting or false if no setting exists
  */
 function wb_get_single_setting($option_group, $section_id, $field_id)
 {
     $options = get_option($option_group);
     $wb_template_name_part = WB()->wb_get_setting_name();
     if (isset($options[$wb_template_name_part . '_' . $section_id . '_' . $field_id])) {
         return $options[$wb_template_name_part . '_' . $section_id . '_' . $field_id];
     }
     return false;
 }
Example #14
0
<?php

if (WB()) {
    // Workbench path
    require __DIR__ . '/../themes/' . app('config')->get('cms::settings.theme') . '/theme.php';
} else {
    // Vendor path (/themes in project root)
    require __DIR__ . '/../../../../../themes/' . app('config')->get('cms::settings.theme') . '/theme.php';
}
return $THEME_SETTINGS;
<div class="wb_about_wrapper wb_premium_wrapper">
    <div class="row nopadding">
        <div class="col-lg-12 nopadding">
            <div class="col-md-3 wb_about_logo_wrapper">
                <div class="wb_about_logo">
                    <img class="img-responsive" src="<?php 
echo WB()->wb_plugin_url();
?>
/admin/images/wb_logo.png" />
                </div>
            </div>
            <div class="col-md-9 wb_about_title nopadding">
                <div class="col-md-12 nopadding">
                    <h1 class=""> WooBag <?php 
_e('Premium Features', 'woo-bag');
?>
</h1>
                </div>
                <div class="col-md-12 wb_about_text_wrapper">
                    <div class="about-text wb_about_text">
                        <?php 
_e('Get WooBag Premium to have dropdown ajax cart in fixed position, in menu, sidebars, customize any settings without CSS and coding and many more', 'woo-bag');
?>


                    </div>
                </div>
                <div class="col-md-12 nopadding">
                    <div class="wb_cart_setting_banner ">
                        <a class="button-primary" href="http://codecanyon.net/item/woobag-customize-your-cart-easily/12908527?ref=gatelogix">
                            GET WOOBAG PREMIUM
/**
 * 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;
    }
}