myshop-action:orderdirect
Entity | Value |
---|---|
Attribute(s) | style |
Type | action |
Relation | myshop-block:product |
Parameters | quantity = <amount> |
The myShop additionmyshop-action:orderdirect can be used within the context of a myshop-block:product to add single products not on the product list to the shopping basket. This option can be compared to the url orderdirect command and is used mainly at internet checkouts. The addition knows the optional parameter quantity, which allows a variable number of products to be placed in the shopping basket. If no parameter is found the default value 1 is used. In the example below 2 products are placed in the shopping basket by simply clicking on the order button, afterwards the shopping basket is continued.
<table style="myshop-block:productlist" border="1">
<thead>
<tr>
<td> </td>
<td> </td>
<td style="myshop-label:1;font-weight:bold"></td>
<td style="myshop-label:2;font-weight:bold"></td>
</tr>
</thead>
<tr style="myshop-block:product">
<td>
<a style="myshop-action:orderdirect, quantity=2">order</a>
</td>
<td>
<a style="myshop-action:moreinfo">meer info</a>
</td>
<td style="myshop-value:1;color:red"></td>
<td style="myshop-value:2"></td>
</tr>
</table>
In combination with {$formField('<name field>')}
it is also possible to make the number of products dependent on a enter field. This is shown in the next example. The value of fields is transported by clicking on the order button and is then used for the number of products.
<table style="myshop-block:productlist" border="1">
<thead>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td style="myshop-label:1;font-weight:bold"></td>
<td style="myshop-label:2;font-weight:bold"></td>
</tr>
</thead>
<tr style="myshop-block:product">
<td>
<input name="aantal" size="2" value="1"/>
</td>
<td>
<a style="myshop-action:orderdirect, quantity={$fromField(aantal)}">bestellen</a>
</td>
<td>
<a style="myshop-action:moreinfo">meer info</a>
</td>
<td style="myshop-value:1;color:red"></td>
<td style="myshop-value:2"></td>
</tr>
</table>
Post your comment on this topic.