Jump to content
Sign in to follow this  
Milena

Как добавить Артикул товара

Recommended Posts

Как сделать так, что бы артикул отображался в карточке товара и его видел посетитель сайта.

Share this post


Link to post
Share on other sites

...\catalog\controller\product\product.php после 

$this->data['text_model'] = $this->language->get('text_model');

 добавляем

 $this->data['text_sku'] = $this->language->get('text_sku');

...\catalog\language\russian\product\product.php после

 $_['text_model']        = 'Модель:'; 

добавляем 

$_['text_sku']          = 'Артикул:';

...\catalog\view\theme\ваша_тема\template\product\product.tpl после 

<span><?php echo $text_model; ?></span> <?php echo $model; ?><br />

 добавляем

<?php if ($sku) { ?>
<span><?php echo $text_sku; ?></span> <?php echo $sku; ?><br />
<?php } ?>

Share this post


Link to post
Share on other sites

Все сделал как описано выше и у меня не получилось, пишет ошибку (ocStore 1.5.5.1.2):

Notice: Undefined variable: sku in /home/a/_________/____________/public_html/catalog/view/theme/default/template/product/product.tpl on line 30

Share this post


Link to post
Share on other sites

Вот кусок кода в файле catalog/view/theme/default/template/product/product.tpl

<div class="description">
        <?php if ($manufacturer) { ?>
        <span><?php echo $text_manufacturer; ?></span> <a href="<?php echo $manufacturers; ?>"><?php echo $manufacturer; ?></a><br />
        <?php } ?>
        <span><?php echo $text_model; ?></span> <?php echo $model; ?><br />
        <?php if ($sku) { ?>
        <span><?php echo $text_sku; ?></span> <?php echo $sku; ?><br />
        <?php } ?>
        <?php if ($reward) { ?>
        <span><?php echo $text_reward; ?></span> <?php echo $reward; ?><br />
        <?php } ?>
        <span><?php echo $text_stock; ?></span> <?php echo $stock; ?></div>

Share this post


Link to post
Share on other sites

Вопрос решен! Вышеуказанный пример не работает, делать нужно вот так http://for-opencart.com/sku-opencart

естественно не работает))

я пропустил в  ..\catalog\controller\product\product.php 

после

 $this->data['model'] = $product_info['model'];

 надо вставить

$this->data['sku'] = $product_info['sku'];

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.