### Execute Console Installation
Source: https://github.com/cscart/docs/blob/4.11.x/en/install/install_via_console.md
Command to run the CS-Cart or Multi-Vendor installation script from the console. Navigate to the 'install' directory and execute this command to start the standard installation process.
```bash
php index.php
```
--------------------------------
### Example Upgrade Log File
Source: https://github.com/cscart/docs/blob/4.11.x/en/upgrade/upgrade.md
This log details the steps taken during an upgrade process, including package installation, validator execution, backup operations, file copying, migration execution, and language installation.
```log
2015-03-27 12:01:13: Start installation of the "core" upgrade package
2015-03-27 12:01:13: ================================================
2015-03-27 12:01:13: Get all available validators
2015-03-27 12:01:13: Execute "collisions" validator
2015-03-27 12:01:13: Upgrade stopped: Awaiting resolving validation errors: collisions
2015-03-27 12:01:21:
2015-03-27 12:01:56: Start installation of the "core" upgrade package
2015-03-27 12:01:56: ================================================
2015-03-27 12:01:56: Get all available validators
2015-03-27 12:01:56: Execute "collisions" validator
2015-03-27 12:01:56: Execute "permissions" validator
2015-03-27 12:01:56: Execute "restore" validator
2015-03-27 12:01:56: Backup files and Database
2015-03-27 12:01:56: Copy package files
2015-03-27 12:01:56: Run migrations
2015-03-27 12:01:56: Phinx by Rob Morgan - http://phinx.org. version 0.3.7
2015-03-27 12:01:56:
2015-03-27 12:01:56: using config file ./app/Tygh/UpgradeCenter/Migrations/config.migrations.php
2015-03-27 12:01:56: using config parser php
2015-03-27 12:01:56: using migration path /Users/alexions/www/git/work/var/upgrade/packages/core/content/migrations
2015-03-27 12:01:56: using environment development
2015-03-27 12:01:56: using adapter mysql
2015-03-27 12:01:56: using database alexions_staging
2015-03-27 12:01:56:
2015-03-27 12:01:56: == 20150317072105 CoreChangePrivelegeName: migrating
2015-03-27 12:01:56: == 20150317072105 CoreChangePrivelegeName: migrated 0.0034s
2015-03-27 12:01:56:
2015-03-27 12:01:56: All Done. Took 0.1739s
2015-03-27 12:01:56: Install langauges from the upgrade package
2015-03-27 12:01:56: Install the "en" language
2015-03-27 12:01:56: Upgrade completed
```
--------------------------------
### Install Documentation Dependencies
Source: https://github.com/cscart/docs/blob/4.11.x/README.rst
Install all necessary Python dependencies for building the documentation using pip and the requirements file.
```bash
$ pip install -r requirements.txt
```
--------------------------------
### Example of Assigning Product Data to Templater
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/core/controllers/index.md
This example shows how to assign product name and description variables to the templater for display. This code is executed within a GET request mode.
```php
if ($mode == 'manage') {
$product_name = 'Product 1';
$product_description = 'Product description';
$view->assign('tpl_product_name', $product_name);
$view->assign('tpl_product_description', $product_description);
}
```
--------------------------------
### Download Multi-Vendor Installation Package
Source: https://github.com/cscart/docs/blob/4.11.x/en/install/digitalocean.md
Download the Multi-Vendor edition installation package using wget.
```bash
wget "https://www.cs-cart.com/index.php?dispatch=pages.get_trial&page_id=297&edition=multivendor" -O multi-vendor.zip
```
--------------------------------
### Example Product Banner Link
Source: https://github.com/cscart/docs/blob/4.11.x/en/user_guide/mobile_app/faq.md
An example of how to format a banner link to a specific product in the mobile app.
```plaintext
index.php?dispatch=products.view&product_id=248
```
--------------------------------
### Install Theme for Storefront
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/addons/compatibility/adapting_4104_to_4111.md
Installs a theme for a storefront, with an option to copy layouts from another storefront.
```php
\Tygh\Storefront\Repository::installTheme($storefront_id, $theme_name, $copy_layouts_from_storefront_id = null)
```
--------------------------------
### Example MySQL Import Command
Source: https://github.com/cscart/docs/blob/4.11.x/en/install/moving_to_another_server.md
An example of the MySQL import command, showing how to specify the username 'root' and database name 'test'.
```bash
mysql -uroot -p test < my_database_backup.sql
```
--------------------------------
### List Installed Languages
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/api/entities/languages.md
Send a GET request to this endpoint to retrieve a list of all installed languages in the store. Pagination parameters can be added to control the response.
```HTTP
GET /api/languages/
```
```HTTP
GET /api/languages/?page=2&items_per_page=2
```
--------------------------------
### Functions Block Example
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/addons/scheme/scheme2.0_structure.md
Defines user-defined functions to be called on specific add-on events like installation and uninstallation.
```xml
- fn_google_export_add_features
- fn_google_export_add_feed
- fn_google_export_remove_features
- fn_google_export_remove_feed
```
--------------------------------
### Example: Build Upgrade Package
Source: https://github.com/cscart/docs/blob/4.11.x/en/upgrade/upgrade_package.md
An example of using the build.php script to create an upgrade package between two specific CS-Cart versions.
```none
php build.php ~/arch/cscart_4.3.1.tgz ~/Download/cscart_4.3.2.tgz
```
--------------------------------
### Edited main.json for Single Installation
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/getting_started/server_ansible_playbooks.md
An example of an edited main.json file for a single CS-Cart or Multi-Vendor installation without additional storefronts. Remember to replace domain names and database credentials.
```json
{
"stores_dir": "/var/www/html",
"stores":
{
"doctorzoid.tk":
{
"cart":
{
"storefronts": []
},
"database":
{
"name": "doctorzoid_tk",
"user": "doctorzoid_tk",
"password": "0NkpV5t9VcUYpKtM"
}
}
}
}
```
--------------------------------
### Install Nano Text Editor on CentOS
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/getting_started/server_ansible_playbooks.md
Install the nano text editor on CentOS systems if it is not already present.
```bash
yum install nano
```
--------------------------------
### Get All Product Features
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/api/entities/product_features.md
Retrieves a list of all product features with their properties. Use this to get an overview of available features.
```bash
curl -X GET 'http://example.com/api/features'
```
--------------------------------
### Vendor Creation Example JSON
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/api/entities/vendors.md
An example JSON payload for creating a new vendor, including all possible fields and their typical values.
```JSON
{
"company": "New Vendor",
"company_description": "
This is the description of the new vendor.
",
"storefront": "example.com",
"status": "N",
"lang_code": "en",
"email": "test_vendor@example.com",
"phone": "555555555",
"url": "http://example.com",
"fax": "+555555555",
"address": "Boston street",
"city": "Boston",
"state": "MA",
"country": "US",
"zipcode": "02125",
"pre_moderation": "Y",
"pre_moderation_edit": "Y",
"pre_moderation_edit_vendors": "N",
"categories": "253,252",
"shippings": {
"1": "1",
"2": "3"
},
"commission": "10.55",
"commission_type": "A",
"terms": "These are the terms and conditions you must accept before you can buy products from New Vendor.
"
}
```
--------------------------------
### Example DIFF File Content
Source: https://github.com/cscart/docs/blob/4.11.x/en/upgrade/apply_diff_file.md
This is an example of a DIFF file showing changes to an addon's XML configuration. It illustrates additions and removals of lines.
```diff
diff --git a/app/addons/my_changes/addon.xml b/app/addons/my_changes/addon.xml
index efa480f..00981ea 100755
--- a/app/addons/my_changes/addon.xml
+++ b/app/addons/my_changes/addon.xml
@@ -1,9 +1,9 @@
my_changes
- 1.0
- 4294967294
+ 2.0
+ 100500
0
- MULTIVENDOR,ULTIMATE
en
+ active
```
--------------------------------
### Navigate to Site Directory
Source: https://github.com/cscart/docs/blob/4.11.x/en/install/nginx.md
Change the current directory to your website's document root. Replace 'example.com' with your actual directory name.
```bash
cd /var/www/html/example.com
```
--------------------------------
### Example API Request for Orders
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/api/entities/orders.md
A basic GET request to the orders API to retrieve a limited number of items per page. This is a common starting point for testing API connectivity.
```http
GET /api/orders/?items_per_page=2
```
--------------------------------
### Example: Querying an Additional Database
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/core/db/additional_dbs.md
This example demonstrates how to initiate a connection to an external backup database and query data from its products table using a custom table prefix.
```php
$params = array(
'dbc_name' => 'backup',
'table_prefix' => 'cscart'
);
db_initiate('localhost', 'db_user', 'db_password', 'cscart_backup', $params);
db_connect_to($params, 'cscart_backup');
$data = db_get_array("SELECT * FROM ?:products");
```
--------------------------------
### Initialize Product Tabs
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/addons/compatibility/adapting_463_to_471.md
Initializes the tabs for a product.
```php
fn_init_product_tabs($product)
```
--------------------------------
### Get Product by ID (cURL)
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/api/index.md
Example of retrieving data for a specific product using its ID via a GET request.
```bash
curl --user admin@example.com:APIkey -X GET 'http://example.com/api/products/1'
```
--------------------------------
### Example GET Request Mode Check
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/core/controllers/index.md
This snippet shows how to conditionally execute code for a GET request based on the 'mode' parameter, specifically when the mode is 'manage'.
```php
if ($mode == 'manage') {
// here comes the code which should be executed when running "http://cscart_dir/admin.php?dispatch=products.manage"
}
```
--------------------------------
### Get a Specific Language
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/api/entities/languages.md
Retrieves the details of a specific installed language by its ID.
```APIDOC
## GET /api/languages//
### Description
Retrieves the details of a specific installed language using its unique identifier.
### Method
GET
### Endpoint
/api/languages//
### Parameters
#### Path Parameters
- **lang_id** (integer) - Required - The unique identifier of the installed language.
### Response
#### Success Response (200)
- **lang_id** (string) - The unique identifier of the installed language.
- **lang_code** (string) - The two-letter language code (e.g., `en`).
- **name** (string) - The name of the language.
- **status** (string) - The status of the language (`A`—active, `H`—hidden, `D`—disabled).
- **country_code** (string) - The ISO code of the country to which the language belongs.
- **direction** (string) - The writing direction of the language (`ltr`—left-to-right, `rtl`—right-to-left).
### Response Example
```json
{
"lang_id": "1",
"lang_code": "en",
"name": "English",
"status": "A",
"country_code": "US",
"direction": "ltr"
}
```
#### Error Response (404)
- The language with the specified ID was not found.
```
--------------------------------
### Configuration Settings for Console Installation
Source: https://github.com/cscart/docs/blob/4.11.x/en/install/install_via_console.md
This PHP array in config.php contains settings for installation, including admin credentials, languages, database details, and server information. Replace placeholder values with your specific details.
```php
return array(
// Add-on names to be installed
// If empty will be installed only addons included by default
'addons' => array(),
'cart_settings' => array (
'email' => 'admin@example.com',
'password' => 'admin',
'secret_key' => 'YOURVERYSECRETCEY',
'languages' => array (
'en', 'da', 'de', 'es', 'fr', 'el', 'it', 'nl', 'ro', 'ru', 'bg', 'no', 'sl',
),
'main_language' => 'en',
'demo_catalog' => true,
'theme_name' => 'basic',
'license_number' => 'CART-1111-1111-1111-1111'
),
'database_settings' => array(
'host' => 'localhost',
'name' => '%DB_NAME%',
'user' => '%DB_USER%',
'password' => '%DB_PASS%',
'table_prefix' => 'cscart_',
'database_backend' => 'mysqli',
'notify' => false,
'allow_override' => 'Y',
),
'server_settings' => array (
'http_host' => '%HTTP_HOST%',
'http_path' => '',
'https_host' => '%HTTP_HOST%',
'https_path' => '',
'correct_permissions' => true,
),
);
```
--------------------------------
### Function Name Example
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/core/coding_standards/php.md
Function names must be lowercase and start with 'fn_' or 'db_'.
```php
fn_get_addon_option_variants
```
--------------------------------
### Get Console Upgrade Help
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/addons/compatibility/adapting_442_to_443.md
Display instructions on how to use the console upgrade command.
```bash
php admin.php --dispatch=upgrade_center.console help upgrade
```
--------------------------------
### Example POST Request Handling
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/core/controllers/index.md
This example demonstrates handling a POST request, specifically checking for the 'add' mode to execute code for a product addition form submission. It returns control after processing.
```php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($mode == 'add') {
// here comes the code which should be executed when submitting product addition form
}
return array(CONTROLLER_STATUS_OK, "$index_script?dispatch=products$suffix");
}
```
--------------------------------
### Copy Advanced Configuration to Main
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/getting_started/server_ansible_playbooks.md
Copy the advanced.json configuration file to main.json to start your server configuration.
```bash
cp ~/playbooks/config/advanced.json ~/playbooks/config/main.json
```
--------------------------------
### Property Naming Convention
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/core/coding_standards/php.md
Private and protected properties should not start with an underscore. The example demonstrates correct naming for properties like '$request' and '$sample_var'.
```php
class Api
{
/**
* Current request data
*
* @var Request $request
*/
private $request = null;
/**
* Sample var
*
* @var array $sample_var
*/
private $sample_var = array();
```
--------------------------------
### Configure Database and Path in config.local.php
Source: https://github.com/cscart/docs/blob/4.11.x/en/install/useful_info/copying_store_to_subdirectory.md
Edit these lines in config.local.php to specify the new database name, connection details, and the HTTP/HTTPS paths for the copied store.
```php
/*
* Database connection options
*/
$config['db_host'] = 'localhost';
$config['db_name'] = 'enter the name of the new copied database';
$config['db_user'] = 'your mysql username'; (username stays the same)
$config['db_password'] = 'your mysql password'; (password stays the same)
// Host and directory where software is installed on no-secure server
$config['http_host'] = 'your domain'; (stays the same)
$config['http_path'] = '/enter the directory of the copied store';
// Host and directory where software is installed on secure server
$config['https_host'] = 'your domain'; (stays the same)
$config['https_path'] = '/enter the directory of the copied store';
```
--------------------------------
### Get Store List with Pagination
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/api/entities/stores.md
This example demonstrates how to retrieve a specific page of stores using the 'items_per_page' parameter. The response includes store details and pagination parameters.
```php
GET /api/stores/?items_per_page=1
```
--------------------------------
### Valid Element ID Format
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/core/coding_standards/html_css.md
Provides an example of a valid HTML element ID. IDs must start with a letter and can only contain digits, letters, and the underscore symbol.
```html
```
--------------------------------
### Initialize Settings in fn_init_settings
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/addons/compatibility/adapting_4310_to_441.md
This code snippet shows how to initialize product, order, and page settings using a default value from the Appearance settings in `fn_init_settings`.
```php
$default_elements = Registry::get('settings.Appearance.admin_elements_per_page');
Registry::set('settings.Appearance.admin_products_per_page', $default_elements);
Registry::set('settings.Appearance.admin_orders_per_page', $default_elements);
Registry::set('settings.Appearance.admin_pages_per_page', $default_elements);
```
--------------------------------
### Post-Upgrade Notification Script Example
Source: https://github.com/cscart/docs/blob/4.11.x/en/upgrade/upgrade_addon.md
This PHP snippet shows how to add a post-upgrade notification to the `$upgrade_notes` array within a post-upgrade script. This notification will be displayed to the user after the add-on installation.
```php
'Sample Add-on v1.1 Changes',
'message' => 'Sample Add-on v1.1 Changes Description',
];
```
--------------------------------
### Extend Upgrade Package Schema Example
Source: https://github.com/cscart/docs/blob/4.11.x/en/upgrade/upgrade_addon.md
This PHP script returns an array that will be merged with the upgrade package's `package.json`. It's used to add custom data, such as making the backup process skippable during installation.
```php
[
'is_skippable' => true,
'skip_by_default' => true,
],
];
```
--------------------------------
### Run the Build Script
Source: https://github.com/cscart/docs/blob/4.11.x/en/upgrade/upgrade_package.md
Execute the build.php script to create an upgrade package. This command requires specifying the old and new version directories.
```none
php build.php old new
```
--------------------------------
### Display Upgrade Command Help
Source: https://github.com/cscart/docs/blob/4.11.x/en/upgrade/upgrade_via_console.md
Use the --help option to view instructions on how to use the upgrade command without initiating an actual upgrade.
```bash
php admin.php --dispatch=upgrade_center.console --help
```
--------------------------------
### Install EPEL Release on CentOS 6
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/getting_started/server_ansible_playbooks.md
Installs the Extra Packages for Enterprise Linux repository on CentOS 6, which is required for installing Ansible and its dependencies.
```bash
sudo yum -y install epel-release
```
--------------------------------
### Run LVEmp Stack Playbook (Varnish + PHP 7.1)
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/getting_started/server_ansible_playbooks.md
Execute the LVEmp playbook, which includes Varnish, nginx, mysql, and php7.1. Use the provided inventory for varnish.
```bash
cd ~/playbooks/ && ansible-playbook -e @config/main.json -c local -i inventory_varnish lvemp7.yml
```
--------------------------------
### Get Data (GET)
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/api/index.md
Retrieve object data by sending a GET HTTP request to the corresponding API URL. Supports filtering through URL parameters to refine search results.
```APIDOC
## Get Data (GET)
### Description
To get object data, send a `GET` HTTP request to the URL that refers to the according object.
### Method
GET
### Endpoint
`/api/:object/:id` or `/api/:object?param=value`
### Parameters
#### Query Parameters
- **free_shipping** (string) - Optional - Filter for products with specific shipping status (e.g., 'N' for non-free).
- **is_edp** (string) - Optional - Filter for downloadable products (e.g., 'Y').
- **company_id** (string) - Optional - Filter by company ID.
### Request Example
```bash
curl --user admin@example.com:APIkey -X GET 'http://example.com/api/products/1'
```
### Filtering Example
```bash
curl --user admin@example.com:APIkey -X GET 'http://example.com/api/products?free_shipping=N'
```
### Response
#### Success Response
JSON array containing matching objects (under the `products` key) and the search query details (under the `search` key). The objects are structured with IDs as keys and field arrays as values.
#### Response Example
```json
{
"products": {
"1": {
"product_id": "1",
"product": "Example Product"
}
},
"search": {
"free_shipping": "N"
}
}
```
```
--------------------------------
### Install wget on CentOS
Source: https://github.com/cscart/docs/blob/4.11.x/en/install/digitalocean.md
If wget is not found on CentOS, install it using yum.
```bash
yum install wget
```
--------------------------------
### List Installed Languages
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/api/entities/languages.md
Retrieves a list of installed languages with pagination support.
```APIDOC
## GET /api/languages/
### Description
Retrieves a list of installed languages with their details. Supports pagination to control the number of results returned.
### Method
GET
### Endpoint
/api/languages/
#### Query Parameters
- **page** (integer) - Optional - Determines the page number of the results to retrieve. Defaults to 1.
- **items_per_page** (integer) - Optional - Determines the number of languages to display per page. Defaults to 10.
### Response
#### Success Response (200)
- **languages** (object) - An object containing language details, keyed by language code.
- **lang_id** (string) - The unique identifier for the language.
- **lang_code** (string) - The ISO 639-1 code for the language.
- **name** (string) - The display name of the language.
- **status** (string) - The status of the language (e.g., 'A' for Active).
- **country_code** (string) - The ISO 3166-1 alpha-2 code for the country associated with the language.
- **direction** (string) - The text direction for the language (e.g., 'ltr' for left-to-right).
- **params** (object) - Pagination parameters.
- **items_per_page** (string) - The number of items returned per page.
- **page** (integer) - The current page number.
- **total_items** (integer) - The total number of items available.
#### Response Example
```json
{
"languages": {
"en": {
"lang_id": "1",
"lang_code": "en",
"name": "English",
"status": "A",
"country_code": "US",
"direction": "ltr"
},
"ru": {
"lang_id": "2",
"lang_code": "ru",
"name": "Русский",
"status": "A",
"country_code": "RU",
"direction": "ltr"
}
},
"params": {
"items_per_page": "10",
"page": 1,
"total_items": 2
}
}
```
```
--------------------------------
### Check if Theme is Installed
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/addons/compatibility/adapting_4104_to_4111.md
Checks if a theme is installed for the current storefront context.
```php
\Tygh\Themes\Themes::isInstalled($storefront_id)
```
--------------------------------
### Full Add-on Scheme 3.0 Example
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/addons/scheme/scheme3.0_structure.md
This XML snippet demonstrates the complete structure of an Addon.xml file for Scheme 3.0, including all essential elements and comments explaining their purpose and usage.
```xml
sample_addon_3_0
1.0
en
100
active
MULTIVENDOR,ULTIMATE
4.3.2
4.3.6
MULTIVENDOR
5.3.6
5.6.1
Y
N
1.0
2.0
discussion,form_builder
catalog_mode,reward_points
```
--------------------------------
### Install Ansible on Ubuntu 14.04
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/getting_started/server_ansible_playbooks.md
Installs the Ansible package from the PPA on Ubuntu 14.04.
```bash
sudo apt-get -y install ansible
```
--------------------------------
### Using Table Prefix Placeholder
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/core/db/structure_and_naming.md
Demonstrates how to use the `?:` placeholder for table prefixes in SQL queries. This ensures compatibility with custom prefixes set during installation.
```php
$products = db_get_array(
'SELECT * FROM ?:products LEFT JOIN ?:product_popularity USING(product_id)'
);
```
--------------------------------
### Example package.json Structure
Source: https://github.com/cscart/docs/blob/4.11.x/en/upgrade/upgrade.md
This JSON file defines the contents of an upgrade package, including files to be added or changed, migration scripts, language packs, validators, and pre/post scripts.
```json
{
"files": {
"app/addons/upgrade/addon.xml": {"status": "changed", "hash": "b0911a0d64453ab06b0872c9eb6fbc34"},
"app/addons/upgrade/func.php": {"status": "changed", "hash": "4fefb0fed1496f179a14b7e872eb16d9"},
"app/addons/upgrade/robots.txt": {"status": "deleted", "hash": "df32e836628b51af570dd2425cb3e97e"},
"js/addons/upgrade/up.js": {"status": "new"},
"var/themes_repository/responsive/templates/addons/upgrade/hooks/products/image_wrap.post.tpl": {"status": "new"}
},
"migrations": [
"20141022083711_addon_update_version.php"
],
"languages": [
"en"
],
"validators": [
"CheckFileValidator"
],
"scripts": {
"pre": "hello_world.php",
"post": "clear_cache.php"
}
}
```
--------------------------------
### Check if Theme is Installed for Storefront
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/addons/compatibility/adapting_4104_to_4111.md
Verifies if a specific theme is installed for a given storefront.
```php
\Tygh\Storefront\Repository::isThemeInstalled($storefront_id, $theme_name)
```
--------------------------------
### Example: Add Tooltip to Anti Fraud Setting
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/core/front-end/tooltips.md
This example shows how to integrate a tooltip for the 'Maxmind license key' setting within the Anti Fraud add-on's addon.xml. It includes the tooltip text and its Spanish translation.
```xml
...
General
-
Maxmind license key
input
- Clave de licencia de MaxMind
- Clé de licence Maxmind
- Maxmind licens nøglen
- Αριθμός-κλειδί Maxmind
- Liciență cheie Maxmind
- Лицензионный ключ Maxmind
- Maxmind licenčni ključ
- Maxmind 许可证钥匙
Hello
- Hola
...
```
--------------------------------
### File and Directory Permissions Example
Source: https://github.com/cscart/docs/blob/4.11.x/en/upgrade/upgrade_via_console.md
Illustrates the required ownership and permission settings for CS-Cart files and directories, including exceptions for 'design', 'images', and 'var' folders.
```text
app (755 dev:dev)
...
functions (755 dev:dev)
...
fn.common.php (644 dev:dev)
fn.control.php (644 dev:dev)
...
design (777 dev:dev)
.htaccess (644 dev:dev)
backend (777 dev:dev)
...
templates (777 dev:dev)
...
views (777 dev:dev)
index.tpl (666 dev:dev)
...
...
...
var (777 dev:dev)
.htaccess (644 dev:dev)
upgrade (777 dev:dev)
...
```
--------------------------------
### Get Theme Content Path
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/addons/compatibility/adapting_4310_to_441.md
Gets the path to content within a theme or its parent theme.
```php
\Tygh\Themes\Themes::getContentPath($path = '', $content_type = self::CONTENT_FILE, $dir_type = self::PATH_ABSOLUTE, $search_options = self::USE_DEFAULT)
```
--------------------------------
### Example Data Array Scheme
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/core/schemes.md
Illustrates the structure of a data array scheme, commonly used for defining configurations and data structures. This example shows how to define 'layouts' and 'settings' with their respective properties.
```php
array(
'checked_by_default' => true,
'function' => 'fn_clone_layouts'
),
'settings' => array(
'checked_by_default' => true,
'tables' => array(
array(
'name' => 'settings_vendor_values',
'key' => '', // Do not needed
),
),
),
// Some other code
);
?>
```
--------------------------------
### Example Product Import CSV Data
Source: https://github.com/cscart/docs/blob/4.11.x/en/user_guide/manage_products/import_export/import_example.md
This is an example CSV file content that can be used to import products into the store. It includes headers and sample product data with various attributes like product code, price, description, and images.
```none
Product code;Language;Category;List price;Price;Weight;Quantity;Min quantity;Shipping freight;Date added;Downloadable;Files;Ship downloadable;Inventory tracking;Free shipping;Feature comparison;Zero price action;Thumbnail;Detailed image;Product name;Description;Meta keywords;Meta description;Search words;Page title;Taxes;Features;Options;Secondary categories;Usergroup IDs;Pay by points;Override points;Override exchange rate;Store;Short description;Status;Product URL;Image URL
321294009;en;Books///Computers & Internet;45.00;45.0000;0.00;50;0;0.00;04 Feb 2006 10:50:02;N;;N;B;N;N;R;/var/www/html/stores/version210/images/backup/product/0321294009.01._SCMZZZZZZZ_.jpg#{[DA]:0321294009.01._SCMZZZZZZZ_.jpg,[DE]:0321294009.01._SCMZZZZZZZ_.jpg,[EL]:0321294009.01._SCMZZZZZZZ_.jpg,[EN]:0321294009.01._SCMZZZZZZZ_.jpg,[ES]:0321294009.01._SCMZZZZZZZ_.jpg,[FR]:0321294009.01._SCMZZZZZZZ_.jpg,[IT]:0321294009.01._SCMZZZZZZZ_.jpg,[NL]:0321294009.01._SCMZZZZZZZ_.jpg,[RO]:0321294009.01._SCMZZZZZZZ_.jpg,[RU]:0321294009.01._SCMZZZZZZZ_.jpg,[SI]:0321294009.01._SCMZZZZZZZ_.jpg,};/var/www/html/stores/version210/images/backup/detailed/0321294009.01._SCLZZZZZZZ_.jpg#{[DA]:0321294009.01._SCLZZZZZZZ_.jpg,[DE]:0321294009.01._SCLZZZZZZZ_.jpg,[EL]:0321294009.01._SCLZZZZZZZ_.jpg,[EN]:0321294009.01._SCLZZZZZZZ_.jpg,[ES]:0321294009.01._SCLZZZZZZZ_.jpg,[FR]:0321294009.01._SCLZZZZZZZ_.jpg,[IT]:0321294009.01._SCLZZZZZZZ_.jpg,[NL]:0321294009.01._SCLZZZZZZZ_.jpg,[RO]:0321294009.01._SCLZZZZZZZ_.jpg,[RU]:0321294009.01._SCLZZZZZZZ_.jpg,[SI]:0321294009.01._SCLZZZZZZZ_.jpg,};Adobe Acrobat 7.0 Classroom in a Book (Classroom in a Book);If you',re like most Acrobat users--creative, business, and engineering pros who work with complex electronic documents--you can ill afford to miss a beat in your production workflow. Then again, you can ill afford being left behind when it comes to mastering the newest version of the important tool on your desktop, Adobe Acrobat 7. Not to worry: Adobe has brought the classroom to you in this handy volume, completely revised to cover all that',s new and different in Acrobat 7. Through a series of self-paced lessons (each of which builds on the last and includes hands-on projects that the you can create using the files on the accompanying CD-ROM), this guide acquaints you with all of Acrobat 7',s features for creating, reviewing, editing, commenting on, restructuring, and preflighting PDF files, including the newest: a tool for creating 3D objects, improved security, new tools for repairing errors in print preflight, structured bookmarks, the ability to export comments to Word docs, and more. Professional tips and techniques are scattered throughout!
;;;;;VAT;{4}ISBN: T[34225634890];;;;Y;N;N;Simtech;;A;http://localhost/stores/version210/index.php?dispatch=products.view&product_id=1505;http://localhost/stores/version210/images/product/0/0321294009.01._SCMZZZZZZZ_.jpg
B0009IPN4Q;en;Apparel///Shoes;64.95;64.9500;0.00;50;0;0.00;04 Feb 2006 10:50:02;N;;N;B;N;N;R;/var/www/html/stores/version210/images/backup/product/B0009IPN4Q.01._SCMZZZZZZZ_.jpg#{[DA]:B0009IPN4Q.01._SCMZZZZZZZ_.jpg,[DE]:B0009IPN4Q.01._SCMZZZZZZZ_.jpg,[EL]:B0009IPN4Q.01._SCMZZZZZZZ_.jpg,[EN]:B0009IPN4Q.01._SCMZZZZZZZ_.jpg,[ES]:B0009IPN4Q.01._SCMZZZZZZZ_.jpg,[FR]:B0009IPN4Q.01._SCMZZZZZZZ_.jpg,[IT]:B0009IPN4Q.01._SCMZZZZZZZ_.jpg,[NL]:B0009IPN4Q.01._SCMZZZZZZZ_.jpg,[RO]:B0009IPN4Q.01._SCMZZZZZZZ_.jpg,[RU]:B0009IPN4Q.01._SCMZZZZZZZ_.jpg,[SI]:B0009IPN4Q.01._SCMZZZZZZZ_.jpg,};;Adidas Women's Daroga Mesh Casual Shoe;Features
·, ,Mesh nylon upper combines light weight and breathability
·, ,High-traction rubber outsole
·, ,Unroll this open, breathable, high-traction performer to wear as a comfortable shoe or step into it like a clog around camp -- the perfect shoe to pack when pack space is limited
·, ,Die-cut EVA midsole for lightweight comfort, airmesh lining for comfort and breathability, Ortholite antimicrobial moisture-wicking sock liner
;;;;;VAT;{5}(New features) Manufacturer: E[Adidas];{698}Clothing Size: SG[{2894}7.5 M,{2895}8 M,{2896}6.5 M,{2897}7 M,{2898}8.5 M];;1;Y;N;N;Simtech;;A;http://localhost/stores/version210/index.php?dispatch=products.view&product_id=1537;http://localhost/stores/version210/images/product/0/B0009IPN4Q.01._SCMZZZZZZZ_.jpg
```
--------------------------------
### Get All Product Features
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/api/entities/product_features.md
Retrieves a list of all product features. Supports GET and POST methods.
```APIDOC
## GET /features
### Description
Retrieves a list of all product features.
### Method
GET
### Endpoint
/features
## POST /features
### Description
Creates a new product feature.
### Method
POST
### Endpoint
/features
```
--------------------------------
### Download CS-Cart Installation Package
Source: https://github.com/cscart/docs/blob/4.11.x/en/install/digitalocean.md
Download the CS-Cart ultimate edition installation package using wget.
```bash
wget "https://www.cs-cart.com/index.php?dispatch=pages.get_trial&page_id=297&edition=ultimate" -O cscart.zip
```
--------------------------------
### Example: Retrieving Menu Scheme
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/core/schemes.md
This example demonstrates how to call fn_get_schema to retrieve the 'menu' scheme. The function searches for the scheme file in the main schemas directory or add-on directories.
```php
$menu = fn_get_schema('menu', 'menu', 'php');
```
--------------------------------
### Run Store Upgrade via Console
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/addons/compatibility/adapting_442_to_443.md
Use this command to initiate the store upgrade process through the console.
```bash
php admin.php --dispatch=upgrade_center.console upgrade
```
--------------------------------
### Hook: install_theme_pre
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/addons/compatibility/adapting_4104_to_4111.md
This hook executes before theme installation. It allows for modification of parameters passed to the installation function.
```php
fn_set_hook('install_theme_pre', $theme_name, $company_id, $install_layouts, $storefront_id);
```
--------------------------------
### Create Product with Feature
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/api/entities/product_features.md
Create a new product and set the value for a specific feature. The feature type is 'Other: Text' with feature_id=23.
```bash
curl --header 'Content-type: application/json' -X POST 'http://example.com/api/products' --data-binary '{"product": "New Product", "category_ids": "223", "main_category": "223", "price": "10", "status": "A", "product_features": {"23": {"feature_type": "T", "value": "Test"}}}'
```
--------------------------------
### Get All Product Variation Groups
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/api/entities/product_variation_groups.md
Retrieves a list of all product variation groups. Supports GET requests.
```APIDOC
## GET /product_variations_groups
### Description
Retrieves a list of all product variation groups.
### Method
GET
### Endpoint
/product_variations_groups
### Parameters
#### Query Parameters
- **limit** (integer) - Optional - Maximum number of variation groups to return.
- **offset** (integer) - Optional - Number of variation groups to skip.
### Response
#### Success Response (200)
- **product_variation_groups** (array) - A list of product variation group objects.
- **id** (integer) - The unique identifier of the variation group.
- **code** (string) - The symbol code of the variation group.
- **name** (string) - The name of the variation group.
- **status** (string) - The status of the variation group (e.g., 'active', 'disabled').
#### Response Example
{
"product_variation_groups": [
{
"id": 1,
"code": "TSHIRT_COLOR_SIZE",
"name": "T-Shirt Variations",
"status": "active"
}
]
}
```
--------------------------------
### Initialize External Database Connection
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/core/db/additional_dbs.md
Use `db_initiate` to establish a connection to an external database host. Specify connection details and optional parameters like a local alias (`dbc_name`) and table prefix.
```php
db_initiate($host, $user, $password, $name, $params = array());
```
--------------------------------
### Navigate to Upgrade Tools Directory
Source: https://github.com/cscart/docs/blob/4.11.x/en/upgrade/upgrade_package.md
Change the current directory to the _tools/upgrade folder to access the build script.
```none
cd _tools/upgrade
```
--------------------------------
### Install Ansible on CentOS 7
Source: https://github.com/cscart/docs/blob/4.11.x/en/developer_guide/getting_started/server_ansible_playbooks.md
Installs a specific version of Ansible from a release RPM package on CentOS 7.
```bash
sudo rpm -ihv https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.4.6.0-1.el7.ans.noarch.rpm
```