130 lines
4.0 KiB
PHP
130 lines
4.0 KiB
PHP
<?php
|
|
/**
|
|
* 2022 ECSoft
|
|
*
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* This source file is subject to the Academic Free License (AFL 3.0)
|
|
* that is bundled with this package in the file LICENSE.txt.
|
|
* It is also available through the world-wide-web at this URL:
|
|
* http://opensource.org/licenses/afl-3.0.php
|
|
* If you did not receive a copy of the license and are unable to
|
|
* obtain it through the world-wide-web, please send an email
|
|
* to dev.ecsoft@gmail.com so we can send you a copy immediately.
|
|
*
|
|
* @author ECSoft <dev.ecsoft@gmail.com>
|
|
* @copyright 2022 ECSoft
|
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
|
* International Registered Trademark & Property of ECSoft
|
|
*/
|
|
include_once dirname(__FILE__) . '/EcsGtmProModelAbstract.php';
|
|
|
|
class EcsGtmProGcrConfig extends EcsGtmProModelAbstract
|
|
{
|
|
public $enable;
|
|
public $add_badge;
|
|
public $merchant_id;
|
|
public $badge_position;
|
|
public $confirmation;
|
|
public $delivery_delay;
|
|
|
|
public function attributeTypes()
|
|
{
|
|
return array(
|
|
'merchant_id' => 'text',
|
|
'delivery_delay' => 'text',
|
|
'badge_position' => 'select'
|
|
);
|
|
}
|
|
|
|
public function badgePositionSelectOptions()
|
|
{
|
|
return array(
|
|
array(
|
|
'id' => 'bottom_left',
|
|
'name' => $this->l('Bottom left')
|
|
),
|
|
array(
|
|
'id' => 'bottom_right',
|
|
'name' => $this->l('Bottom right')
|
|
)
|
|
);
|
|
}
|
|
|
|
public function fieldSuffix()
|
|
{
|
|
return array(
|
|
'delivery_delay' => $this->l('days', 'EcsGtmProGcrConfig')
|
|
);
|
|
}
|
|
|
|
public function attributeLabels()
|
|
{
|
|
return array(
|
|
'enable' => $this->l('Enable Google Customer Reviews', 'EcsGtmProGcrConfig'),
|
|
'add_badge' => $this->l('Add the Customer Reviews badge code', 'EcsGtmProGcrConfig'),
|
|
'merchant_id' => $this->l('Merchant ID', 'EcsGtmProGcrConfig'),
|
|
'badge_position' => $this->l('Badge position', 'EcsGtmProGcrConfig'),
|
|
'confirmation' => $this->l('Enable the order confirmation module', 'EcsGtmProGcrConfig'),
|
|
'delivery_delay' => $this->l('Delivery delay', 'EcsGtmProGcrConfig'),
|
|
);
|
|
}
|
|
|
|
public function attributeDescriptions()
|
|
{
|
|
return array(
|
|
'add_badge' => $this->l('You must set this option to YES, unless you have already added the badge code in your source file or with Google Tag Manager.', 'EcsGtmProGcrConfig'),
|
|
'merchant_id' => $this->l('You can find your Google Merchant ID in your Google Merchant Center.', 'EcsGtmProGcrConfig'),
|
|
'badge_position' => $this->l('Position of the Google Customer Reviews badge.', 'EcsGtmProGcrConfig'),
|
|
'confirmation' => $this->l('You must set this option to YES, unless you have already added the order confirmation code in your order confirmation page.', 'EcsGtmProGcrConfig'),
|
|
'delivery_delay' => $this->l('The estimated number of days before an order is delivered.', 'EcsGtmProGcrConfig'),
|
|
);
|
|
}
|
|
|
|
public function rules()
|
|
{
|
|
return array(
|
|
array(
|
|
array(
|
|
'enable',
|
|
'add_badge',
|
|
'merchant_id',
|
|
'badge_position',
|
|
'confirmation'
|
|
), 'safe'
|
|
),
|
|
array(
|
|
array(
|
|
'delivery_delay'
|
|
), 'isInt'
|
|
)
|
|
);
|
|
}
|
|
|
|
public function attributeDefaults()
|
|
{
|
|
return array(
|
|
'enable' => 0,
|
|
'add_badge' => 1,
|
|
'badge_position' => 'bottom_right',
|
|
'confirmation' => 1,
|
|
'delivery_delay' => 3
|
|
);
|
|
}
|
|
|
|
public function configKey()
|
|
{
|
|
return 'ecsgcr';
|
|
}
|
|
|
|
public function getFormTitle()
|
|
{
|
|
return $this->l('Google Customer Reviews', 'EcsGtmProGcrConfig');
|
|
}
|
|
|
|
public function getActiveTab()
|
|
{
|
|
return 'EcsGtmProGcrConfig';
|
|
}
|
|
}
|