protected function content($atts, $content = null) { $title = $asset_type = $carousel = $product_size = $width = $sidebars = $el_class = $output = $items = $el_position = ''; extract(shortcode_atts(array('title' => '', 'asset_type' => 'best-sellers', 'carousel' => 'no', 'product_size' => 'standard', 'item_count' => '8', 'category' => '', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts)); /* PRODUCT ITEMS ================================================== */ if (sf_woocommerce_activated()) { $items = sf_product_items($asset_type, $category, $carousel, $product_size, $item_count, $width); } else { $items = __("Please install/activate WooCommerce.", "swift-framework-admin"); } $el_class = $this->getExtraClass($el_class); $width = spb_translateColumnWidthToSpan($width); $output .= "\n\t" . '<div class="product_list_widget products-' . $product_size . ' woocommerce spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb_wrapper">'; $output .= $title != '' ? "\n\t\t\t" . '<h3 class="spb-heading"><span>' . $title . '</span></h3>' : ''; $output .= "\n\t\t\t\t" . $items; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); $output = $this->startRow($el_position) . $output . $this->endRow($el_position); if ($carousel == "yes") { global $sf_include_carousel; $sf_include_carousel = true; } global $sf_include_isotope, $sf_has_products; $sf_include_isotope = true; $sf_has_products = true; return $output; }
protected function content($atts, $content = null) { $title = $asset_type = $carousel = $width = $sidebars = $el_class = $output = $items = $el_position = ''; extract(shortcode_atts(array('title' => '', 'asset_type' => 'best-sellers', 'category' => '', 'products' => '', 'display_type' => '', 'display_layout' => '', 'carousel' => 'no', 'multi_masonry' => 'no', 'fullwidth' => 'no', 'gutters' => 'yes', 'columns' => '4', 'item_count' => '8', 'order_by' => '', 'order' => '', 'button_enabled' => 'no', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts)); if (isset($atts['display_layout']) && $atts['display_layout'] == "grid") { $atts['display_layout'] = "standard"; } $view_all_icon = apply_filters('sf_view_all_icon', '<i class="ss-layergroup"></i>'); /* SIDEBAR CONFIG ================================================== */ global $sf_sidebar_config; $sidebars = ''; if ($sf_sidebar_config == "left-sidebar" || $sf_sidebar_config == "right-sidebar") { $sidebars = 'one-sidebar'; } else { if ($sf_sidebar_config == "both-sidebars") { $sidebars = 'both-sidebars'; } else { $sidebars = 'no-sidebars'; } } /* PRODUCT ITEMS ================================================== */ if ($asset_type == "categories") { $atts['multi_masonry'] = "no"; } if (sf_woocommerce_activated()) { $items = sf_product_items($atts); } else { $items = __("Please install/activate WooCommerce.", 'swift-framework-plugin'); } /* OUTPUT ================================================== */ global $sf_product_display_layout; if ($display_layout != "") { $sf_product_display_layout = $display_layout; } $el_class = $this->getExtraClass($el_class); $width = spb_translateColumnWidthToSpan($width); $page_button = $title_wrap_class = ""; $has_button = true; $shop_page_url = get_permalink(wc_get_page_id('shop')); $page_button = '<a class="sf-button medium white sf-icon-stroke " href="' . $shop_page_url . '">' . $view_all_icon . '<span class="text">' . __("VIEW ALL PRODUCTS", 'swift-framework-plugin') . '</span></a>'; if ($has_button && $button_enabled == "yes") { $title_wrap_class .= 'has-button '; } if ($fullwidth == "yes" && $sidebars == "no-sidebars" && $width == "col-sm-12") { $title_wrap_class .= 'container '; } $output .= "\n\t" . '<div class="product_list_widget woocommerce spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb-asset-content">'; $output .= "\n\t\t" . '<div class="title-wrap clearfix ' . $title_wrap_class . '">'; if ($title != '') { if ($fullwidth == "yes") { $output .= '<h2 class="spb-heading"><span>' . $title . '</span></h2>'; } else { $output .= '<h3 class="spb-heading"><span>' . $title . '</span></h3>'; } } if ($carousel == "yes") { $output .= spb_carousel_arrows(); } if ($has_button && $button_enabled == "yes") { $output .= $page_button; } $output .= '</div>'; $output .= "\n\t\t" . $items; $output .= "\n\t\t" . '</div>'; $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); if ($fullwidth == "yes" && $sidebars == "no-sidebars" && $width == "col-sm-12") { $output = $this->startRow($el_position, '', true) . $output . $this->endRow($el_position, '', true); } else { $output = $this->startRow($el_position) . $output . $this->endRow($el_position); } if ($carousel == "yes") { global $sf_include_carousel; $sf_include_carousel = true; } global $sf_include_isotope, $sf_has_products; $sf_include_isotope = true; $sf_has_products = true; return $output; }