Skillnad mellan versioner av "Templating:Export"
Från Vendre Help
Philip (Diskussion | bidrag) (→Types) |
Nabil (Diskussion | bidrag) |
||
| Rad 673: | Rad 673: | ||
|- | |- | ||
|products[].stock_allow_checkout | |products[].stock_allow_checkout | ||
| + | |int | ||
| + | |Evalulated value of configuration and value of product field. | ||
| + | |- | ||
| + | |products[].shipping_class | ||
|int | |int | ||
|Evalulated value of configuration and value of product field. | |Evalulated value of configuration and value of product field. | ||
Versionen från 12 september 2023 kl. 10.56
Innehåll
Types
CategoryTreeNode
| Field | Type | Description |
|---|---|---|
| id | int | Category ID. |
| name | string | Category name. |
| active | bool | Category status. |
| image | Image | Primary image. |
| href | href | Category URL. |
| open | bool | Not used in export files. |
| selected | bool | Not used in export files. |
| sort_order | int | Category sort order. |
| extra1 | string | Extra field 1. |
| extra2 | string | Extra field 2. |
| extra3 | string | Extra field 3. |
| children | list of CategoryTreeNode | Child categories. |
| child_count | int | Number of child categories. |
| description | string | Category description. |
| images | list of Image | Additional category images. |
Image
| Field | Type | Description |
|---|---|---|
| id | int | Image ID. |
| name | string | Image filename. |
| image(params) | string | Returns image path. Query parameters can be attached through params. |
| thumb(width, height, params) | string | Returns thumbnail path for the requested width and height. Query parameters can be attached through params. |
| thumb_preset(preset, fill_color) | string | Returns thumbnail path for the given preset (an URL query string). fill_color is passed as the fill query parameter. |
| img_attr(width, height, params) | dict | Returns a dictionary with the keys src, width and height, calculated for the requested with and height. Query parameters can be attached through params. |
| (cast as string) | string | Same as image(). |
SimpleCategory
| Field | Type | Description |
|---|---|---|
| active | bool | Category status. |
| children | list of SimpleCategory | Category children. |
| color | string | Value of category field. |
| extra_1 | string | Value of category field. |
| extra_2 | string | Value of category field. |
| extra_3 | string | Value of category field. |
| href | href | Link to category in store. |
| id | int | Category id. |
| image | Image | Category primary image. |
| name | string | Category name. |
| parent_id | int | Parent category id. |
| seo_tag_hidden | bool | Value of category field. |
| show | bool | Value of category field. |
| sort_order | int | Value of category field. |
| name_path(separator) | ||
| getCPath() |
Tag
| Field | Type | Description |
|---|---|---|
| active | bool | Tag status. |
| children | list of Tag | Tag children. |
| color | string | Value of tag field. |
| date_added | string | Date tag was created. |
| description | string | Value of tag field. |
| external_id | int | Value of tag field. |
| extra_1 | string | Value of tag field. |
| extra_2 | string | Value of tag field. |
| extra_3 | string | Value of tag field. |
| extra_4 | string | Value of tag field. |
| extra_5 | string | Value of tag field. |
| id | int | Tag ID. |
| image | Image | Tag image. |
| last_modified | string | Date tag was last modified. |
| meta_description | string | Value of tag field. |
| meta_keywords | string | Value of tag field. |
| meta_title | string | Value of tag field. |
| name | string | Value of tag field. |
| parent_id | int | Parent tag ID. |
| seo_tag_hidden | bool | Value of tag field. |
| show | bool | Value of tag field. |
| show_sub_categories | bool | Value of tag field. |
| sort_order | int | Value of tag field. |
| used | bool | May be true in filters. |
| name_path(separator) |
Unit
| Field | Type | Description |
|---|---|---|
| title | string | Unit full name. |
| abbr | string | Abbreviation string of unit. |
| relation_id | int | Relation to another tag. |
| calculation_value | float | Value compared to another tag. |
Variables
| Variable | Type | Description |
|---|---|---|
| shipping_cost_export | string | See settings.SHIPPING_COST_EXPORT. |
| settings.STOCK_LIMITED | bool | Value of setting "Räkna ner lagerantal". |
| settings.STOCK_ALLOW_CHECKOUT | bool | Value of setting "Tillåt köp av produkt som är slut i lager". |
| settings.SHIPPING_COST_EXPORT | string | Value of setting "Fraktkostnad". |
| export_request.get | dictionary | Query parameters used to fetch export file. |
| export_request.post | dictionary | Form parameters used to fetch export file. |
| store_href | href | A link to the store's start page. |
| currency | string | Code of active currency. |
| currency_rate | float | Exchange rate of active currency. |
| products | list of dicts | Products available in the export file. |
| products[].additional_images | list of dicts | Product additional images. |
| products[].additional_images[].description | string | Image description. |
| products[].additional_images[].href | href | Image href. |
| products[].additional_images[].image | Image | Image object. |
| products[].all_category_ids | comma-separated string | Product category ids. |
| products[].categories | list of dicts | Product categories. |
| products[].categories[].href | href | Link to category. |
| products[].categories[].id | int | Category id. |
| products[].categories[].image | Image | Category image object. |
| products[].categories[].name | string | Category name. |
| products[].categories[].seo_link | string | Category URL path. |
| products[].categories_id | int | Primary category id. |
| products[].categories_name | string | Primary category name. |
| products[].category_path | dict of SimpleCategory, indexed by id | Category path for primary category. |
| products[].child_count | int | Number of variant products. |
| products[].combined_full_path_categories | semicolon-separated string | Paths for all product categories. |
| products[].customers_groups | array of ints | IDs of customer groups with access to product. |
| products[].date_added | date | Date product was created. |
| products[].date_available | date | Value of product field. |
| products[].delivery_time | string | Value of product field. |
| products[].ean1 | string | Value of product field. |
| products[].external_calculation_value | float | Value of product field. |
| products[].external_unit | Unit | Selected unit data. |
| products[].external_units_id | int | Value of product field. |
| products[].extra_field_1 | string | Value of product field for current language. |
| products[].extra_field_2 | string | Value of product field for current language. |
| products[].extra_field_3 | string | Value of product field for current language. |
| products[].extra_field_4 | string | Value of product field for current language. |
| products[].extra_field_5 | string | Value of product field for current language. |
| products[].google_product_category | string | Paths |
| products[].hierarchies | array of arrays of dicts | Parent paths of each product category. |
| products[].hierarchies[].href | href | Link to category. |
| products[].hierarchies[].id | int | Category id. |
| products[].hierarchies[].image | Image | Category image object. |
| products[].hierarchies[].name | string | Category name. |
| products[].hierarchies[].seo_link | string | Category URL path. |
| products[].href | href | A link to the product in the store. |
| products[].image | Image | Primary image object. |
| products[].image_id | int | Primary image id. |
| products[].image_path | string | Primary image path. |
| products[].keywords | space-separated string | Product tag names. |
| products[].lowest_number | int | Value of product field. |
| products[].manufacturer_model | string | Value of product field. |
| products[].manufacturers_name | string | Selected manufacturer's name. |
| products[].new_until | date | Value of product field. |
| products[].ordered_recent | int | Calculated number of recently ordered products. |
| products[].package_content | float | Value of product field. |
| products[].parent_id | int | Primary category parent id. |
| products[].price_in | float | Value of product field. |
| products[].price_original | float | Value of product field. |
| products[].price_original_incl | float | price_original with tax added. |
| products[].price_recommended | float | Value of product field. |
| products[].product_parent_id | int | Parent product ID. |
| products[].products_description | string | Value of product field for current language. |
| products[].products_id | int | Product ID. |
| products[].products_model | string | Value of product field. |
| products[].products_name | string | Value of product field for current language. |
| products[].products_price | float | Calculated product price. |
| products[].products_price_incl | float | Calculated product price with tax. |
| products[].products_quantity | int | Stock quantity. |
| products[].products_short | string | Value of product field for current language. |
| products[].products_tax_class_id | int | Value of product field. |
| products[].products_weight | float | Value of product field. |
| products[].products_url | string | Value of product field for current language. |
| products[].quantity_discount_templates_id | int | Value of product field. |
| products[].reseller_check | int | 1 if customer group permissions are enabled for the product. |
| products[].search_engine_text | string | Value of product field. |
| products[].show_in_listing | int | Value of product field. |
| products[].special_price | float | Special price information. |
| products[].special_price.price | float | Calculated special price. |
| products[].special_price.active_from | date and time | Calculated special price. |
| products[].special_price.active_to | date and time | Calculated special price. |
| products[].specifications | array of dicts | Product specifications. |
| products[].specifications[].id | int | Specification id. |
| products[].specifications[].name | string | Specification label. |
| products[].specifications[].type | string | Specification type: 'value' or 'text'. |
| products[].specifications[].value | string | Specification value. |
| products[].specifications[].unit | Unit | Specification unit data. |
| products[].specifications[].short_value | string | Specification short value. |
| products[].stock_allow_checkout | int | Evalulated value of configuration and value of product field. |
| products[].shipping_class | int | Evalulated value of configuration and value of product field. |
| products[].tags | dict of Tag indexed by id | Selected tags. |
| products[].tax_rate | float | Tax rate for product's tax class in current session. |
| products[].unit | Unit | Selected unit data. |
| products[].units_id | int | Selected unit id. |
| products[].video_embed_code | string | Value of product field. |
| products[].video_url | string | Value of product field. |
Functions and Filters
| Function | Type | Description |
|---|---|---|
| product_ean_numbers(product_id) | list of strings | Returns the selected product's EAN numbers, sorted by EAN number. |
| get_categories() | list of CategoryTreeNode | Returns the root categories. |
| | s | string | Escapes the passed string in a way different for each export format. |
| | add_tax | float | Adds tax ti the passed value. |
| | ucfirst | string | Uppercases the first character of the passed string. |
| | d | string | Returns the passed data as JSON. |