Answer the question
In order to leave comments, you need to log in
Why is the template of a separate product card not connected?
Website hosted. When going from the home page to a product page, error
Not Found
The requested URL /macbook was not found on this server.
Apache/2.4.10 (Unix) Server at x95345lc.beget.tech Port 80
Everything works on the local server.
product.php in controller
$data['breadcrumbs'][] = array(
'text' => $product_info['name'],
'href' => $this->url->link('product/product', $url . '&product_id=' . $this->request->get['product_id'])
);
$this->document->addLink($this->url->link('product/product',
public function review() {
$this->load->language('product/product');
$this->load->model('catalog/review');
$data['text_no_reviews'] = $this->language->get('text_no_reviews');
if (isset($this->request->get['page'])) {
$page = $this->request->get['page'];
} else {
$page = 1;
}
$data['reviews'] = array();
$review_total = $this->model_catalog_review->getTotalReviewsByProductId($this->request->get['product_id']);
$results = $this->model_catalog_review->getReviewsByProductId($this->request->get['product_id'], ($page - 1) * 5, 5);
foreach ($results as $result) {
$data['reviews'][] = array(
'author' => $result['author'],
'text' => nl2br($result['text']),
'rating' => (int)$result['rating'],
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added']))
);
}
$pagination = new Pagination();
$pagination->total = $review_total;
$pagination->page = $page;
$pagination->limit = 5;
$pagination->url = $this->url->link('product/product/review', 'product_id=' . $this->request->get['product_id'] . '&page={page}');
$data['pagination'] = $pagination->render();
$data['results'] = sprintf($this->language->get('text_pagination'), ($review_total) ? (($page - 1) * 5) + 1 : 0, ((($page - 1) * 5) > ($review_total - 5)) ? $review_total : ((($page - 1) * 5) + 5), $review_total, ceil($review_total / 5));
$this->response->setOutput($this->load->view('product/review', $data));
}
if ($route == 'product/product' && isset($this->request->get['product_id'])) {
$this->load->model('catalog/product');
$layout_id = $this->model_catalog_product->getProductLayoutId($this->request->get['product_id']);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question