Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Baskethome

Newbie
  
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

799 profile views

Baskethome's Achievements

Rookie

Rookie (2/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. <?php class ControllerModuleBestSeller extends Controller { public function index($setting) { $this->load->language('module/bestseller'); $this->load->language('product/product'); $data['heading_title'] = $this->language->get('heading_title'); $data['text_tax'] = $this->language->get('text_tax'); $data['button_cart'] = $this->language->get('button_cart'); $data['button_wishlist'] = $this->language->get('button_wishlist'); $data['button_compare'] = $this->language->get('button_compare'); $this->load->model('catalog/product'); $this->load->model('tool/image'); $data['products'] = array(); $results = $this->model_catalog_product->getBestSellerProducts($setting['limit']); if ($results) { foreach ($results as $result) { if ($result['image']) { $image = $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height']); } else { $image = $this->model_tool_image->resize('placeholder.png', $setting['width'], $setting['height']); } if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $price = false; } if ((float)$result['special']) { $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax'))); } else { $special = false; } if ($this->config->get('config_tax')) { $tax = $this->currency->format((float)$result['special'] ? $result['special'] : $result['price']); } else { $tax = false; } if ($this->config->get('config_review_status')) { $rating = $result['rating']; } else { $rating = false; } $data['products'][] = array( 'product_id' => $result['product_id'], 'attribute_groups' => $this->model_catalog_product->getProductAttributes($product_info['product_id']), 'thumb' => $image, 'name' => $result['name'], 'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, $this->config->get('config_product_description_length')) . '..', 'price' => $price, 'special' => $special, 'tax' => $tax, 'rating' => $rating, 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id']) ); } if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/bestseller.tpl')) { return $this->load->view($this->config->get('config_template') . '/template/module/bestseller.tpl', $data); } else { return $this->load->view('default/template/module/bestseller.tpl', $data); } } } }
  2. Notice: Undefined variable: product_info in /home/.../...\/docs/vqmod/vqcache/vq2-catalog_controller_module_bestseller.php on line 76Notice: Undefined variable: product_info in /home/.../.../docs/vqmod/vqcache/vq2-catalog_controller_module_bestseller.php on line 76Notice: Undefined variable: product_info in /home/.../.../docs/vqmod/vqcache/vq2-catalog_controller_module_bestseller.php on line 76Notice: Undefined variable: product_info in /home/.../.../docs/vqmod/vqcache/vq2-catalog_controller_module_bestseller.php on line 76
  3. 1. Не получается вывести атрибуты в модуле Хиты продажю Делал по аналогии как делал с модулем Рекомендуемые, там работает, а в Хитах нет. как делал в Рекомендуемые FEATURED.PHP после $this->load->language('module/featured'); добавил $this->load->language('product/product'); после 'product_id' => $product_info['product_id'], добавил 'attribute_groups' => $this->model_catalog_product->getProductAttributes($product_info['product_id']), FEATURED.TPL <div class="concurentus"> <?php if($product['attribute_groups']) { ?> <?php foreach($product['attribute_groups'] as $attribute_group) { ?> <p class="concurentus-title"><?php echo $attribute_group['name']; ?></p> <?php foreach($attribute_group['attribute'] as $attribute) { ?> <p class="concurentus-text"><?php echo $attribute['name']; ?></p> <!--<td><?php echo $attribute['text']; ?></td>--> <?php } ?> <?php } ?> <?php } ?> </div> 2. Как можно сделать, чтобы в Хитах отображались товары, которые я сам выберу в админке или по id?
  4. Тема закрыта Может кому пригодится: 1. контролер - категория пхп $template = 'category.tpl'; if ($category_id == 27) { $template = 'category1.tpl'; } if ($category_id == 28) { $template = 'category2.tpl'; } if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/product/'.$template)) { $this->response->setOutput($this->load->view($this->config->get('config_template') . '/template/product/'.$template, $data)); } else { $this->response->setOutput($this->load->view('default/template/product/'.$template, $data)); } 2. копируем новый шаблон и переименовываем его.
  5. Всем привет! Только осваиваю OPENCART. Стоит OPENCART 2, шаблон стандартный при установки. Есть 5-6 категорий, в категориях выводится цена товара. Подскажите, пожалуйста, как сделать, чтобы у определенных категорий около цены выводить "ОТ" ? Пробовал так, но ошибка catalog/view/theme/default/template/product/category.tpl перед ценой <?php if ($category_id == 59){ ?> <?php echo 'от';?> <?php } else { ?> <?php echo '';?> <?php } ?>
Guest
×
  • Create New...

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.