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

Вывод даты окончания акции


Recommended Posts

Прошу помочь. Вывожу дату окончания акции и ничего не выводится. в чём может быть ошибка? Osstore 2.1.0.2

 

в модели catalog\model\catalog\product.php

public function SpecialEnd($product_id) {
    $query = $this->db->query("SELECT MIN(priority) FROM " . DB_PREFIX . "product_special WHERE product_id ='". $product_id . "' AND customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND ((date_start = '0000-00-00' OR date_start < NOW()) AND (date_end = '0000-00-00' OR date_end > NOW()))");

    return $query->row;
}

 

в контроллере \catalog\controller\product\product.php

$data['data_end_main'] = $this->model_catalog_product->SpecialEnd($this->request->get['product_id']);

 

В product.tpl

<?php echo $data_end_main['date_end']; ?>

 

 

Link to post
Share on other sites

4 minutes ago, nikifalex said:

так вы приоритет выводите а не дату

а как должно быть? пожалуйста, для новичка на пальцах)

Link to post
Share on other sites

public function SpecialEnd($product_id) {
    $query = $this->db->query("SELECT MIN(date_end) FROM " . DB_PREFIX . "product_special WHERE product_id ='". $product_id . "' AND customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND ((date_start = '0000-00-00' OR date_start < NOW()) AND (date_end = '0000-00-00' OR date_end > NOW()))");

    return $query->row['date_end'];
}

хотя бытак для начала

Link to post
Share on other sites
4 minutes ago, nikifalex said:

public function SpecialEnd($product_id) {
    $query = $this->db->query("SELECT MIN(date_end) FROM " . DB_PREFIX . "product_special WHERE product_id ='". $product_id . "' AND customer_group_id = '" . (int)$this->config->get('config_customer_group_id') . "' AND ((date_start = '0000-00-00' OR date_start < NOW()) AND (date_end = '0000-00-00' OR date_end > NOW()))");

    return $query->row['date_end'];
}

хотя бытак для начала

Теперь вообще ничего не выводит. Раньше выводил Array

Link to post
Share on other sites

40 минут назад, mihailgoryachev сказал:

и ничего не выводится

 

4 минуты назад, mihailgoryachev сказал:

Раньше выводил Array

 

вы сами себе противоречите

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • 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.