R
R
Radiss2019-07-04 00:36:57
opencart
Radiss, 2019-07-04 00:36:57

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

spoiler
$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));
  }

product card template product.tpl (catalog\view\theme\site\template)
123
content_top (catalog\controller\common)
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']);

Maybe it's because the site doesn't have ssl installed?
In console errors
index.php?route=common/home:1 GET x95345lc.site.tech/index.php?route=common/home 500 (Internal Server Error)
macbook:1 GET x95345lc.site.tech/macbook 404 (Not Found)
2index.php?route=common/home:1 GET x95345lc.site.tech/index.php?route=common/home 500 (Internal Server Error)
2macbook:1 GET x95345lc.site.tech/macbook 404 (Not Found )
product.tpl:1 GET x95345lc.site.tech/product.tpl 404 (Not Found)
3macbook:1 GET x95345lc.site.tech/macbook 404 (Not Found)
2macbook:1 Unchecked runtime.lastError: The message port closed before a response was received.
canon-eos-5d:1 GET x95345lc.site.tech/canon-eos-5d 404 (Not Found)
hp-lp3065:1 GET x95345lc.site.tech/hp-lp3065 404 (Not Found)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Moloko, 2019-07-04
@whillson

Configs ruled during the transfer?

Z
zoozag, 2019-07-04
@zoozag

.htaccess renamed?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question