Post by juancho3000 » Fri Feb 06, 2015 12:44 am

hola a todos, tengo una duda a ver si me puede ayudar alguien.
Tengo una lista enorme de categorias, con su SEO correspondiente, el caso es que me ha duplicado algun SEO por ahi y entre tantas no consigo verlo y habia pensado en el catalogo->categorias mostrar las palabras SEO que corresponde con esa categoria pero no consigo hacerlo, sé que el archivo está en admin/view/template/catalog/category_list.tpl, en el código:

Code: Select all

              <td class="left"><?php echo $category['name']; ?></td>

              <td class="right"><?php echo $category['sort_order']; ?></td>

              <td class="right"><?php foreach ($category['action'] as $action) { ?>
el cual he añadido:

Code: Select all

              <td class="left"><?php echo $category['name']." ".$category['keyword']; ?></td>

              <td class="right"><?php echo $category['sort_order']; ?></td>

              <td class="right"><?php foreach ($category['action'] as $action) { ?>
Pero no me ha funcionado ¿alguna idea?
Last edited by juancho3000 on Sat Feb 07, 2015 7:53 pm, edited 1 time in total.

New member

Posts

Joined
Wed Aug 31, 2011 1:40 am

Post by CoverUp » Fri Feb 06, 2015 1:12 am

Ahora debes modificar
admin/controller/catalog/category.php

EN 1.5.x
=======
reemplazar esto

Code: Select all

		foreach ($results as $result) {
			$action = array();

			$action[] = array(
				'text' => $this->language->get('text_edit'),
				'href' => $this->url->link('catalog/category/update', 'token=' . $this->session->data['token'] . '&category_id=' . $result['category_id'] . $url, 'SSL')
			);

			$this->data['categories'][] = array(
				'category_id' => $result['category_id'],
				'name'        => $result['name'],
				'sort_order'  => $result['sort_order'],
				'selected'    => isset($this->request->post['selected']) && in_array($result['category_id'], $this->request->post['selected']),
				'action'      => $action
			);
		}
por esto

Code: Select all

		foreach ($results as $result) {
			$action = array();

			$action[] = array(
				'text' => $this->language->get('text_edit'),
				'href' => $this->url->link('catalog/category/update', 'token=' . $this->session->data['token'] . '&category_id=' . $result['category_id'] . $url, 'SSL')
			);

			$this->data['categories'][] = array(
				'category_id' => $result['category_id'],
				'name'        => $result['name'],
				'sort_order'  => $result['sort_order'],
				'keyword' => $result['keyword'],
				'selected'    => isset($this->request->post['selected']) && in_array($result['category_id'], $this->request->post['selected']),
				'action'      => $action
			);
		}

EN OC 2.0.x
==========
Reemplazar esto

Code: Select all

		foreach ($results as $result) {
			$data['categories'][] = array(
				'category_id' => $result['category_id'],
				'name'        => $result['name'],
				'sort_order'  => $result['sort_order'],
				'edit'        => $this->url->link('catalog/category/edit', 'token=' . $this->session->data['token'] . '&category_id=' . $result['category_id'] . $url, 'SSL'),
				'delete'      => $this->url->link('catalog/category/delete', 'token=' . $this->session->data['token'] . '&category_id=' . $result['category_id'] . $url, 'SSL')
			);
		}
por esto

Code: Select all

		foreach ($results as $result) {
			$data['categories'][] = array(
				'category_id' => $result['category_id'],
				'name'        => $result['name'],
				'sort_order'  => $result['sort_order'],
				'keyword' => $result['keyword'],
				'edit'        => $this->url->link('catalog/category/edit', 'token=' . $this->session->data['token'] . '&category_id=' . $result['category_id'] . $url, 'SSL'),
				'delete'      => $this->url->link('catalog/category/delete', 'token=' . $this->session->data['token'] . '&category_id=' . $result['category_id'] . $url, 'SSL')
			);
		}
y listo

Desarrollador OpenCart: Chilexpress, Correos de Chile, Tur-Bus, Pullman Bus, Starken, WebPay Plus, Servipag y otros a pedido. Todos los trabajos estan garantizados y con factura electrónica.


Active Member

Posts

Joined
Tue Oct 21, 2014 12:22 am

Post by juancho3000 » Fri Feb 06, 2015 1:24 am

gracias por contestar, tengo la 1.5.6.4 pero me sale este mensaje:
Notice: Undefined index: keyword in /public_html/admin/controller/catalog/category.php on line 321

New member

Posts

Joined
Wed Aug 31, 2011 1:40 am

Post by CoverUp » Fri Feb 06, 2015 1:52 am

en OC 1.5.x la modificación se hace por la línea 157

Desarrollador OpenCart: Chilexpress, Correos de Chile, Tur-Bus, Pullman Bus, Starken, WebPay Plus, Servipag y otros a pedido. Todos los trabajos estan garantizados y con factura electrónica.


Active Member

Posts

Joined
Tue Oct 21, 2014 12:22 am

Post by juancho3000 » Fri Feb 06, 2015 2:01 am

ya me imagino pero en mi archivo esta separada cada linea unas de otras, no salen juntas, es como si al escribir una linea se pulsase 2 veces enter, si se divide 321/2 sale mas o menos 160, el caso es que el archivo funciona bien, si hubiese algún problema ya habría notado algo y todo funciona bien.
la linea 321 es ésta

Code: Select all

'keyword'     => $result['keyword'],

New member

Posts

Joined
Wed Aug 31, 2011 1:40 am

Post by CoverUp » Fri Feb 06, 2015 5:27 am

ok

Entonces reemplaza el actual código

Code: Select all

  foreach ($results as $result) {
         $action = array();

         $action[] = array(
            'text' => $this->language->get('text_edit'),
            'href' => $this->url->link('catalog/category/update', 'token=' . $this->session->data['token'] . '&category_id=' . $result['category_id'] . $url, 'SSL')
         );

         $this->data['categories'][] = array(
            'category_id' => $result['category_id'],
            'name'        => $result['name'],
            'sort_order'  => $result['sort_order'],
            'keyword' => $result['keyword'],
            'selected'    => isset($this->request->post['selected']) && in_array($result['category_id'], $this->request->post['selected']),
            'action'      => $action
         );
      }

Por este

Code: Select all

	foreach ($results as $result) {
			$action = array();

			$action[] = array(
				'text' => $this->language->get('text_edit'),
				'href' => $this->url->link('catalog/category/update', 'token=' . $this->session->data['token'] . '&category_id=' . $result['category_id'] . $url, 'SSL')
			);
			$query = $this->model_catalog_category->getCategory($result['category_id']);

			$this->data['categories'][] = array(
				'category_id' => $result['category_id'],
				'name'        => $result['name'],
				'sort_order'  => $result['sort_order'],
				'keyword' => $query['keyword'],
				'selected'    => isset($this->request->post['selected']) && in_array($result['category_id'], $this->request->post['selected']),
				'action'      => $action
			);
		}
Y ahora si funcionará

Desarrollador OpenCart: Chilexpress, Correos de Chile, Tur-Bus, Pullman Bus, Starken, WebPay Plus, Servipag y otros a pedido. Todos los trabajos estan garantizados y con factura electrónica.


Active Member

Posts

Joined
Tue Oct 21, 2014 12:22 am

Post by juancho3000 » Sat Feb 07, 2015 7:52 pm

nada, no funciona, pero muchas gracias por el aporte, al final lo que hice fue poner el seo que se duplica en la url y ver cual era el que estaba repitiendo, eran algunos productos y no categorías como yo creía.
muchas gracias por vuestro tiempo

New member

Posts

Joined
Wed Aug 31, 2011 1:40 am

Post by CoverUp » Sun Feb 08, 2015 1:20 am

Ok, en todo caso el código que te proporcioné SI funciona ya que lo probé en mi tienda.
Slds.

Desarrollador OpenCart: Chilexpress, Correos de Chile, Tur-Bus, Pullman Bus, Starken, WebPay Plus, Servipag y otros a pedido. Todos los trabajos estan garantizados y con factura electrónica.


Active Member

Posts

Joined
Tue Oct 21, 2014 12:22 am
Who is online

Users browsing this forum: No registered users and 32 guests