これは今日の話題であり、自分のサイト用のjQuery Mobileに基づいたテンプレートを作成する必要があります。ビルドテンプレートは問題ではありませんが、誰かがトラフモバイルデバイスをナビゲートするときに表示されます。私はそれを行うためにOCコアのいくつかのコードを変更する必要があることを知っているが、いくつかのアドバイスや助けが必要です。最初に、テンプレートがロードされる場所は/system/engine/controller.phpです。これは、関数である:モバイルデバイス用の開発
protected function render() {
foreach ($this->children as $child) {
$this -> data[basename($child)] = $this -> getChild($child);
}
if (file_exists(DIR_TEMPLATE . $this -> template)) {
extract($this -> data);
ob_start();
require (DIR_TEMPLATE . $this -> template);
$this -> output = ob_get_contents();
ob_end_clean();
return $this -> output;
} else {
exit('Error: Could not load template ' . DIR_TEMPLATE . $this -> template . '!');
}
}
[OK]を、私は、ユーザーエージェントは、モバイルデバイスがあるか、ないかどうかを確認するために対処する方法で管理し、これが結果です:私が使用してアクセスもしようとすると、今
protected function render() {
foreach ($this->children as $child) {
$this -> data[basename($child)] = $this -> getChild($child);
}
//--------- ADDED -------------------------------------------------
if ($this -> config -> get('mobile_status') == 1) {
if (($this -> isMobile() && $this -> config -> get('autodetect') == 'true') || $this -> session -> data['ismobile'] == 1) {
$mobile_template = $this -> config -> get('mobile_template_name');
if ($mobile_template != '') {
if (!function_exists('is_dir') || (function_exists('is_dir') && is_dir(DIR_TEMPLATE . $mobile_template))) {
$this -> template = $mobile_template . "/";
}
}
}
}
//--------- ADDED -------------------------------------------------
if (file_exists(DIR_TEMPLATE . $this -> template)) {
extract($this -> data);
ob_start();
require (DIR_TEMPLATE . $this -> template);
$this -> output = ob_get_contents();
ob_end_clean();
return $this -> output;
} else {
exit('Error: Could not load template ' . DIR_TEMPLATE . $this -> template . '!');
}
}
モバイルユーザエージェント
D:\Webserver\htdocs\portal/catalog/view/theme/libcommerce_mobile/Warning: require(D:\Webserver\htdocs\portal\catalog\view\theme\libcommerce_mobile) [function.require]: failed to open stream: Permission denied in D:\Webserver\htdocs\portal\system\engine\controller.php on line 77 Fatal error: require() [function.require]: Failed opening required 'D:\Webserver\htdocs\portal/catalog/view/theme/libcommerce_mobile/' (include_path='.;D:\Webserver\php\PEAR') in D:\Webserver\htdocs\portal\system\engine\controller.php on line 77
しかし、このディレクトリには驚きのディレクトリがあり、これは助けになりますか?私は間違っているの? 乾杯もう一回
PS:このトピックから来てここに掲載http://forum.opencart.com/viewtopic.php?f=20&t=47124
'libcommerce_mobile'ディレクトリですか、それともファイルですか? –
テスト用のデフォルトディレクトリのコピーですが、後でモバイル版に合わせて内容を変更しました – ReynierPM