我需要在產品頁面中顯示產品尺寸。 這是我的代碼,但沒有執行。 我加入目錄/控制器/產品/ product.php在opencart產品頁面中顯示尺寸
<?php
$this->data['length'] = number_format($product_info['length'],2) . ' cm';
$this->data['width'] = number_format($product_info['width'],2) . ' cm';
$this->data['height'] = number_format($product_info['height'],2) . ' cm';
,並在同一文件
$this->data['text_dimensions'] = $this->language->get('text_dimensions');
$this->data['text_by'] = $this->language->get('text_by');
和在目錄/視圖/主題/默認/模板/產品/ product.tpl
<?php echo $length; ?><?php echo $text_by; ?><?php echo width; ?><?php echo $text_by; ?><?php echo $height; ?><?php echo $text_by; ?>
,並在我的目錄/語言/英文/產品/ product.php
$_['text_dimensions'] = 'Dimensions:';
$_['text_by'] = 'x';
嘗試此代碼維度未在opencart中顯示。
版本是你的工作內容Opencart的? –
你通過控制器傳遞了語言變量嗎? 如果是這樣,他們是否出現在該地方的頁面上? –
opencart 2.1.0.2版本 – narendra