Product-sets

Product-sets for Shop-Script 7

Creation of product-sets like a unique unit

If you want you can show product-set components to customers.

Basics

In plugin settings You can choose the place of output on the product page.

For the output You can use current theme template files:

  • list-thumbs.html
  • list-thumbs-mini.html
  • products.slider.html
  • products.list.html
  • etc.

Plugin find specified templates file by file and when any of them is found, it will be used as template for output.

In plugin settings you have special field, where You can print desired file, which will display the components. You can specify several templates separated by commas in the absence of any of them plugin continued to search among the remaining.

ATTENTION! Depending on Your theme design templates can be different, and the parameters passed to them, can also differ, which may lead to some errors on the page. In order to avoid them - contact the developer of the theme that it helped You.

Plugin has system files for output the components. You can print them to the special field:

  1. itemsets-list-table.html - table display

  2. itemsets-ul.html - list display

  3. itemsets-small-list.html - small table display

On the page Shop - Storefront you can create new HTML theme file, which can be used only for components output, and write it to the special field on the plugin settings page. You can see the example of this file on the plugin settings page.

Custom output

Use helper in any place of the template.

General view of helper: {shopItemsetsPlugin::showItems($product, $sku_id = 0, $template='', $html_display = true)},
where $product - array of product info, or product ID - required
      $sku_id - product sku ID. Need for display sku set items. If you select sku on the product page, sku set items will be changed automatically - not required
           $template - template file (or the list of files separated by commas), used for output - not required
           $html_display - show HTML code before and after the product-set. Available values: true or false.

Examples:
  • {shopItemsetsPlugin::showItems($product, 0, 'itemsets-list-table.html')} - the output on the product page with specifying the template of output
  • {shopItemsetsPlugin::showItems($product)} - the output on the product page without specifying the template of output
  • {shopItemsetsPlugin::showItems(5)} - the output of components for the product ID=5 without specifying the template of output
  • {shopItemsetsPlugin::showItems($p, 0, 'itemsets-small-list.html', false)} - the output in catalog for every product-set with specifying the template of output without HTML code before and after the product-set

Additional helper: {shopItemsetsPlugin::hasItems($product, $sku_id = 0)},
where $product - array of product info, or product ID - required
      $sku_id - product sku ID. - not required

Additional helper needs for checking the existence of product-set items.

Variables in template

$products = array( // components
    sku_id => array( key is sku ID
        'id' => product ID,
        'name' => product name,
        'summary' => product summary,
        'meta_title' => meta title,
        'meta_keywords' => meta keywords,
        'meta_description' => meta description,
        'description' => product description,
        'contact_id' => ID of contact, created the product,
        'create_datetime' => create datetime,
        'edit_datetime' => edit datetime,
        'status' => product status,
        'type_id' => ID of product type,
        'image_id' => ID of product image,
        'sku_id' => ID of product sku,
        'ext' => extention of image,
        'url' => URL of product,
        'rating' => rating,
        'price' => price,
        'compare_price' => compare price,
        'currency' => currency,
        'min_price' => min price,
        'max_price' => max price,
        'count' => product count,
        'rating_count' => rating count,
        'total_sales' => total sales of product,
        'category_id' => category ID,
        'badge' => product badge,
        'frontend_url' => product frontend url,
        'quantity' => quantity of product in the set
    )
)

$current_locale - current locale

$sku_id - product sku ID

$ruble - the value of "Ruble sign" in plugin settings

If you use theme template "Comfortbuy" file products.slider.html, instead of $products you will get $s_products and $sliderId.

Also You can use framework helpers and variables.

Problems

If you have problems with displaying set items - check plugin in theme Default 2.0. If there everything is OK, it means that your theme uses completely different CSS classes. Ask theme developer for help.

  1. Set items are not display

    Fields for selecting the skus must be able to be obtained in the following way: #product-skus input[type=radio], .skus input[type=radio] or .sku-feature

    Missing <input[name='product_id'] >

    Javascript errors
  2. Product sets don't change, when you select other sku

    The same problems.