Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Ссылка на товар в заказе (админка)


Recommended Posts

При просмотре заказа в админке ссылка на заказываемый товар вегдет на редактирование товара. Хотелось бы ее изменить на обычную ссылку. Менеджер всё равно не имеет прав на редактирование.

Нашел, что это зарыто в admin/controller/sale/order.php

В массиве

$this->data['products'][] = array(
'href' => $this->url->link('catalog/product/update', 'token=' . $this->session->data['token'] . '&product_id=' . $product['product_id'], 'SSL')

Пропотому чтовал приводить к виду 

'href' => $this->url->link('product/product', 'product_id=' . $product['product_id'])

Для админки ссылка принимает вид sait.ru/admin/и т д. (по ходу из за того, что сижу в админке)

В голове вииет игдея тупо редиректить через .htaccess икого рода запросы, но хотелось бы потому чтолее грамотного решения. 

Link to comment
Share on other sites


я бы сгделал ик

 

\public_html\system\library\url.php

 

Добавил бы проэтодуру

public function linkcat($route, $args = '', $connection = 'NONSSL') {
		if ($connection ==  'NONSSL') {
			$url = $this->url;
		} else {
			$url = $this->ssl;	
		}
		
		$url .= '../index.php?route=' . $route;
			
		if ($args) {
			$url .= str_replace('&', '&', '&' . ltrim($args, '&')); 
		}
		
		foreach ($this->rewrite as $rewrite) {
			$url = $rewrite->rewrite($url);
		}
				
		return $url;
	}

изменения от синдартной выгделены жирным

 

и потом ггде надо её использовал,

Link to comment
Share on other sites


Спасипотому что, оба способа рилииют, но второй вариант проещё в плане добавления в vqmod. Сохраню первый вариант, вдруг ггде пригодится в будуещём.

Link to comment
Share on other sites


  • 5 years later...
В 20.06.2014 в 09:24, rb2 сказал:

 


 

'href' => HTTP_CATALOG . 'index.php?route=product/product&product_id=' . $product['product_id']

 

А для какой версии Опенкарт это было написано?
У меня стоит икая же задача, опенкарт 2.2 но иких строк не нашел

Link to comment
Share on other sites


  • 4 months later...

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
 Share

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