Инструменты пользователя

Инструменты сайта


shopkeeper3-en

Shopkeeper 3.x Documentation

Description

''This is translated by Google and refined by Dimitri Hilverda, the refinement is an ongoing process while I am discovering Shopkeeper3, I will be updating this document.''

Snippet displays the basket of goods on the site. Goods in the shopping cart can be added without JavaScript.

Options

  • lang - language. Default - ru.
  • prodCont - CSS-selector element, inside which is a commodity information (default div.shk-item);
  • cartTpl - Chunk basket (it contains two parts: empty basket and a basket of commodities). Default - shopCart.
  • cartRowTpl - Chunk product line in the basket. Default - shopCartRow.
  • packageName - Package name product database table: "shop". Default is empty (modResource).
  • className - class table name database products. Example: "ShopContent". Default is empty (modResource).
  • fieldPrice - Field Name or TV with the price of the products. Default - price.
  • fieldName - Field Name or TV with the name of the product. Default - pagetitle.
  • getUnpublished - Allow add to cart unpublished items. Default - false.
  • allowFloatCount - Allow floating point numbers for the count of the goods. Default - false.
  • excepDigitGroup - Make bit larger numbers in prices.
  • orderFormPageId - resource id from the check outpage.
  • currency - Currency. Default - rub.
  • processParams - calculates additional parameters before adding product to cart.
  • savePurchasesFields - List of fields (TV or names) of the goods that you want to display in your shopping cart and store ordering (separated by commas).
  • orderDataRowTpl - line chunk of goods listed in the letter, which is sent when the order ( [[+orderOutputData]]). Default orderDataRow.
  • additParamSource - source resource ID extra. parameters. If you have parameters that are common to all or a group of products, you can create a resource where to create and edit parameters. You do not need to create them for each product separately.
  • flyToCart - The effect of adding an item to the cart - helper | image | nofly (default helper);
  • noJQuery - Do not load jquery.js (default 0);
  • jsScript - Control JS-script loading (default 1).     values:     - 1 - download all the JS-scripts (except jquery.js).     - 2 - do not download JS-files, but derive initialisation script Shopkeeper (recommended, but you need to understand why you do it).     - 0 - do not download any scripts.
  • style - Style baskets (default default);
  • pluralWords - The words separated by commas, that you want to decline in number. By default, words are taken from the language file (goods, goods, goods).
  • groupBy - field name by which to group the items in your shopping cart.     Example: &groupBy=`parent `

Example

[[!shopkeeper3@cart_catalog]]

Cart_catalog - set name parameters. It is recommended to specify all the parameters in the parameter set, as to synchronize the settings with the Ajax request.

You can display two or more baskets on a single page.

An example of a chunk of the basket of goods:

<div class="shop-cart" data-shopcart="1">
    <div class="shop-cart-head"> <b>Cart</ b> </div>
    <div class="empty">
        <div class="shop-cart-empty">Empty</div>
    </div>
</div>
<-! Tpl_separator ->
<div class="shop-cart" data-shopcart="1">
    <div class="shop-cart-head"> <b> Cart </ b> </div>
    <div class="full">
        <div style="text-align: right;">
            <a href="[[+empty_url]]" id="shk_butEmptyCart"> Clear cart </a>
        </div>
        <div class="shop-cart-body"> Joined: <b> [[+items_total]] </ b> [[+plural]] </div>
        <div style="text-align: right;"> The total amount of: <b> [[+price_total]] </ b> [[+currency]]
        </div>
        <div class="cart-order">
            <a href="[[+order_page_url]]" id="shk_butOrder"> Checkout </a>
        </div>
    </div>
</div>

A chunk consists of two parts, separated by a special separator <-! Tpl_separator ->

The first part - a chunk empty basket of goods. The second part - a chunk of the basket of goods.

`` data-shopcart="1" `- a label on which is determined by a set of parameters for AJAX-updating of the basket.

In the system settings (System Settings -> shopkeeper3) in parameter "shk3.property_sets" need to specify a set of parameter names (can be several comma-separated) that are used on your site to the snippet Shopkeeper. It is necessary to synchronize with the AJAX-updating of the basket.

For example shk3.property_sets=cart_catalog, cart_order_page

In this case, the chunk (cartTpl), which is specified in the parameter set "cart_catalog" you need to put the label data-shopcart="1".

And in the chunk, which is specified in the parameter set "cart_order_page" put a label `` data-shopcart="2" `(parameter set number).

Placeholders on the page

  • shk.price_total - The total price of the goods in the basket.
  • shk.items_total - The total number of items in the cart.
  • shk.items_unique_total - The number of unique goods
  • shk.delivery_price - Delivery Price.

Placeholders available in chunk "cartTpl"

  • [[+inner]] - a list of goods (pattern cartRowTpl);
  • [[+price_total]] - the total price of the goods in the basket;
  • [[+items_total]] - the total number of items in the cart;
  • [[+items_unique_total]] - the total number of unique items in the cart;
  • [[+plural]] - the word "goods" in the plural, depending on the number ofselected items;
  • [[+this_page_url]] - the address of the current page;
  • [[+empty_url]] - link to empty the trash;
  • [[+order_page_url]] - a reference to the checkout page;
  • [[+currency]] - the currency of the goods;
  • [[+delivery_name]] - The name of theselected delivery.
  • [[+delivery_price]] - Price of theselected delivery.

Placeholders available in chunk "cartRowTpl"

  • [[+name]] - the name of the product;
  • [[+id]] - Product ID;
  • [[+url]] - link to the product page;
  • [[+price]] - the price of goods;
  • [[+price_total]] - the total price of the goods, including additional. options;
  • [[+price_count]] - Price, umnzhennaya to count;
  • [[+price_count_total]] - the total price of the goods with the parameters multiplied by the number of;
  • [[+currency]] - the currency of the goods;
  • [[+count]] - the quantity of goods;
  • [[+index]] - the serial number of the goods in the basket on the ground;
  • [[+num]] - the serial number of the goods in the basket on the unit;
  • [[+even]] - even or odd items (outputs 1 or 0);
  • [[+comma]] - a comma (shown between the goods);
  • [[+url_del_item]] - a reference to the removal of the goods from the basket;
  • [[+addit_data]] - the additional parameters of the goods;
  • [[+any TV]] - any TV-setting, such as [[+image]] `; To save the basket use the savePurchasesFields.
  • [[+shk_lyuboy dop.parametr]] `- any extra. option isselected when you add the goods in the basket (from [[+addit_data]]), such as [[+shk_param1]].     If the settings are made in the form of checkboxes, then to bring each of them separately, you need to add an index (the number zero) for the following parameters for the first.     Example: [[+shk_param1]], [[+shk_param1_1]], [[+shk_param1_2]] ...
  • [[+shk_lyuboy dop.parametr_price]] - price dop.parametra. Example: [[+shk_param1_price]].

These last order

After sending the order on any page available placeholders with data of this order:

  • shk.id - ID of the order;
  • shk.price - the total price of the order;
  • shk.currency - Order currency;
  • shk.date - order date in the format DD.MM.YYYY;
  • shk.full_date - date and time of the order in the format YYYY-MM-DD HH: MM: SS;
  • shk.email - e-mail address of the buyer;
  • shk.phone - the buyer's phone number;
  • shk.delivery - delivery method;
  • shk.payment - method of payment;
  • shk.userid - ID user (buyer).

Also last order data stored in the session shk_lastOrder.

Events for plug-ins

  • OnSHKaddProduct - Adding a product to the cart. $ purchaseArray
  • OnSHKAfterAddProduct - After adding a product to the cart. $ PurchaseArray, $ index, $ id
  • OnSHKgetProductPrice -selection of the price of goods when added to cart. $ Price, $ id, $ purchaseArray
  • OnSHKgetDeliveryPrice -selecting dosavki prices. $ price
  • OnSHKgetProductAdditParamPrice -selection of additional price. Product option when adding to cart. $ Price, $ id
  • OnSHKcalcTotalPrice - Calculate the total price of the goods in the basket. $ Price_total, $ purchases
  • OnSHKbeforeCartLoad - Called before the formation of HTML-code basket.
  • OnSHKcartLoad - Display the basket. $ Items_total, $ price_total
  • OnSHKChangeStatus - Change order status. Available: $ order_ids, $ status.
  • OnSHKsaveOrder - Sending order. $ order_id
  • OnSHKAfterRemoveProduct - After removal of the goods from the basket. $ Index, $ id
  • OnSHKAfterClearCart - After cleaning the basket (delete all items).

Widget

To add a widget "Orders statistics" on the panel, go "Panel" -> "Panel" -> "the Default" -> "Edit" -> "Add widget" -> "order statistics". Drag the widget to the top of the list.

Plugin "shk_updateInventory" - Accounting for goods in stock


The plugin changes the value (the value of the field or TV) count of stock on hand, for a transfer order to the desired status. By default the plugin is disabled, you need to turn it on and configure:

Inventory_fieldname - Field name or TV, which recorded the number of goods in stock. Default - inventory. Plugin_status - status number (1) in which the need to reduce the number of products in stock. Default - 2. Context - context name cache to be cleared after recalculation of the goods in the warehouse.

Additional parameters of the goods

Goods can assign parameters to which the buyer can choose the product before adding to cart. Goods can assign parameters to which the buyer can choose the product before adding to cart. The parameters are displayed in a drop-down list - shk_select, radio buttons - shk_radio or check boxes (checkboxes) - shk_checkbox. select the type of output can be in the TV-settings on the "Output Settings" tab.

For convenience, I use the input type "param_edit".

The parameter values ​​(in resource editing page (Product)) are introduced on the following principle: the name of the 1 == 1 || name price setting price 2 == 2 || ...

You can enter a value for money option with a multiplication sign: Weight 0.5 || == * == * Weight 1 In this case, the price of goods will be multiplied by the price parameter.

The chunk snippet getResources or getProducts parameters displayed as placeholders: [[+tv.param1]].

On the product page (in the product template) need to change the ID parameter. This can be done with the help replace the filter:

[[*Param1: replace=`[[+id]]==[[*id]]`]]

The controller output parameters: core/model/modx/processors/element/tv/renders/mgr/properties / Output Options: manager/templates/default/element/tv/renders/properties / O controllers: core/model/modx/processors/element/tv/renders/web/output /

Two or more prices for one commodity

To do this, create two or more forms ( <form>) and a field name=«shk-id» after the ID write TV name with the price.

Example:

<Input type="hidden" name="shk-id" value="[[*id]] __ price2" />

When you submit the form to be added to the price of the basket TV-parameter (or fields) with the name «price2».

Example with a choice of the type of product with different prices:

<select name="shk-id">
  <option value="[[*id]] __ price"> Purchase ([[*price]] rub.) </ Option>
  <option value="[[*id]] __ price2"> Rent ([[*price2]] rub.) </ Option>
</select>

Adding to the data without creating a cart TV-parameters


Example:

<Input type="text" name="test __ [[*id]] __ add" value="additional data" />

Add to cart Add parameter that can be displayed in place of the insert placeholder [[+shk_test]] (will indicate "additional information").

Snippet shkOptions

Shopkeeper snippet to display the configuration. For example, you can display a list of modes of delivery and payment.

Options:

  • get - Names of parameters that need to be removed from the database. It can be several, separated by commas.
  • post_name - The names of the fields in the form. For example output when ordering. It is necessary for the placeholder [[+selected]] - theselected value.
  • tpl - chunk name for a single-line option.
  • toPlaceholders - send output to the placeholders (separated by parameter name). Default 0 (off.).
  • pl_prefix - Prefix the name of the placeholder. Default: shkopt_.

Example chunk (tpl):

<option value="[[+value]]" [[+selected]]> [[+label]] </option>

Example of use:

[[!shkOptions?
&get=`delivery, payments`
&post_name=`shk_delivery, payment`
&toPlaceholders=`1`
&pl_prefix=`shkopt_`
&tpl=`select_option`
]]

Delivery method:

<select name="shk_delivery">
    <option value=""> </ option>
    [[!+shkopt_delivery]]
</select>

Payment method:

<select name="payment">
    <option value=""> </ option>
    [[!+shkopt_payments]]
</select>

To dynamically update the delivery price in the basket, you can use the following script:

<script type="text/javascript">
$(document) .bind ( 'ready', function () {
    if (shk.data.delivery_name) {
        $('select [name="shk_delivery"]', '# shopOrderForm') val (shk.data.delivery_name).;
    }
    $('select [name="shk_delivery"]', '# shopOrderForm'). Bind ( 'change', function () {
        shk.selectDelivery ($(this) .val ());
    });
});
</script>

Shopkeeper snippet to display the configuration. For example, you can display a list of modes of delivery and payment.

Options:

  • get - Names of parameters that need to be removed from the database. It can be several, separated by commas.
  • post_name - The names of the fields in the form. For example output when ordering. It is necessary for the placeholder [[+selected]] - theselected value.
  • tpl - chunk name for a single-line option.
  • toPlaceholders - send output to the placeholders (separated by parameter name). Default 0 (off.).
  • pl_prefix - Prefix the name of the placeholder. Default: shkopt_.

Example chunk (tpl):

<option value="[[+value]]" [[+selected]]> [[+label]] </ option>

Example of use:

[[!ShkOptions?
&get=`delivery, payments`
&post_name=`shk_delivery, payment`
&toPlaceholders=`1`
&pl_prefix=`shkopt_`
&tpl=`select_option`
]]

Delivery method:

<select name="shk_delivery">
    <option value=""> </ option>
    [[!+shkopt_delivery]]
</select>

Payment method:

<select name="payment">
    <option value=""> </ option>
    [[!+shkopt_payments]]
</select>

To dynamically update the delivery price in the basket, you can use the following script:

<script type="text/javascript">
$(document) .bind ( 'ready', function () {
    if (shk.data.delivery_name) {
        $('select [name="shk_delivery"]', '# shopOrderForm') val (shk.data.delivery_name).;
    }
    $('select [name="shk_delivery"]', '# shopOrderForm'). Bind ( 'change', function () {
        shk.selectDelivery ($(this) .val ());
    });
});
</script>

multicurrency

For multicurrency used plugin "shk_multicurrency". Make sure that it is enabled (disabled by default).

Parameters used in the system settings:  - Shk3.currency - the name of the default currency.  - Shk3.currency_default - Currency number in the default list.

Courses are given in vylyut Shopkeeper3 component configuration. "Order Management" -> "Settings" -> "Exchange rates".

If all prices online store set in US dollars (USD), parameter "shk3.currency_default" you need to specify the value "3" (without the quotes) if the list currency USD number 3.

The template in the right spot to place a drop-down list with a choice of currencies:

<select id="site_currency" name="curency">
    <option value="1"> rub. </ Option>
    <option value="2"> UAH. </ Option>
    <option value="3"> USD </ option>
    <option value="4"> euro </ option>
</select>

Also, a list of currencies can be displayed using the snippet "shkOptions".

When you select a currency, all prices will be translated at the appropriate exchange rate.

For the price of translation to the product page template to use "shk_curr_rate" modifier:

[[!*price:shk_curr_rate]] [[!+shk_currency]]

Shk_currency - Currency placeholder names.

Example output prices in the chunk getProducts snippet in the derivation of the product list:

[[+Tv.price: shk_curr_rate]] [[+shk_currency]]

If your site is only one currency, but the price of the goods listed in a different currency, you need to add the "shk3.currency_selected" ( "shopkeeper3" namespace) in the system settings to the value - the currency number (One unit) which need to be translated. For example, if the price of the goods listed in dollars, and you want to display in rubles: shk3.currency_default=3 (USD) shk3.currency_selected=1 (rub.) 3 - USD currency number in the list of courses currencies.

shopkeeper3-en.txt · Последние изменения: 2017/02/10 12:51 — dimmy