コード例 #1
0
 public function enqueue_styles()
 {
     global $post, $woocommerce, $wp_styles;
     $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     if (WPB_Common_Functions::wpb_enabled($post->ID)) {
         wp_enqueue_style('wpb_style_grids', WPB_PLUGIN_ASSETS_DIR . '/css/grid12.css', false);
         wp_enqueue_style('wpb_style_range_slider', '//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css', false);
         wp_enqueue_style('wpb_style_bx_slider', WPB_PLUGIN_ASSETS_DIR . '/css/jquery.bxslider.css', false);
         wp_enqueue_style('wpb_style_styles', WPB_PLUGIN_ASSETS_DIR . '/css/style.css', false);
         echo '<!--[if IE]>';
         wp_enqueue_style('wpb_style_ie_styles', WPB_PLUGIN_ASSETS_DIR . '/css/ie.css');
         echo '<![endif]-->';
         $wp_styles->add_data('wpb_style_ie_styles', 'conditional', 'IE');
         wp_enqueue_script('wpb_script_toucheswipe', WPB_PLUGIN_ASSETS_DIR . '/js/jquery.touchSwipe.min.js', array('jquery'), null, true);
         wp_enqueue_script('wpb_script_flim_roll', WPB_PLUGIN_ASSETS_DIR . '/js/jquery.film_roll.min.js', array('jquery'), null, true);
         wp_enqueue_script('wpb_script_underscore', WPB_PLUGIN_ASSETS_DIR . '/js/underscore-min.js', array('jquery'), null, true);
         wp_register_script('wpb_script_frontend', WPB_PLUGIN_ASSETS_DIR . '/js/wpb.frontend.js', array('jquery'), null, true);
         wp_enqueue_script('jquery-ui-slider');
         wp_enqueue_script('wpb_prettyPhoto', $woocommerce->plugin_url() . '/assets/js/prettyPhoto/jquery.prettyPhoto' . $suffix . '.js', array('jquery'), $woocommerce->version, true);
         //  wp_enqueue_script( 'prettyPhoto-init', $woocommerce->plugin_url() . '/assets/js/prettyPhoto/jquery.prettyPhoto.init' . $suffix . '.js', array( 'jquery' ), $woocommerce->version, true );
         wp_enqueue_style('wpb_woocommerce_prettyPhoto_css', $woocommerce->plugin_url() . '/assets/css/prettyPhoto.css');
         wp_enqueue_script('wpb_script_touch', WPB_PLUGIN_ASSETS_DIR . '/js/jquery.ui.touch-punch.min.js', array('jquery'), null, true);
         wp_localize_script("wpb_script_frontend", "wpb_local_params", array("continue_text" => __("Continue", "wpb"), "add_to_cart_text" => __("Add to Cart", "wpb"), "productId" => $post->ID, "ajaxUrl" => admin_url('admin-ajax.php'), "resetText" => __("Are you sure to reset?", "wpb")));
         wp_enqueue_script('wpb_script_frontend');
     }
 }
コード例 #2
0
 function add_cart_item_data($cart_item_meta, $product_id)
 {
     if (isset($cart_item_meta['wpb_cart_items'])) {
         return $cart_item_meta;
     }
     if (WPB_Common_Functions::wpb_enabled($product_id) && isset($_POST["wpb_cart_items"])) {
         $cart_item_meta['wpb_cart_items'] = $_POST["wpb_cart_items"];
     }
     return $cart_item_meta;
 }
コード例 #3
0
 public function add_class($classes)
 {
     global $post;
     if (WPB_Common_Functions::wpb_enabled($post->ID)) {
         $classes[] = 'wpb-body-product';
     }
     return $classes;
 }