├── .nvmrc ├── .husky └── pre-commit ├── prestashop1.7 ├── upgrade │ ├── index.php │ ├── Upgrade-1.2.3.php │ ├── Upgrade-1.2.0.php │ └── Upgrade-1.3.0.php ├── views │ ├── index.php │ └── templates │ │ ├── index.php │ │ ├── admin │ │ ├── index.php │ │ └── tawkto │ │ │ ├── index.php │ │ │ └── helpers │ │ │ ├── index.php │ │ │ └── view │ │ │ ├── index.php │ │ │ └── view.tpl │ │ └── hook │ │ ├── index.php │ │ └── widget.tpl ├── controllers │ ├── index.php │ └── admin │ │ ├── index.php │ │ └── AdminTawktoController.php ├── config.xml ├── index.php ├── README.md ├── tawkto.php └── LICENSE.txt ├── prestashop8.x ├── upgrade │ ├── index.php │ ├── Upgrade-1.2.3.php │ ├── Upgrade-1.2.0.php │ └── Upgrade-1.3.0.php ├── views │ ├── index.php │ └── templates │ │ ├── index.php │ │ ├── admin │ │ ├── index.php │ │ └── tawkto │ │ │ ├── index.php │ │ │ └── helpers │ │ │ ├── index.php │ │ │ └── view │ │ │ ├── index.php │ │ │ └── view.tpl │ │ └── hook │ │ ├── index.php │ │ └── widget.tpl ├── controllers │ ├── index.php │ └── admin │ │ ├── index.php │ │ └── AdminTawktoController.php ├── config.xml ├── index.php ├── README.md ├── tawkto.php └── LICENSE.txt ├── docker ├── .env ├── envs │ ├── prestashop-8.env │ ├── prestashop-176.env │ └── prestashop-177.env ├── docker-compose.yml └── README.md ├── .gitignore ├── .lintstagedrc.js ├── .phpcs-short-types.php ├── package.json ├── .phpcs.xml ├── .php-cs-fixer.dist.php ├── composer.json ├── .github └── workflows │ └── release.yml └── README.md /.nvmrc: -------------------------------------------------------------------------------- 1 | v20.14.0 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | lint-staged 2 | -------------------------------------------------------------------------------- /prestashop1.7/upgrade/index.php: -------------------------------------------------------------------------------- 1 | ../index.php -------------------------------------------------------------------------------- /prestashop1.7/views/index.php: -------------------------------------------------------------------------------- 1 | ../index.php -------------------------------------------------------------------------------- /prestashop8.x/upgrade/index.php: -------------------------------------------------------------------------------- 1 | ../index.php -------------------------------------------------------------------------------- /prestashop8.x/views/index.php: -------------------------------------------------------------------------------- 1 | ../index.php -------------------------------------------------------------------------------- /prestashop1.7/controllers/index.php: -------------------------------------------------------------------------------- 1 | ../index.php -------------------------------------------------------------------------------- /prestashop8.x/controllers/index.php: -------------------------------------------------------------------------------- 1 | ../index.php -------------------------------------------------------------------------------- /prestashop1.7/controllers/admin/index.php: -------------------------------------------------------------------------------- 1 | ../../index.php -------------------------------------------------------------------------------- /prestashop1.7/views/templates/index.php: -------------------------------------------------------------------------------- 1 | ../../index.php -------------------------------------------------------------------------------- /prestashop8.x/controllers/admin/index.php: -------------------------------------------------------------------------------- 1 | ../../index.php -------------------------------------------------------------------------------- /prestashop8.x/views/templates/index.php: -------------------------------------------------------------------------------- 1 | ../../index.php -------------------------------------------------------------------------------- /prestashop1.7/views/templates/admin/index.php: -------------------------------------------------------------------------------- 1 | ../../../index.php -------------------------------------------------------------------------------- /prestashop1.7/views/templates/hook/index.php: -------------------------------------------------------------------------------- 1 | ../../../index.php -------------------------------------------------------------------------------- /prestashop8.x/views/templates/admin/index.php: -------------------------------------------------------------------------------- 1 | ../../../index.php -------------------------------------------------------------------------------- /prestashop8.x/views/templates/hook/index.php: -------------------------------------------------------------------------------- 1 | ../../../index.php -------------------------------------------------------------------------------- /prestashop1.7/views/templates/admin/tawkto/index.php: -------------------------------------------------------------------------------- 1 | ../../../../index.php -------------------------------------------------------------------------------- /prestashop8.x/views/templates/admin/tawkto/index.php: -------------------------------------------------------------------------------- 1 | ../../../../index.php -------------------------------------------------------------------------------- /prestashop1.7/views/templates/admin/tawkto/helpers/index.php: -------------------------------------------------------------------------------- 1 | ../../../../../index.php -------------------------------------------------------------------------------- /prestashop8.x/views/templates/admin/tawkto/helpers/index.php: -------------------------------------------------------------------------------- 1 | ../../../../../index.php -------------------------------------------------------------------------------- /prestashop1.7/views/templates/admin/tawkto/helpers/view/index.php: -------------------------------------------------------------------------------- 1 | ../../../../../../index.php -------------------------------------------------------------------------------- /prestashop8.x/views/templates/admin/tawkto/helpers/view/index.php: -------------------------------------------------------------------------------- 1 | ../../../../../../index.php -------------------------------------------------------------------------------- /docker/.env: -------------------------------------------------------------------------------- 1 | PRESTASHOP_IMAGE_VERSION=latest 2 | 3 | COMPOSE_PROJECT_NAME=prestashop-${PRESTASHOP_IMAGE_VERSION} 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.zip 2 | ./build/tawkto 3 | docker/bin 4 | **/vendor 5 | .phpcs.cache 6 | node_modules/ 7 | .php_cs_fixer.cache 8 | -------------------------------------------------------------------------------- /.lintstagedrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | '*.php': [ 3 | 'composer run lint:fix', 4 | 'composer run lint' 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /docker/envs/prestashop-8.env: -------------------------------------------------------------------------------- 1 | PRESTASHOP_IMAGE_VERSION=8-apache 2 | PRESTASHOP_DIR=../prestashop8.x 3 | 4 | COMPOSE_PROJECT_NAME=prestashop-8-apache 5 | -------------------------------------------------------------------------------- /docker/envs/prestashop-176.env: -------------------------------------------------------------------------------- 1 | PRESTASHOP_IMAGE_VERSION=1.7.6-apache 2 | PRESTASHOP_DIR=../prestashop1.7 3 | 4 | COMPOSE_PROJECT_NAME=prestashop-176-apache 5 | -------------------------------------------------------------------------------- /docker/envs/prestashop-177.env: -------------------------------------------------------------------------------- 1 | PRESTASHOP_IMAGE_VERSION=1.7.7-apache 2 | PRESTASHOP_DIR=../prestashop1.7 3 | 4 | COMPOSE_PROJECT_NAME=prestashop-177-apache 5 | -------------------------------------------------------------------------------- /.phpcs-short-types.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | tawkto 4 | 5 | 6 | 7 | 8 | 9 | 10 | 1 11 | 0 12 | 13 | 14 | -------------------------------------------------------------------------------- /prestashop8.x/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | tawkto 4 | 5 | 6 | 7 | 8 | 9 | 10 | 1 11 | 0 12 | 13 | 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tawk-prestashop", 3 | "version": "1.0.0", 4 | "description": "Free live chat widget for your site", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "prepare": "husky" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/tawk/tawk-prestashop.git" 13 | }, 14 | "author": "", 15 | "license": "ISC", 16 | "bugs": { 17 | "url": "https://github.com/tawk/tawk-prestashop/issues" 18 | }, 19 | "homepage": "https://github.com/tawk/tawk-prestashop#readme", 20 | "devDependencies": { 21 | "husky": "^9.1.5", 22 | "lint-staged": "^15.2.9" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | db: 5 | image: mysql:5.7 6 | volumes: 7 | - db_data:/var/lib/mysql 8 | environment: 9 | MYSQL_ROOT_PASSWORD: prestashop 10 | MYSQL_DATABASE: prestashop 11 | MYSQL_USER: prestashop 12 | MYSQL_PASSWORD: prestashop 13 | 14 | web: 15 | depends_on: 16 | - db 17 | image: prestashop/prestashop:${PRESTASHOP_IMAGE_VERSION} 18 | ports: 19 | - 8000:80 20 | volumes: 21 | - web_data:/var/www/html 22 | - type: bind 23 | source: ${PRESTASHOP_DIR} 24 | target: /var/www/html/modules/tawkto 25 | links: 26 | - db 27 | environment: 28 | DB_SERVER: db 29 | DB_USER: prestashop 30 | DB_PASSWD: prestashop 31 | DB_NAME: prestashop 32 | PS_INSTALL_AUTO: 1 33 | PS_FOLDER_ADMIN: admin_ps 34 | PS_FOLDER_INSTALL: install_ps 35 | PS_DOMAIN: localhost:8000 36 | ADMIN_MAIL: admin@example.com 37 | ADMIN_PASSWD: adminps123 38 | 39 | volumes: 40 | db_data: 41 | web_data: 42 | -------------------------------------------------------------------------------- /prestashop8.x/index.php: -------------------------------------------------------------------------------- 1 | up``` 31 | 32 | Stop the container of a specific version: 33 | 34 | - ```docker-compose --env-file envs/ stop``` 35 | 36 | Destroy the container of a specific version: 37 | 38 | - ```docker-compose --env-file envs/ down``` 39 | 40 | ## Plugin setup 41 | You can follow the instruction in [Prestashop Github Repo](https://github.com/tawk/tawk-prestashop). 42 | 43 | ## Accessing Admin Page 44 | To access the admin page, go to `localhost:/admin_ps`. Here's the login credentials: 45 | - username: admin@example.com 46 | - password: adminps 47 | -------------------------------------------------------------------------------- /.phpcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Custom coding standards. 4 | 5 | \.github/* 6 | */docker/* 7 | */vendor/* 8 | */node_modules/* 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /prestashop1.7/views/templates/hook/widget.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * tawk.to 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * If you did not receive a copy of the license and are unable to 11 | * obtain it through the world-wide-web, please send an email 12 | * to support@tawk.to so we can send you a copy immediately. 13 | * 14 | * @author tawkto support@tawk.to 15 | * @copyright Copyright (c) 2014-2024 tawk.to 16 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 17 | *} 18 | 19 | 38 | 39 | -------------------------------------------------------------------------------- /prestashop8.x/views/templates/hook/widget.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * tawk.to 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * If you did not receive a copy of the license and are unable to 11 | * obtain it through the world-wide-web, please send an email 12 | * to support@tawk.to so we can send you a copy immediately. 13 | * 14 | * @author tawkto support@tawk.to 15 | * @copyright Copyright (c) 2014-2024 tawk.to 16 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 17 | *} 18 | 19 | 38 | 39 | -------------------------------------------------------------------------------- /.php-cs-fixer.dist.php: -------------------------------------------------------------------------------- 1 | in([ 6 | __DIR__ . '/prestashop1.7', 7 | __DIR__ . '/prestashop8.x', 8 | ]); 9 | 10 | return (new PhpCsFixer\Config()) 11 | ->setRiskyAllowed(true) 12 | ->setRules([ 13 | '@Symfony' => true, 14 | 'array_indentation' => true, 15 | 'cast_spaces' => [ 16 | 'space' => 'single', 17 | ], 18 | 'combine_consecutive_issets' => true, 19 | 'concat_space' => [ 20 | 'spacing' => 'one', 21 | ], 22 | 'error_suppression' => [ 23 | 'mute_deprecation_error' => false, 24 | 'noise_remaining_usages' => false, 25 | 'noise_remaining_usages_exclude' => [], 26 | ], 27 | 'function_to_constant' => false, 28 | 'method_chaining_indentation' => true, 29 | 'no_alias_functions' => false, 30 | 'no_superfluous_phpdoc_tags' => false, 31 | 'non_printable_character' => [ 32 | 'use_escape_sequences_in_strings' => true, 33 | ], 34 | 'phpdoc_align' => [ 35 | 'align' => 'left', 36 | ], 37 | 'phpdoc_summary' => false, 38 | 'protected_to_private' => false, 39 | 'psr_autoloading' => false, 40 | 'self_accessor' => false, 41 | 'yoda_style' => false, 42 | 'single_line_throw' => false, 43 | 'no_alias_language_construct_call' => false, 44 | ]) 45 | ->setFinder($finder) 46 | ->setCacheFile(__DIR__ . '/.php_cs_fixer.cache'); 47 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tawk/tawk-prestashop", 3 | "description": "Prestashop plugin for tawk.to", 4 | "type": "project", 5 | "repositories": { 6 | "tawk-url-utils": { 7 | "type": "vcs", 8 | "url": "https://github.com/tawk/tawk-url-utils.git" 9 | } 10 | }, 11 | "require": { 12 | "tawk/url-utils": "2.0.1" 13 | }, 14 | "license": "AFL-3.0", 15 | "scripts": { 16 | "post-install-cmd": "if [ -z \"$GITHUB_ACTIONS\" ]; then npm install; fi", 17 | "lint": "phpcs -p -s -v --runtime-set ignore_warnings_on_exit true .", 18 | "lint:fix": "php-cs-fixer fix --config='.php-cs-fixer.dist.php'", 19 | "auto-index": "composer run auto-index:1.7 && composer run auto-index:8", 20 | "auto-index:1.7": "autoindex prestashop:add:index ./prestashop1.7", 21 | "auto-index:8": "autoindex prestashop:add:index ./prestashop8.x", 22 | "build": "composer run build:dev && composer run build:prod", 23 | "build:dev": "composer install", 24 | "build:prod": "composer run build:1.7 && composer run build:8", 25 | "build:1.7": "COMPOSER_VENDOR_DIR=./prestashop1.7/vendor composer install --no-dev", 26 | "build:8": "COMPOSER_VENDOR_DIR=./prestashop8.x/vendor composer install --no-dev" 27 | }, 28 | "require-dev": { 29 | "prestashop/autoindex": "^2.0", 30 | "squizlabs/php_codesniffer": "^3.10", 31 | "friendsofphp/php-cs-fixer": "^3.62" 32 | }, 33 | "config": { 34 | "allow-plugins": { 35 | "dealerdirect/phpcodesniffer-composer-installer": true 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /prestashop8.x/README.md: -------------------------------------------------------------------------------- 1 | # tawk.to Live Chat 2 | 3 | Free live chat widget for your site 4 | 5 | ## Description 6 | 7 | The tawk.to Live Chat app makes it easy to monitor and chat with visitors on your website. Be there when they need you with unlimited messaging, ticketing and your own Knowledge Base — all 100% FREE. 8 | 9 | Compatible with all modern browsers, tawk.to was created in response to the growing need for businesses to respond in real time, with real people. 10 | 11 | Never lose another lead or sale again — tawk.to offers iOS, Android, Windows and Mac OSX apps to keep you connected wherever you go. 12 | 13 | Don’t have a tawk.to account yet? [Create one here.](https://www.tawk.to/?utm_source=prestashop&utm_medium=link&utm_campaign=signup) 14 | 15 | ## Installation 16 | This section describes how to install the plugin and get it working. 17 | 18 | ### Module Installer 19 | 1. Download the `tawk-prestashop-8.x-.zip` from [latest release.](https://github.com/tawk/tawk-prestashop/releases) 20 | 2. Go to `Dashboard` -> `Modules` -> `Module Manager`. 21 | 3. Click `Upload a module`, upload the zip file, and the module will install automatically. 22 | 23 | ### Manual Installation 24 | 1. Download and extract the `tawk-prestashop-8.x-.zip` from [latest release.](https://github.com/tawk/tawk-prestashop/releases) 25 | 2. Upload `tawkto` directory to the `/modules/` directory. 26 | 3. Go to `Dashboard` -> `Modules` -> `Module Manager`. 27 | 4. Search for the `tawk.to` plugin and `install`. 28 | 29 | ### Where is the configuration page located? 30 | It is under `Dashboard` -> `More` -> `tawk.to`. 31 | 32 | ### Widget Configuration 33 | 1. Go to the configuration page. 34 | 2. Log in to your tawk.to account. 35 | 3. Select the property and the widget you want to place on your store and click `Use selected widget`. 36 | 4. The widget will now appear on your store. 37 | 38 | ## Frequently Asked Questions 39 | Visit our [Help Center](https://help.tawk.to/) for answers to FAQs 40 | -------------------------------------------------------------------------------- /prestashop1.7/README.md: -------------------------------------------------------------------------------- 1 | # tawk.to Live Chat 2 | 3 | Free live chat widget for your site 4 | 5 | ## Description 6 | 7 | The tawk.to Live Chat app makes it easy to monitor and chat with visitors on 8 | your website. Be there when they need you with unlimited messaging, ticketing 9 | and your own Knowledge Base — all 100% FREE. 10 | 11 | Compatible with all modern browsers, tawk.to was created in response to the 12 | growing need for businesses to respond in real time, with real people. 13 | 14 | Never lose another lead or sale again — tawk.to offers iOS, Android, Windows and 15 | Mac OSX apps to keep you connected wherever you go. 16 | 17 | Don’t have a tawk.to account yet? 18 | [Create one here.](https://www.tawk.to/?utm_source=prestashop&utm_medium=link&utm_campaign=signup) 19 | 20 | ## Installation 21 | This section describes how to install the plugin and get it working. 22 | 23 | ### Module Installer 24 | 1. Download the `tawk-prestashop-1.7-.zip` from 25 | [latest release.](https://github.com/tawk/tawk-prestashop/releases) 26 | 2. Go to `Dashboard` -> `Modules` -> `Module Manager`. 27 | 3. Click `Upload a module`, upload the zip file, and the module will install 28 | automatically. 29 | 30 | ### Manual Installation 31 | 1. Download and extract the `tawk-prestashop-1.7-.zip` from 32 | [latest release.](https://github.com/tawk/tawk-prestashop/releases) 33 | 2. Upload `tawkto` directory to the `/modules/` directory. 34 | 3. Go to `Dashboard` -> `Modules` -> `Module Catalog`. 35 | 4. Search for the `tawk.to` plugin and `install`. 36 | 37 | ### Where is the configuration page located? 38 | It is under `Dashboard` -> `More` -> `tawk.to`. 39 | 40 | ### Widget Configuration 41 | 1. Go to the configuration page. 42 | 2. Log in to your tawk.to account. 43 | 3. Select the property and the widget you want to place on your store and click 44 | `Use selected widget`. 45 | 4. The widget will now appear on your store. 46 | 47 | ## Frequently Asked Questions 48 | Visit our [Help Center](https://help.tawk.to/) for answers to FAQs 49 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: create-release-artifact 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: checkout 12 | uses: actions/checkout@v2 13 | 14 | - name: cached dependencies 15 | uses: actions/cache@v2 16 | id: cached-dependencies 17 | with: 18 | path: | 19 | ./vendor 20 | ./prestashop1.7/vendor 21 | ./prestashop8.x/vendor 22 | # the key will change if composer.lock changes 23 | key: ${{ runner.os }}-dependencies-${{ hashFiles('**/composer.lock') }} 24 | 25 | - name: install dependencies 26 | uses: php-actions/composer@v6 27 | with: 28 | command: run build 29 | 30 | create-release-artifact: 31 | needs: [build] 32 | name: Creating release artifact 33 | runs-on: ubuntu-latest 34 | strategy: 35 | matrix: 36 | ps_version: ['1.7', '8.x'] 37 | steps: 38 | - name: checkout 39 | uses: actions/checkout@v2 40 | 41 | - name: cached dependencies 42 | uses: actions/cache@v2 43 | id: cached-dependencies 44 | with: 45 | path: | 46 | ./vendor 47 | ./prestashop1.7/vendor 48 | ./prestashop8.x/vendor 49 | # the key will change if composer.lock changes 50 | key: ${{ runner.os }}-dependencies-${{ hashFiles('**/composer.lock') }} 51 | 52 | - name: build artifact 53 | run: composer run auto-index && ./build/build-package.sh 54 | 55 | - name: set version for prestashop ${{ matrix.ps_version }} 56 | id: version 57 | run: echo "::set-output name=version::$(awk 'gsub(/<\/version>/,"")' ./prestashop${{ matrix.ps_version }}/config.xml | xargs)" 58 | 59 | - name: upload prestashop ${{ matrix.ps_version }} artifact 60 | uses: actions/upload-release-asset@v1 61 | env: 62 | GITHUB_TOKEN: ${{ github.token }} 63 | with: 64 | upload_url: ${{ github.event.release.upload_url }} 65 | asset_path: ./build/tawk-prestashop-${{ matrix.ps_version }}-${{ steps.version.outputs.version }}.zip 66 | asset_name: tawk-prestashop-${{ matrix.ps_version }}-${{ steps.version.outputs.version }}.zip 67 | asset_content_type: application/zip 68 | -------------------------------------------------------------------------------- /prestashop8.x/upgrade/Upgrade-1.2.3.php: -------------------------------------------------------------------------------- 1 | show_oncustom) && is_array($opts->show_oncustom) && $opts->show_oncustom === []) { 97 | $opts->show_oncustom = json_encode([]); 98 | } 99 | 100 | if (isset($opts->hide_oncustom) && is_array($opts->hide_oncustom) && $opts->hide_oncustom === []) { 101 | $opts->hide_oncustom = json_encode([]); 102 | } 103 | 104 | return Configuration::updateValue( 105 | TawkTo::TAWKTO_WIDGET_OPTS, 106 | json_encode($opts), 107 | false, 108 | $shop_group_id, 109 | $shop_id 110 | ); 111 | } 112 | -------------------------------------------------------------------------------- /prestashop1.7/upgrade/Upgrade-1.2.3.php: -------------------------------------------------------------------------------- 1 | show_oncustom) && is_array($opts->show_oncustom) && $opts->show_oncustom === []) { 98 | $opts->show_oncustom = json_encode([]); 99 | } 100 | 101 | if (isset($opts->hide_oncustom) && is_array($opts->hide_oncustom) && $opts->hide_oncustom === []) { 102 | $opts->hide_oncustom = json_encode([]); 103 | } 104 | 105 | return Configuration::updateValue( 106 | TawkTo::TAWKTO_WIDGET_OPTS, 107 | json_encode($opts), 108 | false, 109 | $shop_group_id, 110 | $shop_id 111 | ); 112 | } 113 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tawk.to Live Chat 2 | 3 | Free live chat widget for your site 4 | 5 | ## Description 6 | 7 | The tawk.to Live Chat app makes it easy to monitor and chat with visitors on 8 | your website. Be there when they need you with unlimited messaging, ticketing 9 | and your own Knowledge Base — all 100% FREE. 10 | 11 | Compatible with all modern browsers, tawk.to was created in response to the 12 | growing need for businesses to respond in real time, with real people. 13 | 14 | Never lose another lead or sale again — tawk.to offers iOS, Android, Windows and 15 | Mac OSX apps to keep you connected wherever you go. 16 | 17 | Don’t have a tawk.to account yet? 18 | [Create one here.](https://www.tawk.to/?utm_source=prestashop&utm_medium=link&utm_campaign=signup) 19 | 20 | ## Installation 21 | 22 | ### Prestashop 8 23 | This section describes how to install the plugin and get it working on 24 | Prestashop 8 25 | 26 | #### Module Installer 27 | 1. Download the `tawk-prestashop-8.x-.zip` from 28 | [latest release.](https://github.com/tawk/tawk-prestashop/releases) 29 | 2. Go to `Dashboard` -> `Modules` -> `Module Manager`. 30 | 3. Click `Upload a module`, upload the zip file, and the module will install 31 | automatically. 32 | 33 | #### Manual Installation 34 | 1. Download and extract the `tawk-prestashop-8.x-.zip` from 35 | [latest release.](https://github.com/tawk/tawk-prestashop/releases) 36 | 2. Upload `tawkto` directory to the `/modules/` directory. 37 | 3. Go to `Dashboard` -> `Modules` -> `Module Manager`. 38 | 4. Search for the `tawk.to` plugin and `install`. 39 | 40 | #### Where is the configuration page located? 41 | It is under `Dashboard` -> `More` -> `tawk.to`. 42 | 43 | ### Prestashop 1.7 44 | This section describes how to install the plugin and get it working on 45 | Prestashop 1.7 46 | 47 | #### Module Installer 48 | 1. Download the `tawk-prestashop-1.7-.zip` from 49 | [latest release.](https://github.com/tawk/tawk-prestashop/releases) 50 | 2. Go to `Dashboard` -> `Modules` -> `Module Manager`. 51 | 3. Click `Upload a module`, upload the zip file, and the module will install 52 | automatically. 53 | 54 | #### Manual Installation 55 | 1. Download and extract the `tawk-prestashop-1.7-.zip` from 56 | [latest release.](https://github.com/tawk/tawk-prestashop/releases) 57 | 2. Upload `tawkto` directory to the `/modules/` directory. 58 | 3. Go to `Dashboard` -> `Modules` -> `Module Catalog`. 59 | 4. Search for the `tawk.to` plugin and `install`. 60 | 61 | #### Where is the configuration page located? 62 | It is under `Dashboard` -> `More` -> `tawk.to`. 63 | 64 | ### Prestashop 1.6 65 | We will no longer support Prestashop 1.6. However, you can still use the older 66 | version of the plugin by following the instructions below. Please note that the 67 | older version will not include the latest features, bug fixes, or security 68 | updates. 69 | 70 | #### Module Installer 71 | 1. Download the `tawk-prestashop-1.6-1.5.0.zip` from 72 | [here.](https://github.com/tawk/tawk-prestashop/releases/tag/1.5.0) 73 | 2. Go to `Dashboard` -> `Modules and Services`. 74 | 3. Click `Add a new module`, upload the zip file, and click 75 | `Upload this module`. 76 | 4. Search for the `tawk.to` plugin and `install`. 77 | 78 | #### Manual Installation 79 | 1. Download and extract the `tawk-prestashop-1.6-1.5.0.zip` from 80 | [here.](https://github.com/tawk/tawk-prestashop/releases/tag/1.5.0) 81 | 2. Upload `tawkto` directory to the `/modules/` directory. 82 | 3. Go to `Dashboard` -> `Modules and Services`. 83 | 4. Search for the `tawk.to` plugin and `install`. 84 | 85 | #### Where is the configuration page located? 86 | It is under `Dashboard` -> `Administration` -> `tawk.to`. 87 | 88 | ### Widget Configuration 89 | 1. Go to the configuration page. 90 | 2. Log in to your tawk.to account. 91 | 3. Select the property and the widget you want to place on your store and click 92 | `Use selected widget`. 93 | 4. The widget will now appear on your store. 94 | 95 | ## Frequently Asked Questions 96 | Visit our [Help Center](https://help.tawk.to/) for answers to FAQs 97 | -------------------------------------------------------------------------------- /prestashop1.7/upgrade/Upgrade-1.2.0.php: -------------------------------------------------------------------------------- 1 | execute(implode(' ', $sql)); // returns boolean value 93 | 94 | return $result; 95 | } 96 | 97 | /** 98 | * Insert records 99 | * 100 | * @return bool 101 | */ 102 | function insert_records() 103 | { 104 | $res = true; 105 | 106 | // modify global first 107 | $res &= modify_widget(); 108 | 109 | $shop_ids = Shop::getCompleteListOfShopsID(); 110 | 111 | $updated_groups = []; 112 | foreach ($shop_ids as $shop_id) { 113 | $shop_group_id = (int) Shop::getGroupFromShop($shop_id); 114 | 115 | if (!in_array($shop_group_id, $updated_groups)) { 116 | // update the group config 117 | $res &= modify_widget($shop_group_id); 118 | $updated_groups[] = $shop_group_id; 119 | } 120 | 121 | // update the shop config 122 | $res &= modify_widget($shop_group_id, $shop_id); 123 | } 124 | 125 | return $res; 126 | } 127 | 128 | /** 129 | * Update widget settings 130 | * 131 | * @param int|null $shop_group_id shop group ID 132 | * @param int|null $shop_id shop ID 133 | * 134 | * @return bool 135 | */ 136 | function modify_widget($shop_group_id = null, $shop_id = null) 137 | { 138 | if (isset($shop_id)) { 139 | Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); 140 | } elseif (isset($shop_group_id)) { 141 | Shop::setContext(Shop::CONTEXT_GROUP, $shop_group_id); 142 | } else { 143 | Shop::setContext(Shop::CONTEXT_ALL); 144 | } 145 | 146 | $page_id = Configuration::get(TawkTo::TAWKTO_WIDGET_PAGE_ID, null, $shop_group_id, $shop_id); 147 | $widget_id = Configuration::get(TawkTo::TAWKTO_WIDGET_WIDGET_ID, null, $shop_group_id, $shop_id); 148 | 149 | return Configuration::updateValue( 150 | TawkTo::TAWKTO_SELECTED_WIDGET, 151 | $page_id . ':' . $widget_id, 152 | false, 153 | $shop_group_id, 154 | $shop_id 155 | ); 156 | } 157 | 158 | /** 159 | * Remove TAWKTO_WIDGET_PAGE_ID and TAWKTO_WIDGET_WIDGET_ID records 160 | * 161 | * @return bool 162 | */ 163 | function remove_extras() 164 | { 165 | $res = Configuration::deleteByName(TawkTo::TAWKTO_WIDGET_PAGE_ID); 166 | $res &= Configuration::deleteByName(TawkTo::TAWKTO_WIDGET_WIDGET_ID); 167 | 168 | return $res; 169 | } 170 | -------------------------------------------------------------------------------- /prestashop8.x/upgrade/Upgrade-1.2.0.php: -------------------------------------------------------------------------------- 1 | execute(join(' ', $sql)); // returns boolean value 93 | 94 | return $result; 95 | } 96 | 97 | /** 98 | * Insert records 99 | * 100 | * @return bool 101 | */ 102 | function insert_records() 103 | { 104 | $res = true; 105 | 106 | // modify global first 107 | $res &= modify_widget(); 108 | 109 | $shop_ids = Shop::getCompleteListOfShopsID(); 110 | 111 | $updated_groups = []; 112 | foreach ($shop_ids as $shop_id) { 113 | $shop_group_id = (int) Shop::getGroupFromShop($shop_id); 114 | 115 | if (!in_array($shop_group_id, $updated_groups)) { 116 | // update the group config 117 | $res &= modify_widget($shop_group_id); 118 | $updated_groups[] = $shop_group_id; 119 | } 120 | 121 | // update the shop config 122 | $res &= modify_widget($shop_group_id, $shop_id); 123 | } 124 | 125 | return $res; 126 | } 127 | 128 | /** 129 | * Update widget settings 130 | * 131 | * @param int|null $shop_group_id shop group ID 132 | * @param int|null $shop_id shop ID 133 | * 134 | * @return bool 135 | */ 136 | function modify_widget($shop_group_id = null, $shop_id = null) 137 | { 138 | if (isset($shop_id)) { 139 | Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); 140 | } elseif (isset($shop_group_id)) { 141 | Shop::setContext(Shop::CONTEXT_GROUP, $shop_group_id); 142 | } else { 143 | Shop::setContext(Shop::CONTEXT_ALL); 144 | } 145 | 146 | $page_id = Configuration::get(TawkTo::TAWKTO_WIDGET_PAGE_ID, null, $shop_group_id, $shop_id); 147 | $widget_id = Configuration::get(TawkTo::TAWKTO_WIDGET_WIDGET_ID, null, $shop_group_id, $shop_id); 148 | 149 | return Configuration::updateValue( 150 | TawkTo::TAWKTO_SELECTED_WIDGET, 151 | $page_id . ':' . $widget_id, 152 | false, 153 | $shop_group_id, 154 | $shop_id 155 | ); 156 | } 157 | 158 | /** 159 | * Remove TAWKTO_WIDGET_PAGE_ID and TAWKTO_WIDGET_WIDGET_ID records 160 | * 161 | * @return bool 162 | */ 163 | function remove_extras() 164 | { 165 | // remove TAWKTO_WIDGET_PAGE_ID and TAWKTO_WIDGET_WIDGET_ID records 166 | $res = Configuration::deleteByName(TawkTo::TAWKTO_WIDGET_PAGE_ID); 167 | $res &= Configuration::deleteByName(TawkTo::TAWKTO_WIDGET_WIDGET_ID); 168 | 169 | return $res; 170 | } 171 | -------------------------------------------------------------------------------- /prestashop1.7/upgrade/Upgrade-1.3.0.php: -------------------------------------------------------------------------------- 1 | show_oncustom)) { 102 | $show_oncustom = json_decode($opts->show_oncustom); 103 | if (is_array($show_oncustom)) { 104 | $opts->show_oncustom = add_wildcard_to_pattern_list($show_oncustom); 105 | } 106 | } 107 | 108 | if (isset($opts->hide_oncustom)) { 109 | $hide_oncustom = json_decode($opts->hide_oncustom); 110 | if (is_array($hide_oncustom)) { 111 | $opts->hide_oncustom = add_wildcard_to_pattern_list($hide_oncustom); 112 | } 113 | } 114 | 115 | return Configuration::updateValue( 116 | TawkTo::TAWKTO_WIDGET_OPTS, 117 | json_encode($opts), 118 | false, 119 | $shop_group_id, 120 | $shop_id 121 | ); 122 | } 123 | 124 | /** 125 | * Check pattern list for wildcard 126 | * 127 | * @param string[] $patternList list of patterns 128 | * @param string $wildcard wildcard 129 | * 130 | * @return bool 131 | */ 132 | function check_pattern_list_has_wildcard(array $patternList, string $wildcard) 133 | { 134 | foreach ($patternList as $pattern) { 135 | if (strpos($pattern, $wildcard) > -1) { 136 | return true; 137 | } 138 | } 139 | 140 | return false; 141 | } 142 | 143 | /** 144 | * Add wildcard to pattern list 145 | * 146 | * @param string[] $patternList list of patterns 147 | * 148 | * @return string|false 149 | */ 150 | function add_wildcard_to_pattern_list(array $patternList) 151 | { 152 | $wildcard = PathHelper::get_wildcard(); 153 | 154 | if (check_pattern_list_has_wildcard($patternList, $wildcard)) { 155 | return json_encode($patternList); 156 | } 157 | 158 | $newPatternList = []; 159 | $addedPatterns = []; 160 | 161 | foreach ($patternList as $pattern) { 162 | if (empty($pattern)) { 163 | continue; 164 | } 165 | 166 | $pattern = ltrim($pattern, PHP_EOL); 167 | $pattern = trim($pattern); 168 | 169 | if (strpos($pattern, 'http://') !== 0 170 | && strpos($pattern, 'https://') !== 0 171 | && strpos($pattern, '/') !== 0 172 | ) { 173 | // Check if the first part of the string is a host. 174 | // If not, add a leading / so that the pattern 175 | // matcher treats is as a path. 176 | $firstPatternChunk = explode('/', $pattern)[0]; 177 | 178 | if (check_valid_host($firstPatternChunk) === false) { 179 | $pattern = '/' . $pattern; 180 | } 181 | } 182 | 183 | $newPatternList[] = $pattern; 184 | $newPattern = $pattern . '/' . $wildcard; 185 | if (in_array($newPattern, $patternList, true)) { 186 | continue; 187 | } 188 | 189 | if (true === isset($addedPatterns[$newPattern])) { 190 | continue; 191 | } 192 | 193 | $newPatternList[] = $newPattern; 194 | $addedPatterns[$newPattern] = true; 195 | } 196 | 197 | // EOL for display purposes 198 | return json_encode($newPatternList); 199 | } 200 | 201 | /** 202 | * Check if is hostname 203 | * 204 | * @param string $host hostname 205 | * 206 | * @return bool 207 | */ 208 | function check_valid_host(string $host) 209 | { 210 | // contains port 211 | if (strpos($host, ':') < 0) { 212 | return true; 213 | } 214 | 215 | // is localhost 216 | if (strpos($host, 'localhost') === 0) { 217 | return true; 218 | } 219 | 220 | // gotten from https://forums.digitalpoint.com/threads/what-will-be-preg_match-for-domain-names.1953314/#post-15036873 221 | // but updated the ending regex part to include numbers so it also matches 222 | // IPs. 223 | $host_check_regex = '/^[a-zA-Z0-9]*((-|\.)?[a-zA-Z0-9])*\.([a-zA-Z0-9]{1,4})$/'; 224 | 225 | return preg_match($host_check_regex, $host) > 0; 226 | } 227 | -------------------------------------------------------------------------------- /prestashop8.x/upgrade/Upgrade-1.3.0.php: -------------------------------------------------------------------------------- 1 | show_oncustom)) { 102 | $show_oncustom = json_decode($opts->show_oncustom); 103 | if (is_array($show_oncustom)) { 104 | $opts->show_oncustom = add_wildcard_to_pattern_list($show_oncustom); 105 | } 106 | } 107 | 108 | if (isset($opts->hide_oncustom)) { 109 | $hide_oncustom = json_decode($opts->hide_oncustom); 110 | if (is_array($hide_oncustom)) { 111 | $opts->hide_oncustom = add_wildcard_to_pattern_list($hide_oncustom); 112 | } 113 | } 114 | 115 | return Configuration::updateValue( 116 | TawkTo::TAWKTO_WIDGET_OPTS, 117 | json_encode($opts), 118 | false, 119 | $shop_group_id, 120 | $shop_id 121 | ); 122 | } 123 | 124 | /** 125 | * Check pattern list for wildcard 126 | * 127 | * @param string[] $patternList list of patterns 128 | * @param string $wildcard wildcard 129 | * 130 | * @return bool 131 | */ 132 | function check_pattern_list_has_wildcard(array $patternList, string $wildcard) 133 | { 134 | foreach ($patternList as $pattern) { 135 | if (strpos($pattern, $wildcard) > -1) { 136 | return true; 137 | } 138 | } 139 | 140 | return false; 141 | } 142 | 143 | /** 144 | * Add wildcard to pattern list 145 | * 146 | * @param string[] $patternList list of patterns 147 | * 148 | * @return string|false 149 | */ 150 | function add_wildcard_to_pattern_list(array $patternList) 151 | { 152 | $wildcard = PathHelper::get_wildcard(); 153 | 154 | if (check_pattern_list_has_wildcard($patternList, $wildcard)) { 155 | return json_encode($patternList); 156 | } 157 | 158 | $newPatternList = []; 159 | $addedPatterns = []; 160 | 161 | foreach ($patternList as $pattern) { 162 | if (empty($pattern)) { 163 | continue; 164 | } 165 | 166 | $pattern = ltrim($pattern, PHP_EOL); 167 | $pattern = trim($pattern); 168 | 169 | if (strpos($pattern, 'http://') !== 0 170 | && strpos($pattern, 'https://') !== 0 171 | && strpos($pattern, '/') !== 0 172 | ) { 173 | // Check if the first part of the string is a host. 174 | // If not, add a leading / so that the pattern 175 | // matcher treats is as a path. 176 | $firstPatternChunk = explode('/', $pattern)[0]; 177 | 178 | if (check_valid_host($firstPatternChunk) === false) { 179 | $pattern = '/' . $pattern; 180 | } 181 | } 182 | 183 | $newPatternList[] = $pattern; 184 | $newPattern = $pattern . '/' . $wildcard; 185 | if (in_array($newPattern, $patternList, true)) { 186 | continue; 187 | } 188 | 189 | if (true === isset($addedPatterns[$newPattern])) { 190 | continue; 191 | } 192 | 193 | $newPatternList[] = $newPattern; 194 | $addedPatterns[$newPattern] = true; 195 | } 196 | 197 | // EOL for display purposes 198 | return json_encode($newPatternList); 199 | } 200 | 201 | /** 202 | * Check if is hostname 203 | * 204 | * @param string $host hostname 205 | * 206 | * @return bool 207 | */ 208 | function check_valid_host(string $host) 209 | { 210 | // contains port 211 | if (strpos($host, ':') < 0) { 212 | return true; 213 | } 214 | 215 | // is localhost 216 | if (strpos($host, 'localhost') === 0) { 217 | return true; 218 | } 219 | 220 | // gotten from https://forums.digitalpoint.com/threads/what-will-be-preg_match-for-domain-names.1953314/#post-15036873 221 | // but updated the ending regex part to include numbers so it also matches 222 | // IPs. 223 | $host_check_regex = '/^[a-zA-Z0-9]*((-|\.)?[a-zA-Z0-9])*\.([a-zA-Z0-9]{1,4})$/'; 224 | 225 | return preg_match($host_check_regex, $host) > 0; 226 | } 227 | -------------------------------------------------------------------------------- /prestashop8.x/tawkto.php: -------------------------------------------------------------------------------- 1 | name = 'tawkto'; 46 | $this->tab = 'front_office_features'; 47 | $this->version = '1.5.0'; 48 | $this->author = 'tawk.to'; 49 | $this->need_instance = 0; 50 | $this->ps_versions_compliancy = ['min' => '1.5', 'max' => '8.2.99']; 51 | 52 | parent::__construct(); 53 | 54 | $this->displayName = $this->l('tawk.to'); 55 | $this->description = $this->l('tawk.to live chat integration.'); 56 | 57 | $this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); 58 | 59 | if (!Configuration::get(self::TAWKTO_SELECTED_WIDGET)) { 60 | $this->warning = $this->l('No widget selected'); 61 | } 62 | } 63 | 64 | /** 65 | * Install module 66 | * 67 | * @return bool 68 | */ 69 | public function install() 70 | { 71 | return parent::install() && $this->registerHook('displayFooter') && $this->installTab(); 72 | } 73 | 74 | /** 75 | * Install tab 76 | * 77 | * @return bool 78 | */ 79 | private function installTab() 80 | { 81 | $tab = new Tab(); 82 | $tab->active = 1; 83 | $tab->class_name = 'AdminTawkto'; 84 | $tab->name = []; 85 | 86 | foreach (Language::getLanguages(true) as $lang) { 87 | $tab->name[$lang['id_lang']] = 'tawk.to'; 88 | } 89 | 90 | $tab->id_parent = (int) Tab::getIdFromClassName('AdminAdmin'); 91 | $tab->module = $this->name; 92 | 93 | return $tab->add(); 94 | } 95 | 96 | /** 97 | * Hook to add widget on page 98 | * 99 | * @return mixed|string 100 | */ 101 | public function hookDisplayFooter() 102 | { 103 | $current_widget = self::getPropertyAndWidget(); 104 | if (empty($current_widget)) { 105 | return ''; 106 | } 107 | 108 | $pageId = $current_widget['page_id']; 109 | $widgetId = $current_widget['widget_id']; 110 | 111 | $result = Configuration::get(self::TAWKTO_WIDGET_OPTS); 112 | $enable_visitor_recognition = true; // default value 113 | if ($result) { 114 | $options = json_decode($result); 115 | $current_page = (string) $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 116 | 117 | if (isset($options->enable_visitor_recognition)) { 118 | $enable_visitor_recognition = $options->enable_visitor_recognition; 119 | } 120 | 121 | // prepare visibility 122 | if (false == $options->always_display) { 123 | // show on specified urls 124 | $show_pages = $this->getArrayFromJson($options->show_oncustom); 125 | 126 | $show = false; 127 | if (UrlPatternMatcher::match($current_page, $show_pages)) { 128 | $show = true; 129 | } 130 | 131 | if (!$show) { 132 | if ('product' == $this->context->controller->php_self) { 133 | if ($options->show_onproduct) { 134 | $show = true; 135 | } 136 | } 137 | 138 | if ('category' == $this->context->controller->php_self) { 139 | if ($options->show_oncategory) { 140 | $show = true; 141 | } 142 | } 143 | 144 | if ('index' == $this->context->controller->php_self) { 145 | if ($options->show_onfrontpage) { 146 | $show = true; 147 | } 148 | } 149 | } 150 | 151 | if (!$show) { 152 | return; 153 | } 154 | } else { 155 | // hide on specified urls 156 | $hide_pages = $this->getArrayFromJson($options->hide_oncustom); 157 | 158 | $show = true; 159 | if (UrlPatternMatcher::match($current_page, $hide_pages)) { 160 | $show = false; 161 | } 162 | 163 | if (!$show) { 164 | return; 165 | } 166 | } 167 | } 168 | 169 | // add customer details as visitor info 170 | $customer_name = null; 171 | $customer_email = null; 172 | if ($enable_visitor_recognition && !is_null($this->context->customer->id)) { 173 | $customer = $this->context->customer; 174 | $customer_name = $customer->firstname . ' ' . $customer->lastname; 175 | $customer_email = $customer->email; 176 | } 177 | 178 | $this->context->smarty->assign([ 179 | 'widget_id' => $widgetId, 180 | 'page_id' => $pageId, 181 | 'customer_name' => (!is_null($customer_name)) ? $customer_name : '', 182 | 'customer_email' => (!is_null($customer_email)) ? $customer_email : '', 183 | ]); 184 | 185 | return $this->display(__FILE__, 'widget.tpl'); 186 | } 187 | 188 | /** 189 | * Uninstall module 190 | * 191 | * @return bool 192 | */ 193 | public function uninstall() 194 | { 195 | if (!parent::uninstall() || !$this->uninstallTab()) { 196 | return false; 197 | } 198 | 199 | $keys = [ 200 | self::TAWKTO_SELECTED_WIDGET, 201 | self::TAWKTO_WIDGET_OPTS, 202 | self::TAWKTO_WIDGET_USER, 203 | ]; 204 | 205 | foreach ($keys as $key) { 206 | Configuration::deleteByName($key); 207 | } 208 | 209 | return true; 210 | } 211 | 212 | /** 213 | * Uninstall tab 214 | * 215 | * @return bool 216 | */ 217 | public function uninstallTab() 218 | { 219 | $id_tab = (int) Tab::getIdFromClassName('AdminTawkto'); 220 | 221 | if ($id_tab) { 222 | $tab = new Tab($id_tab); 223 | 224 | return $tab->delete(); 225 | } else { 226 | return false; 227 | } 228 | } 229 | 230 | /** 231 | * Redirect to tawk.to module 232 | * 233 | * @return void 234 | */ 235 | public function getContent() 236 | { 237 | Tools::redirectAdmin($this->context->link->getAdminLink('AdminTawkto')); 238 | } 239 | 240 | /** 241 | * Get property ID and widget ID 242 | * 243 | * @return array[string]string 244 | */ 245 | public static function getPropertyAndWidget() 246 | { 247 | $current_widget = Configuration::get(self::TAWKTO_SELECTED_WIDGET); 248 | if (empty($current_widget)) { 249 | return null; 250 | } 251 | 252 | $current_widget = explode(':', $current_widget); 253 | if (count($current_widget) < 2) { 254 | // this means that something went wrong when saving the property and widget. 255 | return null; 256 | } 257 | 258 | return [ 259 | 'page_id' => $current_widget[0], 260 | 'widget_id' => $current_widget[1], 261 | ]; 262 | } 263 | 264 | /** 265 | * Convert JSON to array 266 | * 267 | * @param string|string[] $data data 268 | * 269 | * @return string[] 270 | */ 271 | private function getArrayFromJson($data) 272 | { 273 | $arr = []; 274 | if (is_string($data)) { 275 | $data = json_decode($data); 276 | } 277 | 278 | if (is_array($data)) { 279 | $arr = $data; 280 | } 281 | 282 | return $arr; 283 | } 284 | } 285 | -------------------------------------------------------------------------------- /prestashop1.7/tawkto.php: -------------------------------------------------------------------------------- 1 | name = 'tawkto'; 47 | $this->tab = 'front_office_features'; 48 | $this->version = '1.5.0'; 49 | $this->author = 'tawk.to'; 50 | $this->need_instance = 0; 51 | $this->ps_versions_compliancy = ['min' => '1.5', 'max' => '1.7']; 52 | 53 | parent::__construct(); 54 | 55 | $this->displayName = $this->l('tawk.to'); 56 | $this->description = $this->l('tawk.to live chat integration.'); 57 | 58 | $this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); 59 | 60 | if (!Configuration::get('MYMODULE_NAME')) { 61 | $this->warning = $this->l('No name provided'); 62 | } 63 | } 64 | 65 | /** 66 | * Install module 67 | * 68 | * @return bool 69 | */ 70 | public function install() 71 | { 72 | return parent::install() && $this->registerHook('displayFooter') && $this->installTab(); 73 | } 74 | 75 | /** 76 | * Install tab 77 | * 78 | * @return bool 79 | */ 80 | private function installTab() 81 | { 82 | $tab = new Tab(); 83 | $tab->active = 1; 84 | $tab->class_name = 'AdminTawkto'; 85 | $tab->name = []; 86 | 87 | foreach (Language::getLanguages(true) as $lang) { 88 | $tab->name[$lang['id_lang']] = 'tawk.to'; 89 | } 90 | 91 | $tab->id_parent = (int) Tab::getIdFromClassName('AdminAdmin'); 92 | $tab->module = $this->name; 93 | 94 | return $tab->add(); 95 | } 96 | 97 | /** 98 | * Hook to add widget on page 99 | * 100 | * @return mixed|string 101 | */ 102 | public function hookDisplayFooter() 103 | { 104 | $current_widget = self::getPropertyAndWidget(); 105 | if (empty($current_widget)) { 106 | return ''; 107 | } 108 | 109 | $pageId = $current_widget['page_id']; 110 | $widgetId = $current_widget['widget_id']; 111 | 112 | $result = Configuration::get(self::TAWKTO_WIDGET_OPTS); 113 | $enable_visitor_recognition = true; // default value 114 | if ($result) { 115 | $options = json_decode($result); 116 | $current_page = (string) $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 117 | 118 | if (isset($options->enable_visitor_recognition)) { 119 | $enable_visitor_recognition = $options->enable_visitor_recognition; 120 | } 121 | 122 | // prepare visibility 123 | if (false == $options->always_display) { 124 | // show on specified urls 125 | $show_pages = $this->getArrayFromJson($options->show_oncustom); 126 | 127 | $show = false; 128 | if (UrlPatternMatcher::match($current_page, $show_pages)) { 129 | $show = true; 130 | } 131 | 132 | if (!$show) { 133 | if ('product' == $this->context->controller->php_self) { 134 | if ($options->show_onproduct) { 135 | $show = true; 136 | } 137 | } 138 | 139 | if ('category' == $this->context->controller->php_self) { 140 | if ($options->show_oncategory) { 141 | $show = true; 142 | } 143 | } 144 | 145 | if ('index' == $this->context->controller->php_self) { 146 | if ($options->show_onfrontpage) { 147 | $show = true; 148 | } 149 | } 150 | } 151 | 152 | if (!$show) { 153 | return; 154 | } 155 | } else { 156 | // hide on specified urls 157 | $hide_pages = $this->getArrayFromJson($options->hide_oncustom); 158 | 159 | $show = true; 160 | if (UrlPatternMatcher::match($current_page, $hide_pages)) { 161 | $show = false; 162 | } 163 | 164 | if (!$show) { 165 | return; 166 | } 167 | } 168 | } 169 | 170 | // add customer details as visitor info 171 | $customer_name = null; 172 | $customer_email = null; 173 | if ($enable_visitor_recognition && !is_null($this->context->customer->id)) { 174 | $customer = $this->context->customer; 175 | $customer_name = $customer->firstname . ' ' . $customer->lastname; 176 | $customer_email = $customer->email; 177 | } 178 | 179 | $this->context->smarty->assign([ 180 | 'widget_id' => $widgetId, 181 | 'page_id' => $pageId, 182 | 'customer_name' => (!is_null($customer_name)) ? $customer_name : '', 183 | 'customer_email' => (!is_null($customer_email)) ? $customer_email : '', 184 | ]); 185 | 186 | return $this->display(__FILE__, 'widget.tpl'); 187 | } 188 | 189 | /** 190 | * Uninstall module 191 | * 192 | * @return bool 193 | */ 194 | public function uninstall() 195 | { 196 | if (!parent::uninstall() || !$this->uninstallTab()) { 197 | return false; 198 | } 199 | 200 | $keys = [ 201 | self::TAWKTO_SELECTED_WIDGET, 202 | self::TAWKTO_WIDGET_OPTS, 203 | self::TAWKTO_WIDGET_USER, 204 | ]; 205 | 206 | foreach ($keys as $key) { 207 | Configuration::deleteByName($key); 208 | } 209 | 210 | return true; 211 | } 212 | 213 | /** 214 | * Uninstall tab 215 | * 216 | * @return bool 217 | */ 218 | public function uninstallTab() 219 | { 220 | $id_tab = (int) Tab::getIdFromClassName('AdminTawkto'); 221 | 222 | if ($id_tab) { 223 | $tab = new Tab($id_tab); 224 | 225 | return $tab->delete(); 226 | } else { 227 | return false; 228 | } 229 | } 230 | 231 | /** 232 | * Redirect to tawk.to module 233 | * 234 | * @return void 235 | */ 236 | public function getContent() 237 | { 238 | Tools::redirectAdmin($this->context->link->getAdminLink('AdminTawkto')); 239 | } 240 | 241 | /** 242 | * Get property ID and widget ID 243 | * 244 | * @return array[string]string 245 | */ 246 | public static function getPropertyAndWidget() 247 | { 248 | $current_widget = Configuration::get(self::TAWKTO_SELECTED_WIDGET); 249 | if (empty($current_widget)) { 250 | return null; 251 | } 252 | 253 | $current_widget = explode(':', $current_widget); 254 | if (count($current_widget) < 2) { 255 | // this means that something went wrong when saving the property and 256 | // widget. 257 | return null; 258 | } 259 | 260 | return [ 261 | 'page_id' => $current_widget[0], 262 | 'widget_id' => $current_widget[1], 263 | ]; 264 | } 265 | 266 | /** 267 | * Convert JSON to array 268 | * 269 | * @param string|string[] $data data 270 | * 271 | * @return string[] 272 | */ 273 | private function getArrayFromJson($data) 274 | { 275 | $arr = []; 276 | if (is_string($data)) { 277 | $data = json_decode($data); 278 | } 279 | 280 | if (is_array($data)) { 281 | $arr = $data; 282 | } 283 | 284 | return $arr; 285 | } 286 | } 287 | -------------------------------------------------------------------------------- /prestashop8.x/controllers/admin/AdminTawktoController.php: -------------------------------------------------------------------------------- 1 | bootstrap = true; 36 | $this->display = 'view'; 37 | 38 | parent::__construct(); 39 | $this->meta_title = $this->l('tawk.to'); 40 | 41 | if (!$this->module->active) { 42 | Tools::redirectAdmin($this->context->link->getAdminLink('AdminHome')); 43 | } 44 | } 45 | 46 | /** 47 | * Set toolbar title 48 | * 49 | * @return void 50 | */ 51 | public function initToolBarTitle() 52 | { 53 | $this->toolbar_title[] = $this->l('tawk.to'); 54 | $this->toolbar_title[] = $this->l('Widget'); 55 | } 56 | 57 | /** 58 | * Set toolbar actions 59 | * 60 | * @return mixed 61 | */ 62 | public function initToolbar() 63 | { 64 | $r = parent::initToolbar(); 65 | 66 | if (isset($this->toolbar_btn)) { 67 | unset($this->toolbar_btn['back']); 68 | } else { 69 | unset($this->page_header_toolbar_btn['back']); 70 | } 71 | 72 | return $r; 73 | } 74 | 75 | /** 76 | * Render admin widget settings view 77 | * 78 | * @return string 79 | */ 80 | public function renderView() 81 | { 82 | // get current shopId 83 | $shop = Context::getContext()->shop; 84 | $domain = $shop->domain; 85 | 86 | $optKey = TawkTo::TAWKTO_WIDGET_OPTS; 87 | 88 | // returns 'false' if retrieved none. 89 | $displayOpts = Configuration::get($optKey); 90 | if (!$displayOpts) { 91 | $displayOpts = null; 92 | } 93 | $displayOpts = json_decode($displayOpts); 94 | 95 | $sameUser = true; // assuming there is only one admin by default 96 | $empId = Configuration::get(TawkTo::TAWKTO_WIDGET_USER); 97 | if ($this->context->employee->id != $empId && $empId) { 98 | $sameUser = false; 99 | } 100 | 101 | $currentWidget = TawkTo::getPropertyAndWidget(); 102 | $pageId = ''; 103 | $widgetId = ''; 104 | if (!empty($currentWidget)) { 105 | $pageId = $currentWidget['page_id']; 106 | $widgetId = $currentWidget['widget_id']; 107 | } 108 | 109 | $this->tpl_view_vars = [ 110 | 'iframe_url' => $this->getIframeUrl(), 111 | 'base_url' => $this->getBaseUrl(), 112 | 'controller' => $this->context->link->getAdminLink('AdminTawkto'), 113 | 'tab_id' => (int) $this->context->controller->id, 114 | 'domain' => $domain, 115 | 'display_opts' => $displayOpts, 116 | 'page_id' => $pageId, 117 | 'widget_id' => $widgetId, 118 | 'same_user' => $sameUser, 119 | ]; 120 | 121 | return parent::renderView(); 122 | } 123 | 124 | /** 125 | * Base plugin URL 126 | * 127 | * @return string 128 | */ 129 | private function getBaseUrl() 130 | { 131 | return 'https://plugins.tawk.to'; 132 | } 133 | 134 | /** 135 | * Generates iframe URL 136 | * 137 | * @return string 138 | */ 139 | private function getIframeUrl() 140 | { 141 | $currentWidget = TawkTo::getPropertyAndWidget(); 142 | $pageId = ''; 143 | $widgetId = ''; 144 | if (!empty($currentWidget)) { 145 | $pageId = $currentWidget['page_id']; 146 | $widgetId = $currentWidget['widget_id']; 147 | } 148 | 149 | return $this->getBaseUrl() 150 | . '/generic/widgets' 151 | . '?currentPageId=' . $pageId 152 | . '¤tWidgetId=' . $widgetId; 153 | } 154 | 155 | /** 156 | * Validate page ID and widget ID 157 | * 158 | * @param string $pageId page ID 159 | * @param string $widgetId widget ID 160 | * 161 | * @return int|false 162 | */ 163 | private static function idsAreCorrect(string $pageId, string $widgetId) 164 | { 165 | return preg_match('/^[0-9A-Fa-f]{24}$/', $pageId) === 1 && preg_match('/^[a-z0-9]{1,50}$/i', $widgetId) === 1; 166 | } 167 | 168 | /** 169 | * Save widget page ID and widget ID 170 | * 171 | * @return void 172 | */ 173 | public function ajaxProcessSetWidget() 174 | { 175 | if (!Tools::getIsset('pageId') || !Tools::getIsset('widgetId')) { 176 | die(json_encode(['success' => false])); 177 | } 178 | 179 | $pageId = Tools::getValue('pageId'); 180 | $widgetId = Tools::getValue('widgetId'); 181 | if (!self::idsAreCorrect($pageId, $widgetId)) { 182 | die(json_encode(['success' => false])); 183 | } 184 | 185 | $currentWidgetKey = TawkTo::TAWKTO_SELECTED_WIDGET; 186 | Configuration::updateValue($currentWidgetKey, $pageId . ':' . $widgetId); 187 | 188 | $userKey = TawkTo::TAWKTO_WIDGET_USER; 189 | Configuration::updateValue($userKey, $this->context->employee->id); 190 | 191 | die(json_encode(['success' => true])); 192 | } 193 | 194 | /** 195 | * Remove widget page ID and widget ID 196 | * 197 | * @return void 198 | */ 199 | public function ajaxProcessRemoveWidget() 200 | { 201 | $keys = [ 202 | TawkTo::TAWKTO_SELECTED_WIDGET, 203 | TawkTo::TAWKTO_WIDGET_USER, 204 | ]; 205 | 206 | foreach ($keys as $key) { 207 | if (Shop::getContext() == Shop::CONTEXT_ALL) { 208 | Configuration::updateValue($key, ''); 209 | } else { 210 | // Configuration::deleteFromContext method cannot be used by 211 | // 'All Shops' or the current shop context is 'CONTEXT_ALL'. 212 | Configuration::deleteFromContext($key); 213 | } 214 | } 215 | 216 | die(json_encode(['success' => true])); 217 | } 218 | 219 | /** 220 | * Save visibility settings 221 | * 222 | * @return void 223 | */ 224 | public function ajaxProcessSetVisibility() 225 | { 226 | $jsonOpts = [ 227 | 'always_display' => false, 228 | 229 | // default value needs to be a json encoded of an empty array 230 | // since we're going to save a json encoded array later on. 231 | 'hide_oncustom' => json_encode([]), 232 | 233 | 'show_onfrontpage' => false, 234 | 'show_oncategory' => false, 235 | 'show_onproduct' => false, 236 | 237 | // default value needs to be a json encoded of an empty array 238 | // since we're going to save a json encoded array later on. 239 | 'show_oncustom' => json_encode([]), 240 | 241 | 'enable_visitor_recognition' => false, 242 | ]; 243 | 244 | $options = Tools::getValue('options'); 245 | if (!empty($options)) { 246 | $options = explode('&', $options); 247 | foreach ($options as $post) { 248 | list($column, $value) = explode('=', $post); 249 | switch ($column) { 250 | case 'hide_oncustom': 251 | case 'show_oncustom': 252 | // replace newlines and returns with comma, and convert to array for saving 253 | $value = urldecode($value); 254 | $value = str_ireplace(["\r\n", "\r", "\n"], ',', $value); 255 | if (!empty($value)) { 256 | $value = explode(',', $value); 257 | $jsonOpts[$column] = json_encode($value); 258 | } 259 | break; 260 | case 'show_onfrontpage': 261 | case 'show_oncategory': 262 | case 'show_onproduct': 263 | case 'always_display': 264 | case 'enable_visitor_recognition': 265 | $jsonOpts[$column] = ($value == 1); 266 | break; 267 | } 268 | } 269 | } 270 | 271 | $key = TawkTo::TAWKTO_WIDGET_OPTS; 272 | Configuration::updateValue($key, json_encode($jsonOpts)); 273 | 274 | die(json_encode(['success' => true])); 275 | } 276 | } 277 | -------------------------------------------------------------------------------- /prestashop1.7/controllers/admin/AdminTawktoController.php: -------------------------------------------------------------------------------- 1 | bootstrap = true; 37 | $this->display = 'view'; 38 | 39 | parent::__construct(); 40 | $this->meta_title = $this->l('tawk.to'); 41 | 42 | if (!$this->module->active) { 43 | Tools::redirectAdmin($this->context->link->getAdminLink('AdminHome')); 44 | } 45 | } 46 | 47 | /** 48 | * Set toolbar title 49 | * 50 | * @return void 51 | */ 52 | public function initToolBarTitle() 53 | { 54 | $this->toolbar_title[] = $this->l('tawk.to'); 55 | $this->toolbar_title[] = $this->l('Widget'); 56 | } 57 | 58 | /** 59 | * Set toolbar actions 60 | * 61 | * @return mixed 62 | */ 63 | public function initToolbar() 64 | { 65 | $r = parent::initToolbar(); 66 | 67 | if (isset($this->toolbar_btn)) { 68 | unset($this->toolbar_btn['back']); 69 | } else { 70 | unset($this->page_header_toolbar_btn['back']); 71 | } 72 | 73 | return $r; 74 | } 75 | 76 | /** 77 | * Render admin widget settings view 78 | * 79 | * @return string 80 | */ 81 | public function renderView() 82 | { 83 | // get current shopId 84 | $shop = Context::getContext()->shop; 85 | $domain = $shop->domain; 86 | 87 | $optKey = TawkTo::TAWKTO_WIDGET_OPTS; 88 | 89 | // returns 'false' if retrieved none. 90 | $displayOpts = Configuration::get($optKey); 91 | if (!$displayOpts) { 92 | $displayOpts = null; 93 | } 94 | $displayOpts = Tools::jsonDecode($displayOpts); 95 | 96 | $sameUser = true; // assuming there is only one admin by default 97 | $empId = Configuration::get(TawkTo::TAWKTO_WIDGET_USER); 98 | if ($this->context->employee->id != $empId && $empId) { 99 | $sameUser = false; 100 | } 101 | 102 | $currentWidget = TawkTo::getPropertyAndWidget(); 103 | $pageId = ''; 104 | $widgetId = ''; 105 | if (!empty($currentWidget)) { 106 | $pageId = $currentWidget['page_id']; 107 | $widgetId = $currentWidget['widget_id']; 108 | } 109 | 110 | $this->tpl_view_vars = [ 111 | 'iframe_url' => $this->getIframeUrl(), 112 | 'base_url' => $this->getBaseUrl(), 113 | 'controller' => $this->context->link->getAdminLink('AdminTawkto'), 114 | 'tab_id' => (int) $this->context->controller->id, 115 | 'domain' => $domain, 116 | 'display_opts' => $displayOpts, 117 | 'page_id' => $pageId, 118 | 'widget_id' => $widgetId, 119 | 'same_user' => $sameUser, 120 | ]; 121 | 122 | return parent::renderView(); 123 | } 124 | 125 | /** 126 | * Base plugin URL 127 | * 128 | * @return string 129 | */ 130 | private function getBaseUrl() 131 | { 132 | return 'https://plugins.tawk.to'; 133 | } 134 | 135 | /** 136 | * Generates iframe URL 137 | * 138 | * @return string 139 | */ 140 | private function getIframeUrl() 141 | { 142 | $currentWidget = TawkTo::getPropertyAndWidget(); 143 | $pageId = ''; 144 | $widgetId = ''; 145 | if (!empty($currentWidget)) { 146 | $pageId = $currentWidget['page_id']; 147 | $widgetId = $currentWidget['widget_id']; 148 | } 149 | 150 | return $this->getBaseUrl() 151 | . '/generic/widgets?currentPageId=' . $pageId 152 | . '¤tWidgetId=' . $widgetId; 153 | } 154 | 155 | /** 156 | * Validate page ID and widget ID 157 | * 158 | * @param string $pageId page ID 159 | * @param string $widgetId widget ID 160 | * 161 | * @return int|false 162 | */ 163 | private static function idsAreCorrect(string $pageId, string $widgetId) 164 | { 165 | return preg_match('/^[0-9A-Fa-f]{24}$/', $pageId) === 1 && preg_match('/^[a-z0-9]{1,50}$/i', $widgetId) === 1; 166 | } 167 | 168 | /** 169 | * Save widget page ID and widget ID 170 | * 171 | * @return void 172 | */ 173 | public function ajaxProcessSetWidget() 174 | { 175 | if (!Tools::getIsset('pageId') || !Tools::getIsset('widgetId')) { 176 | die(Tools::jsonEncode(['success' => false])); 177 | } 178 | 179 | $pageId = Tools::getValue('pageId'); 180 | $widgetId = Tools::getValue('widgetId'); 181 | if (!self::idsAreCorrect($pageId, $widgetId)) { 182 | die(Tools::jsonEncode(['success' => false])); 183 | } 184 | 185 | $currentWidgetKey = TawkTo::TAWKTO_SELECTED_WIDGET; 186 | Configuration::updateValue($currentWidgetKey, $pageId . ':' . $widgetId); 187 | 188 | $userKey = TawkTo::TAWKTO_WIDGET_USER; 189 | Configuration::updateValue($userKey, $this->context->employee->id); 190 | 191 | die(Tools::jsonEncode(['success' => true])); 192 | } 193 | 194 | /** 195 | * Remove widget page ID and widget ID 196 | * 197 | * @return void 198 | */ 199 | public function ajaxProcessRemoveWidget() 200 | { 201 | $keys = [ 202 | TawkTo::TAWKTO_SELECTED_WIDGET, 203 | TawkTo::TAWKTO_WIDGET_USER, 204 | ]; 205 | 206 | foreach ($keys as $key) { 207 | if (Shop::getContext() == Shop::CONTEXT_ALL) { 208 | Configuration::updateValue($key, ''); 209 | } else { 210 | // Configuration::deleteFromContext method cannot be used by 211 | // 'All Shops' or the current shop context is 'CONTEXT_ALL'. 212 | Configuration::deleteFromContext($key); 213 | } 214 | } 215 | 216 | die(Tools::jsonEncode(['success' => true])); 217 | } 218 | 219 | /** 220 | * Save visibility settings 221 | * 222 | * @return void 223 | */ 224 | public function ajaxProcessSetVisibility() 225 | { 226 | $jsonOpts = [ 227 | 'always_display' => false, 228 | 229 | // default value needs to be a json encoded of an empty array 230 | // since we're going to save a json encoded array later on. 231 | 'hide_oncustom' => json_encode([]), 232 | 233 | 'show_onfrontpage' => false, 234 | 'show_oncategory' => false, 235 | 'show_onproduct' => false, 236 | 237 | // default value needs to be a json encoded of an empty array 238 | // since we're going to save a json encoded array later on. 239 | 'show_oncustom' => json_encode([]), 240 | 241 | 'enable_visitor_recognition' => false, 242 | ]; 243 | 244 | $options = Tools::getValue('options'); 245 | if (!empty($options)) { 246 | $options = explode('&', $options); 247 | foreach ($options as $post) { 248 | [$column, $value] = explode('=', $post); 249 | switch ($column) { 250 | case 'hide_oncustom': 251 | case 'show_oncustom': 252 | // replace newlines and returns with comma, and convert to array for 253 | // saving 254 | $value = urldecode($value); 255 | $value = str_ireplace(["\r\n", "\r", "\n"], ',', $value); 256 | if (!empty($value)) { 257 | $value = explode(',', $value); 258 | $jsonOpts[$column] = json_encode($value); 259 | } 260 | break; 261 | 262 | case 'show_onfrontpage': 263 | case 'show_oncategory': 264 | case 'show_onproduct': 265 | case 'always_display': 266 | case 'enable_visitor_recognition': 267 | $jsonOpts[$column] = ($value == 1); 268 | break; 269 | } 270 | } 271 | } 272 | 273 | $key = TawkTo::TAWKTO_WIDGET_OPTS; 274 | Configuration::updateValue($key, json_encode($jsonOpts)); 275 | 276 | die(Tools::jsonEncode(['success' => true])); 277 | } 278 | } 279 | -------------------------------------------------------------------------------- /prestashop1.7/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Open Software License v. 3.0 (OSL-3.0) 2 | This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: 3 | 4 | Licensed under the Open Software License version 3.0 5 | 6 | 1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: 7 | 8 | a) to reproduce the Original Work in copies, either alone or as part of a collective work; 9 | 10 | b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; 11 | 12 | c) to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License; 13 | 14 | d) to perform the Original Work publicly; and 15 | 16 | e) to display the Original Work publicly. 17 | 18 | 2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. 19 | 20 | 3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. 21 | 22 | 4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. 23 | 24 | 5) External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). 25 | 26 | 6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. 27 | 28 | 7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. 29 | 30 | 8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. 31 | 32 | 9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). 33 | 34 | 10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. 35 | 36 | 11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. 37 | 38 | 12) Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. 39 | 40 | 13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. 41 | 42 | 14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 43 | 44 | 15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. 45 | 46 | 16) Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. 47 | -------------------------------------------------------------------------------- /prestashop8.x/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Open Software License v. 3.0 (OSL-3.0) 2 | This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: 3 | 4 | Licensed under the Open Software License version 3.0 5 | 6 | 1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: 7 | 8 | a) to reproduce the Original Work in copies, either alone or as part of a collective work; 9 | 10 | b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; 11 | 12 | c) to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License; 13 | 14 | d) to perform the Original Work publicly; and 15 | 16 | e) to display the Original Work publicly. 17 | 18 | 2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. 19 | 20 | 3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. 21 | 22 | 4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. 23 | 24 | 5) External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). 25 | 26 | 6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. 27 | 28 | 7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. 29 | 30 | 8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. 31 | 32 | 9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). 33 | 34 | 10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. 35 | 36 | 11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. 37 | 38 | 12) Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. 39 | 40 | 13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. 41 | 42 | 14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 43 | 44 | 15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. 45 | 46 | 16) Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. 47 | -------------------------------------------------------------------------------- /prestashop1.7/views/templates/admin/tawkto/helpers/view/view.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * tawk.to 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * If you did not receive a copy of the license and are unable to 11 | * obtain it through the world-wide-web, please send an email 12 | * to support@tawk.to so we can send you a copy immediately. 13 | * 14 | * @author tawkto support@tawk.to 15 | * @copyright Copyright (c) 2014-2024 tawk.to 16 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 17 | *} 18 | 19 | {include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title} 20 | 21 | {if !$same_user} 22 |
Widget set by other user
23 | {/if} 24 | 25 | 71 | 72 | 77 | 78 | 79 | 180 | 181 |
Please set the chat widget using the form above, to enable the chat visibility options.
182 | 183 |
184 |
185 |
Privacy Options
186 |
187 |
188 | 194 |
195 |
196 | 204 |
205 |
206 |
207 |
208 |
209 |
210 |
Visibility Settings
211 |
212 |
213 | 219 |
220 |
221 | 229 |
230 |
231 |
232 | 233 |
234 | 240 |
241 | 249 |
250 |
251 | Add URLs/paths to pages in which you would like to hide the widget. ( if "always show" is checked )
252 | Put each URL/path in a new line. Paths should have a leading '/'. 253 |
254 |
255 | Examples of accepted path patterns 256 |
    257 |
  • *
  • 258 |
  • */to/somewhere
  • 259 |
  • /*/to/somewhere
  • 260 |
  • /path/*/somewhere
  • 261 |
  • /path/*/lead/*/somewhere
  • 262 |
  • /path/*/*/somewhere
  • 263 |
  • /path/to/*
  • 264 |
  • /path/to/*/
  • 265 |
  • */to/*/page
  • 266 |
  • /*/to/*/page
  • 267 |
  • /path/*/other/*
  • 268 |
  • /path/*/other/*/
  • 269 |
  • http://www.example.com/
  • 270 |
  • http://www.example.com/*
  • 271 |
  • http://www.example.com/*/to/somewhere
  • 272 |
  • http://www.example.com/path/*/somewhere
  • 273 |
  • http://www.example.com/path/*/lead/*/somewhere
  • 274 |
  • http://www.example.com/path/*/*/somewhere
  • 275 |
  • http://www.example.com/path/to/*
  • 276 |
  • http://www.example.com/path/to/*/
  • 277 |
  • http://www.example.com/*/to/*/page
  • 278 |
  • http://www.example.com/path/*/other/*
  • 279 |
  • http://www.example.com/path/*/other/*/
  • 280 |
281 |
282 |
283 |
284 |
285 | 286 |
287 | 293 |
294 |
295 | 303 |
304 |
305 |
306 | 307 |
308 | 314 |
315 |
316 | 324 |
325 |
326 |
327 | 328 |
329 | 335 |
336 |
337 | 345 |
346 |
347 |
348 | 349 |
350 | 356 |
357 |
358 | 366 |
367 | Add URLs/paths to pages in which you would like to show the widget.
368 | Put each URL/path in a new line. Paths should have a leading '/'. 369 |
370 |
371 | Examples of accepted path patterns 372 |
    373 |
  • *
  • 374 |
  • */to/somewhere
  • 375 |
  • /*/to/somewhere
  • 376 |
  • /path/*/somewhere
  • 377 |
  • /path/*/lead/*/somewhere
  • 378 |
  • /path/*/*/somewhere
  • 379 |
  • /path/to/*
  • 380 |
  • /path/to/*/
  • 381 |
  • */to/*/page
  • 382 |
  • /*/to/*/page
  • 383 |
  • /path/*/other/*
  • 384 |
  • /path/*/other/*/
  • 385 |
  • http://www.example.com/
  • 386 |
  • http://www.example.com/*
  • 387 |
  • http://www.example.com/*/to/somewhere
  • 388 |
  • http://www.example.com/path/*/somewhere
  • 389 |
  • http://www.example.com/path/*/lead/*/somewhere
  • 390 |
  • http://www.example.com/path/*/*/somewhere
  • 391 |
  • http://www.example.com/path/to/*
  • 392 |
  • http://www.example.com/path/to/*/
  • 393 |
  • http://www.example.com/*/to/*/page
  • 394 |
  • http://www.example.com/path/*/other/*
  • 395 |
  • http://www.example.com/path/*/other/*/
  • 396 |
397 |
398 |
399 |
400 |
401 |
402 | 407 |
408 |
409 | 462 | 463 | -------------------------------------------------------------------------------- /prestashop8.x/views/templates/admin/tawkto/helpers/view/view.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * tawk.to 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Open Software License (OSL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/osl-3.0.php 10 | * If you did not receive a copy of the license and are unable to 11 | * obtain it through the world-wide-web, please send an email 12 | * to support@tawk.to so we can send you a copy immediately. 13 | * 14 | * @author tawkto support@tawk.to 15 | * @copyright Copyright (c) 2014-2024 tawk.to 16 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 17 | *} 18 | 19 | {include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title} 20 | 21 | {if !$same_user} 22 |
Widget set by other user
23 | {/if} 24 | 25 | 71 | 72 | 77 | 78 | 79 | 180 | 181 |
Please set the chat widget using the form above, to enable the chat visibility options.
182 | 183 |
184 |
185 |
Privacy Options
186 |
187 |
188 | 194 |
195 |
196 | 204 |
205 |
206 |
207 |
208 |
209 |
210 |
Visibility Settings
211 |
212 |
213 | 219 |
220 |
221 | 229 |
230 |
231 |
232 | 233 |
234 | 240 |
241 | 249 |
250 |
251 | Add URLs/paths to pages in which you would like to hide the widget. ( if "always show" is checked )
252 | Put each URL/path in a new line. Paths should have a leading '/'. 253 |
254 |
255 | Examples of accepted path patterns 256 |
    257 |
  • *
  • 258 |
  • */to/somewhere
  • 259 |
  • /*/to/somewhere
  • 260 |
  • /path/*/somewhere
  • 261 |
  • /path/*/lead/*/somewhere
  • 262 |
  • /path/*/*/somewhere
  • 263 |
  • /path/to/*
  • 264 |
  • /path/to/*/
  • 265 |
  • */to/*/page
  • 266 |
  • /*/to/*/page
  • 267 |
  • /path/*/other/*
  • 268 |
  • /path/*/other/*/
  • 269 |
  • http://www.example.com/
  • 270 |
  • http://www.example.com/*
  • 271 |
  • http://www.example.com/*/to/somewhere
  • 272 |
  • http://www.example.com/path/*/somewhere
  • 273 |
  • http://www.example.com/path/*/lead/*/somewhere
  • 274 |
  • http://www.example.com/path/*/*/somewhere
  • 275 |
  • http://www.example.com/path/to/*
  • 276 |
  • http://www.example.com/path/to/*/
  • 277 |
  • http://www.example.com/*/to/*/page
  • 278 |
  • http://www.example.com/path/*/other/*
  • 279 |
  • http://www.example.com/path/*/other/*/
  • 280 |
281 |
282 |
283 |
284 |
285 | 286 |
287 | 293 |
294 |
295 | 303 |
304 |
305 |
306 | 307 |
308 | 314 |
315 |
316 | 324 |
325 |
326 |
327 | 328 |
329 | 335 |
336 |
337 | 345 |
346 |
347 |
348 | 349 |
350 | 356 |
357 |
358 | 366 |
367 | Add URLs/paths to pages in which you would like to show the widget.
368 | Put each URL/path in a new line. Paths should have a leading '/'. 369 |
370 |
371 | Examples of accepted path patterns 372 |
    373 |
  • *
  • 374 |
  • */to/somewhere
  • 375 |
  • /*/to/somewhere
  • 376 |
  • /path/*/somewhere
  • 377 |
  • /path/*/lead/*/somewhere
  • 378 |
  • /path/*/*/somewhere
  • 379 |
  • /path/to/*
  • 380 |
  • /path/to/*/
  • 381 |
  • */to/*/page
  • 382 |
  • /*/to/*/page
  • 383 |
  • /path/*/other/*
  • 384 |
  • /path/*/other/*/
  • 385 |
  • http://www.example.com/
  • 386 |
  • http://www.example.com/*
  • 387 |
  • http://www.example.com/*/to/somewhere
  • 388 |
  • http://www.example.com/path/*/somewhere
  • 389 |
  • http://www.example.com/path/*/lead/*/somewhere
  • 390 |
  • http://www.example.com/path/*/*/somewhere
  • 391 |
  • http://www.example.com/path/to/*
  • 392 |
  • http://www.example.com/path/to/*/
  • 393 |
  • http://www.example.com/*/to/*/page
  • 394 |
  • http://www.example.com/path/*/other/*
  • 395 |
  • http://www.example.com/path/*/other/*/
  • 396 |
397 |
398 |
399 |
400 |
401 |
402 | 407 |
408 |
409 | 462 | 463 | --------------------------------------------------------------------------------