Skip to content

Commit

Permalink
Merge pull request #1493 from vtexdocs/improve/shelf-template-control…
Browse files Browse the repository at this point in the history
…s.md

Update shelf-template-controls.md
  • Loading branch information
carolinamenezes authored Oct 16, 2024
2 parents 29e4795 + 99d6f61 commit 5e5996e
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions docs/guides/legacy-cms/shelf-template-controls.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ createdAt: "2022-09-08T14:28:04.492Z"
updatedAt: "2022-09-08T14:28:04.492Z"
---

VTEX system offers some controls for the creation of shelves.
The Legacy CMS Portal provides a range of controls for creating product shelves. Below, you'll find the most commonly used variables and properties for defining product shelves, including examples for reference.

Product attributes can be stored in variables, and these are used in every template. To declare the variables and receive an attribute of a product, use the following command: `#set ($variable=$attribute)`
## Declaring product variables

## Examples
Product attributes can be stored in variables, and these are used in every template. To declare the variables and receive an attribute of a product, use the following command:

```
#set ($variable=$attribute)
```

### Examples

- `#set($id = $product.Id)`
- `#set($uri = $product.Uri)`
Expand All @@ -24,7 +30,7 @@ Product attributes can be stored in variables, and these are used in every templ
|-------------------------|--------------------------------------------------|
| `$product.Id` | Shows the product ID. |
| `$product.EscapedName` | Shows the product name. |
| `$product.DescriptionShort` | Shows a brief description of the product. |
| `$product.DescriptionShort` | Shows a brief product description. |
| `$product.Uri` | Shows the product link. |
|`$product.GetImageTag(number corresponding to the image)`| Shows the image and the type of image you want. It follows this list of image types: <ul><li>ProductImageShowcaseLittle (Size: 65×65) = 1;</li><li>ProductImageShowcaseMedium (Size: 90×90) = 29;</li><li>ProductImageShowcaseLarge (Size: 130×130) = 30;</li><li>MainProductImage (Size: 250×250) = 2;</li><li>ThumbProductImage (Size: 45×45) = 3;</li><li>ZoomProductImage (Size: 344×344) = 10;</li><li>File = 11;</li><li>ProductManual = 12;</li></ul><br/> The sizes of the images are according to the store's layout.|
|`$product.ProductField(IdField)`| Shows the value of a product field by passing the ID of this field as a parameter.|
Expand All @@ -42,7 +48,7 @@ Product attributes can be stored in variables, and these are used in every templ
| `$product.MaxInstallmentValue` | Shows the value of the installment of the product's highest payment condition, i.e., the value of the largest installment with or without interest. |
| `$product.BestPricePlusTax` | Shows the price PLUS the rates applied to it. Rate values that are set by region, i.e., by using zip codes, will not be displayed on the shelves. If more than one rate includes the same product, the values are summed and displayed by the control. |
| `$product.ListPriceMinusBestPrice` | Shows the absolute difference between the "From" price and the best price of the product. |
| `$product.ListPriceMinusBestPriceInPercent` | Shows the difference (in percentage) of the price "From" to the best price of the product. |
| `$product.ListPriceMinusBestPriceInPercent` | Shows the difference (in percentage) of the price "From" to the best price. |

## Departament and Category

Expand All @@ -65,7 +71,7 @@ Product attributes can be stored in variables, and these are used in every templ

| Property | Description |
|----------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
| `$product.BottomBuyAllSku` | Includes a buy button to add to the list shelf, where the product with specifications added by the customer is sent directly to the cart. If the product has already been purchased for the list, a specific class is added to the item for customization. The control must be added to the shelf template used in the “Lista-Prateleira” page template. |
| `$product.BottomBuyAllSku` | Includes a buy button to add to the shelf list, where the product with specifications added by the customer is sent directly to the cart. If the product has already been purchased for the list, a specific class is added to the item for customization. The control must be added to the shelf template used in the “Lista-Prateleira” page template. |
| `$product.BottomBuy` | Includes a buy button in the shop window that takes the customer directly to the cart if there is only 1 SKU. |
| `$product.ButtonBuyModal(false,true)` | Includes a buy button that inserts the product into the cart and keeps the customer in the shop window. This control needs the `$product.AmountInCart` control to add a desired quantity textbox for adding to the cart. |
| `$product.AmountInCart` | Inserts a textbox element to set the desired quantity of the product to be added to the cart. This control is used in conjunction with the control `$product.ButtonBuyModal(false,true)`. |
Expand Down

0 comments on commit 5e5996e

Please sign in to comment.