這些行檢查配置值,但只有當<ccc available="false" />
。
所以如果你有<ccc available="true" />
你是說你的主題是CCC
不兼容,如果店內有CCC
啓用與否並不重要。
如果您設置,爲false
,安裝會檢查是否涉及到CCC
設置將被禁用,否則會拋出一個錯誤,他們的CCC
配置不會與你的主題工作的用戶。
您可以看到特徵定義here。
'ccc' => array(
'attributes' => array(
'available' => array(
'value' => 'true',
/*
* accepted attribute value if value doesn't match, prestashop configuration value must have those values
*/
'check_if_not_valid' => array(
'PS_CSS_THEME_CACHE' => 0,
'PS_JS_THEME_CACHE' => 0,
'PS_HTML_THEME_COMPRESSION' => 0,
'PS_JS_HTML_THEME_COMPRESSION' => 0,
),
),
),
'error' => 'This theme may not correctly use PrestaShop\'s "combine, compress and cache" options.',
'tab' => 'AdminPerformance',
)
所以,如果你在設置你的3210 <ccc available="false" />
它會檢查,在check_if_not_valid
陣列中的所有四種配置都設置爲0,否則是會拋出一個錯誤信息This theme may not correctly use PrestaShop's "combine, compress and cache" options.
。
至於配置主題安裝的設置,我沒有看到一種方法來做到這一點與XML配置沒有重寫AdminThemesController
類,但我猜你想分配這個主題,所以重寫不是一個選項。
你可以做的是安裝一個簡單的配置設置模塊以及連接到displayAfterThemeInstallation
的主題。
public function hookDisplayAfterThemeInstallation($params)
{
$theme_name = $params['theme_name'];
if ($theme_name != 'mythemename') {
return false;
}
// Enable Move JS to bottom setting
Configuration::updateValue('PS_JS_DEFER', 1);
// Optional text or html to display
return 'Your settings have been changed';
}
這樣做,謝謝。 :) –
社區主題實際上包含了一個類似的主題:https://github.com/PrestaShop/community-theme-16/blob/dev/modules/ctconfiguration/ctconfiguration.php –
s/theme/module/... –