Online Consultant
This commit is contained in:
parent
a3a70707ae
commit
c0ff7028f2
@ -148,6 +148,12 @@ msgstr "Los métodos de la formalización del pedido"
|
||||
msgid "Catalog settings"
|
||||
msgstr "Ajustes del catálogo"
|
||||
|
||||
msgid "Online assistant"
|
||||
msgstr "Consultor en línea"
|
||||
|
||||
msgid "Insert the Online consultant code here"
|
||||
msgstr "Inserte el código de consultor en Línea aquí"
|
||||
|
||||
msgid "Select API version"
|
||||
msgstr "Selecciona la versión de API"
|
||||
|
||||
|
@ -157,6 +157,12 @@ msgstr "Способы оформления заказа"
|
||||
msgid "Catalog settings"
|
||||
msgstr "Настройки каталога"
|
||||
|
||||
msgid "Online assistant"
|
||||
msgstr "Онлайн консультант"
|
||||
|
||||
msgid "Insert the Online consultant code here"
|
||||
msgstr "Вставьте код Онлайн-консультанта здесь"
|
||||
|
||||
msgid "Select API version"
|
||||
msgstr "Выберите версию API"
|
||||
|
||||
|
@ -147,6 +147,13 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration
|
||||
'desc_tip' => true
|
||||
);
|
||||
|
||||
$this->form_fields['online_assistant'] = array(
|
||||
'title' => __( 'Online assistant', 'retailcrm' ),
|
||||
'type' => 'textarea',
|
||||
'id' => 'online_assistant',
|
||||
'placeholder' => __( 'Insert the Online consultant code here', 'retailcrm' )
|
||||
);
|
||||
|
||||
$this->form_fields[] = array(
|
||||
'title' => __( 'Catalog settings', 'retailcrm' ),
|
||||
'type' => 'title',
|
||||
@ -557,6 +564,23 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration
|
||||
return ob_get_clean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the original value for the online_consultant field (ignores woocommerce validation)
|
||||
* @param $key
|
||||
* @param $value
|
||||
* @return string
|
||||
*/
|
||||
public function validate_online_assistant_field($key, $value)
|
||||
{
|
||||
$onlineAssistant = $_POST['woocommerce_integration-retailcrm_online_assistant'];
|
||||
|
||||
if (!empty($onlineAssistant) && is_string($onlineAssistant)) {
|
||||
return wp_unslash($onlineAssistant);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate API url
|
||||
*
|
||||
|
@ -92,6 +92,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
add_action('profile_update', array($this, 'update_customer'), 10, 2);
|
||||
add_action('wp_print_scripts', array($this, 'initialize_analytics'), 98);
|
||||
add_action('wp_print_scripts', array($this, 'initialize_daemon_collector'), 99);
|
||||
add_action('wp_print_scripts', array($this, 'initialize_online_assistant'), 101);
|
||||
add_action('wp_print_footer_scripts', array($this, 'send_analytics'), 99);
|
||||
add_action('woocommerce_new_order', array($this, 'create_order'), 11, 1);
|
||||
|
||||
@ -114,7 +115,7 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
$this->init_settings();
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @param $settings
|
||||
*
|
||||
* @return array
|
||||
@ -374,6 +375,16 @@ if (!class_exists('WC_Retailcrm_Base')) {
|
||||
echo '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize online consultant
|
||||
*/
|
||||
public function initialize_online_assistant()
|
||||
{
|
||||
if (!is_admin()) {
|
||||
echo $this->get_option('online_assistant');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get retailcrm api client
|
||||
|
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user