Contract Management
Last updated
Was this helpful?
Last updated
Was this helpful?
Omnitron's flexible and robust content management system enables businesses to create customized mailing templates tailored to specific needs, such as contracts. These templates ensure seamless communication while adhering to legal and operational standards. In this guide, you'll learn how to create a mailing template specifically designed for contract purposes. The process involves setting up the template, configuring its properties, and ensuring it integrates smoothly with frontend endpoints for dynamic usage.
Key Features of Contracts:
Multilingual Support: Specify the language of the template to cater to diverse audiences.
Site-Specific Targeting: Assign templates to multiple sites for broader reach.
Customizable Design: Use HTML to structure and style templates.
Dynamic Fields: Leverage placeholders and model-based data for personalized content.
Active/Passive Control: Easily toggle the status of templates.
This document provides a step-by-step guide to creating mailing templates for Info Contracts and Sales Contracts, accompanied by example configurations and frontend integration details to streamline implementation.
To create a mailing template for contracts in the Omnitron system, follow these steps:
Log in to Omnitron.
Navigate to Sales Channels > Content Management > Mailing Templates.
Click the + New Mailing Template button to access the template creation page.
Configure the template settings:
Name: Select the "Other" option to manually input the template name. Available names for contracts:
orders/info-contract.html
orders/sales-contract.html
Status: Assign a boolean value: Active or Passive.
Language: Specify the language of the contract by selecting from the provided list.
Sites: Choose the sites where the contract will be displayed. Multiple site selections are allowed.
Content: Enter the corresponding HTML file for the contract.
Name: Other > orders/info-contract.html
Status: Active
Language: English
Sites: Akinon.Net
Content:
Name: Other > orders/sales-contract.html
Status: Active
Language: Turkish
Sites: Akinon.Net
Content:
Once the mailing template is created, the frontend must call the appropriate endpoint to retrieve the contract details. This endpoint supports multiple contract types: info or sales, and returns the contract as an HTML file.
GET
Retrieve Contract DetailsPath: /orders/contract/
Authentication Required: No
Headers:
contract_name
Specifies the type of contract. Accepted values: info
sales
The response contains the contract in HTML format. The content will render the contract directly as text or a downloadable HTML file, depending on the browser or client.
This error indicates that the provided template name (contract_name) is invalid.
This section provides a detailed explanation of the dynamic values that can be used within the content of the uploaded HTML file. These values are derived from models such as PreOrder, Basket, BasketItems, Products, and other related entities, enabling a customized experience for users.
Below is a comprehensive list of each field and its associated data structure with descriptions.
The PreOrder model contains essential information for the order process, including the basket, delivery, and payment options. The following table outlines the fields available in the PreOrder model and their descriptions:
pre_order.basket → Basket
The basket associated with the preorder, containing items to be purchased.
pre_order.shipping_address → Address
The address where the order will be shipped.
pre_order.billing_address → Address
The address used for billing purposes.
pre_order.shipping_option → ShippingOption
The chosen shipping method for the order.
pre_order.payment_option → PaymentOption
The payment method selected for the preorder.
pre_order.delivery_option → DeliveryOption
The delivery option chosen for the order.
pre_order.retail_store → RetailStore
The retail store associated with the order, if applicable.
pre_order.sample_products → Product
The list of sample products included in the order.
pre_order.bags → Product
The list of bags included in the order.
pre_order.installment → Installment
The installment plan details, if applicable.
pre_order.shipping_amount
The cost of shipping the order.
pre_order.total_amount
The total amount of the order.
pre_order.total_amount_with_interest
The total amount of the order, including interest.
pre_order.loyalty_money
The loyalty money or points applied to the order.
pre_order.phone_number
The contact phone number for the order.
pre_order.delivery_range
The expected delivery time range for the order.
pre_order.user_phone_number
The phone number provided by the user.
pre_order.billing_and_shipping_same
Indicates if the billing and shipping addresses are the same.
pre_order.is_guest
Indicates if the order was placed by a guest user.
pre_order.selected_card
The card selected for the payment.
The Basket model represents the collection of items a user intends to purchase. It also includes details like discounts, quantities, and total costs. Below are the available fields for the Basket model:
basket.basketitem_set → BasketItem[]
The list of Basket Items in the basket.
basket.discounts → Discount
The discounts applied to the basket.
basket.total_quantity
The total quantity of items in the basket.
basket.total_amount
The total price of all items in the basket before discounts.
basket.total_discount_amount
The total amount of discounts applied to the basket.
basket.total_product_amount
The total cost of all products in the basket, excluding discounts and taxes.
basket.created_date
The date and time when the basket was created.
The BasketItem model provides detailed information about individual items in the basket, such as product details, quantities, and pricing. The following fields are available:
basket.basketitem_set[0].product → Product
The Product associated with the Basket Item.
basket.basketitem_set[0].shipping_discount → Discount
The shipping discount applied to the basket item.
basket.basketitem_set[0].datasource_detailed → DataSource
The detailed information about the Data Source for the product.
basket.basketitem_set[0].tax_rate
The tax rate applied to the Basket Item.
basket.basketitem_set[0].quantity
The quantity of the product associated with Basket Item.
basket.basketitem_set[0].currency_type
The currency type for pricing.
basket.basketitem_set[0].unit_price
The price per unit of the product.
basket.basketitem_set[0].total_amount
The total amount for the basket item.
basket.basketitem_set[0].image
The image URL associated with the product.
The Product model contains detailed information about a product, including attributes, pricing, stock, and associated images. Below is a list of fields available for the Product model:
product.productimage_set → ProductImage[]
The list of Product Image associated with the product.
product.category → CategoryNode
The category the product belongs to.
product.parent → Product
The parent product.
product.name
The name of the product.
product.sku
The SKU of the product.
product.base_code
The base code of the product.
product.in_stock
Indicates whether the product is in stock.
product.price
The price of the product.
product.retail_price
The retail price of the product.
product.stock
The available stock quantity for the product.
product.currency_type
The type of currency. (try, eur)
product.price_type
The type of price. (default, range_)
product.unit_type
The unit type for the product. (qty, kg)
product.tax_rate
The tax rate applied to the product.
product.absolute_url
The URL to access the product details page.
product.attributes
The attributes or specifications of the product.
product.attributes_kwargs
Additional keyword arguments for product attributes.
product.product_type
The type of the product. (simple, bundle)
product.data_source → DataSource
The Data Source associated with the product.
product.productimage_set[0].status
The status of the product image (active, disabled)
product.productimage_set[0].image
The URL of the product image.
product.productimage_set[0].order
The display order of the product image.
product.productimage_set[0].created_date
The date and time when the product image was created.
The Category Node model represents the category details of a product or item. Below is the field provided:
category.name
The name of the category.
The Discount model provides information about any discounts applied to a basket or product. Below are the available fields:
discount.description
The description of the discount applied.
discount.discount
The amount of the discount.
The DataSource model contains detailed information about the seller, supplier, or related data entity. Below are the fields available:
data_source.name
The name of the seller.
data_source.slug
The slug for the seller.
data_source.title
The title for the seller.
data_source.supplier_code
The supplier code associated with the seller.
data_source.address
The address of the seller.
data_source.email
The email address for communication with the seller.
data_source.phone_number
The phone number for the seller.
data_source.fax_number
The fax number for the seller.
data_source.kep_address
The KEP address of the seller.
data_source.mersis_number
The Mersis Number of the seller.
The ByDataSources model provides information about the list of Basket Items grouped by Data Source associated with an order. Below are the fields included:
by_data_sources[0].data_source
The supplier code of the seller.
by_data_sources[0].basket_items → BasketItem[]
The list of basket items associated with the seller.
The Address model provides details about a specific address, such as location, contact information, and whether it’s associated with an individual or a company. Below are the available fields:
address.country → Country
The country associated with the address.
address.city → City
The city associated with the address.
address.township → Township
The township associated with the address.
address.district → District
The district associated with the address.
address.phone_number
The phone number associated with the address.
address.email
The email address associated with the address.
address.first_name
The first name of the person associated with the address.
address.last_name
The last name of the person associated with the address.
address.line
The line or street details of the address.
address.title
The title or label for the address.
address.post_code
The postal code for the address.
address.notes
Notes or additional details about the address.
address.company_name
The company name, if the address is corporate.
address.tax_office
The tax office associated with the address.
address.is_corporate
Indicates if the address is corporate.
address.identity_number
The identity number of the individual associated with the address.
These models define the geographical hierarchy for addresses. Below are the fields:
country.name
The name of the country.
country.code
The code of the country.
city.name
The name of the city.
township.name
The name of the township.
district.name
The name of the district.
The ShippingOption model outlines the details of the shipping method chosen for an order. The following fields are available:
shipping_option.name
The name of the shipping option.
shipping_option.slug
The slug of the shipping option.
shipping_option.logo
The URL for the logo of shipping option.
shipping_option.shipping_amount
The cost of the shipping option.
shipping_option.description
The description of the shipping option.
The PaymentOption model provides information about the payment methods available for an order. Below are its fields:
payment_option.name
The name of the payment option.
payment_option.slug
The slug of the payment option.
payment_option.payment_type
The type of payment (credit_card, funds_transfer).
The DeliveryOption model defines the delivery method chosen for an order. Below are the available fields:
delivery_option.name
The name of the delivery option.
payment_option.slug
The slug for the delivery option.
payment_option.delivery_option_type
The type of delivery option (customer, retail_store).
The Installment model provides details about installment plans used in payment. Below are its fields:
installment.price_with_accrued_interest
The total price with accrued interest for the installment plan.
installment.installment_count
The number of installments in the plan.
installment.label
The label or description for the installment plan.
installment.monthly_price_with_accrued_interest
The monthly payment amount with accrued interest.
The RetailStore model provides information about a specific retail store associated with an order. Below are the fields included:
retail_store.name
The name of the retail store.
retail_store.address
The address of the retail store.
retail_store.township → Township
The township where the retail store is located.
retail_store.district → District
The district where the retail store is located.