http://modx-shopkeeper.ru/


Translated by kp52.

SHKwidget extender for Ditto

Description

Works in the same way as the SHKwidget snippet, but specially made for use in conjunction with Ditto. It is highly recommended to use this extender rather than the SHKwidget snippet when Ditto is displaying lists of products with additional parameters. It is significantly faster and does not involve extra database queries. Thanks to SSDTyphon for the idea!
On the product pages (no Ditto), use the snippet.

Installation

Place the file SHKwidget.extender.inc.php in the folder assets/snippets/ditto/extenders/.

Parameters (specified in the Ditto call)

&wtTVname - name of the parameter TV(s), to be processed. May be a comma-delimited list;

&wtFormat - display format of the parameter TV(S). Values: `select`(default),`radio`,`checkbox`;

&wtFirstSelected - elect first element (e.g. radio button) (`1`). Default: `0`;

&wtWraptag - wrap in an HTML tag, e.g. &wtWraptag=`div`. Default: `0` (do not wrap);

&wtFunction - JS-function called when element is clicked. Default `jQuery.additOpt(this)`;

Examples of use

[!Ditto? &tpl=`shopStuff`&extenders=`SHKwidget`&wtTVname=`param1,param2`&wtFormat=`select,checkbox`!]

Parameter TV placeholders [+param1+] and [+param2+] will be turned into a drop-down list (select) and a checkbox (checkbox). If you only specify `select` as the &wtFormat parameter, both parameters will be displayed as drop-down lists.