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

fanatic

Users
  • Posts

    4,902
  • Joined

  • Last visited

Everything posted by fanatic

  1. в библиотеке cart.php метод getProcucts if (!$product_query->row['quantity'] || ($product_query->row['quantity'] < $cart['quantity'])) { $stock = false; } // ...................... $product_data[] = array( 'cart_id' => $cart['cart_id'], 'product_id' => $product_query->row['product_id'], 'name' => $product_query->row['name'], 'model' => $product_query->row['model'], 'shipping' => $product_query->row['shipping'], 'image' => $product_query->row['image'], 'option' => $option_data, 'download' => $download_data, 'quantity' => $cart['quantity'], 'minimum' => $product_query->row['minimum'], 'subtract' => $product_query->row['subtract'], 'stock' => $stock,// тута наличие 'price' => ($price + $option_price), 'total' => ($price + $option_price) * $cart['quantity'], 'reward' => $reward * $cart['quantity'], 'points' => ($product_query->row['points'] ? ($product_query->row['points'] + $option_points) * $cart['quantity'] : 0), 'tax_class_id' => $product_query->row['tax_class_id'], 'weight' => ($product_query->row['weight'] + $option_weight) * $cart['quantity'], 'weight_class_id' => $product_query->row['weight_class_id'], 'length' => $product_query->row['length'], 'width' => $product_query->row['width'], 'height' => $product_query->row['height'], 'length_class_id' => $product_query->row['length_class_id'], 'recurring' => $recurring ); метод проверяет есть ли в корзине товары которых нет на складе public function hasStock() { foreach ($this->getProducts() as $product) { if (!$product['stock']) { return false; } } return true; } confirm.php // Validate cart has products and has stock. if ((!$this->cart->hasProducts() && empty($this->session->data['vouchers'])) || (!$this->cart->hasStock() && !$this->config->get('config_stock_checkout'))) { $redirect = $this->url->link('checkout/cart'); } контроллер корзины cart.php if (!$this->cart->hasStock() && (!$this->config->get('config_stock_checkout') || $this->config->get('config_stock_warning'))) { $data['error_warning'] = $this->language->get('error_stock'); } elseif (isset($this->session->data['error'])) { $data['error_warning'] = $this->session->data['error'];
  2. В смысле расшифровка? Типа подсказка, описание?
  3. там вообще тяжелый случай перед тем как дать доступ в админку, целый допрос, вплоть чуть ли не до скрина паспорта далее, ftp на скрине без пароля ну и варез на довесок
  4. именно $('#history').load('index.php?route=sale/order/history&token=<?php echo $token; ?>&order_id=<?php echo $order_id; ?>'); идем в файл sale/order и смотрим метод history, и видим формирование истории $this->load->model('sale/order'); $results = $this->model_sale_order->getOrderHistories($this->request->get['order_id'], ($page - 1) * 10, 10); foreach ($results as $result) { $data['histories'][] = array( 'notify' => $result['notify'] ? $this->language->get('text_yes') : $this->language->get('text_no'), 'status' => $result['status'], 'comment' => nl2br($result['comment']), 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])) ); } и в шаблоне sale/order_history.tpl вывод этого массива <?php if ($histories) { ?> <?php foreach ($histories as $history) { ?> <tr> <td class="text-left"><?php echo $history['date_added']; ?></td> <td class="text-left"><?php echo $history['comment']; ?></td> <td class="text-left"><?php echo $history['status']; ?></td> <td class="text-left"><?php echo $history['notify']; ?></td> </tr> <?php } ?> <?php } else { ?> <tr> <td class="text-center" colspan="4"><?php echo $text_no_results; ?></td> </tr> <?php } ?>
  5. и откуда он возьмется в контроллере, если не передать post or get?
  6. catalog/language/ua-uk/common/cart.php не?
  7. модель catalog/model/catalog/product.php создаем метод public function getAttributeInProduct($product_id, $attribute_id) { $query = $this->db->query("SELECT ad.name, pa.text FROM " . DB_PREFIX . "attribute a LEFT JOIN " . DB_PREFIX . "attribute_description ad ON (a.attribute_id = ad.attribute_id) LEFT JOIN " . DB_PREFIX . "product_attribute pa ON(pa.attribute_id = a.attribute_id) WHERE a.attribute_id = '" . (int) $attribute_id . "' AND pa.product_id = '" . (int) $product_id . "' AND pa.language_id = '" . (int) $this->config->get('config_language_id') . "' AND ad.language_id = '" . (int) $this->config->get('config_language_id') . "'"); return $query->row; } для категории файл сatalog/controller/product/category.php находим строку $data['products'][] = array( перед ней вставляем $attribute_id = 2;// тут, id нужного атрибута $attr = $this->model_catalog_product->getAttributeInProduct($result['product_id'], $attribute_id); после вставляем 'attr' => $attr, шаблон catalog/view/theme/ваша тема/template/product/category.twig находим <p>{{ product.description }}</p> после вставляем {% if product.attr %} <p>{{ product.attr['name'] }} - {{ product.attr['text'] }}</p> {% endif %} для featured, делаем по аналогии
  8. это для одного атрибута в телеге спрашивали
  9. <p>{{ product.attr['name'] }} - {{ product.attr['text'] }}</p>
  10. $query = $this->db->query("SELECT ad.name, pa.text FROM " . DB_PREFIX . "attribute a LEFT JOIN " . DB_PREFIX . "attribute_description ad ON (a.attribute_id = ad.attribute_id) LEFT JOIN " . DB_PREFIX . "product_attribute pa ON(pa.attribute_id = a.attribute_id) WHERE a.attribute_id = '2' AND pa.product_id = '" . (int) $product_id . "' AND pa.language_id = '" . (int) $this->config->get('config_language_id') . "' AND ad.language_id = '" . (int)$this->config->get('config_language_id') . "'"); $attr = $query->row;
  11. если актуально, пишите подробности в в личку.
×
×
  • 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.