Post by tedbg » Thu Oct 27, 2016 6:10 pm

I manage to add additional fields in the opencart database - product table , admin template, controller, model and language files. I have basic mysql and php skills. Opencart version is 2.1.0.2



Edited files are -

1) product.php in admin/controller/catalog
2) product_form.tpl file locate admin/view/template/catalog/ -
3) product.php in admin/language/english/catalog/
4) database queries in admin/model/catalog/product.php

Then i manage to show them in front end in product view thanks to this article - viewtopic.php?t=36625 . I'm struggling to show them in the category view. I'm not sure how to get information from the database and show it in category view.

I think that i must add the database query in the : category.php in /catalog/model/catalog somewhere in the function getCategory($category_id) but not sure how exactly to do this. My additional database fields are called : ['ustoichivosti'] , ['vegetacia'] , ['razmeri'] and are situated in the product table.

This is the function :

Code: Select all

$query = $this->db->query("SELECT DISTINCT * FROM " . DB_PREFIX . "category c LEFT JOIN " . DB_PREFIX . "category_description cd ON (c.category_id = cd.category_id) LEFT JOIN " . DB_PREFIX . "category_to_store c2s ON (c.category_id = c2s.category_id) WHERE c.category_id = '" . (int)$category_id . "' AND cd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND c2s.store_id = '" . (int)$this->config->get('config_store_id') . "' AND c.status = '1'"); return $query->row;
Last edited by tedbg on Sun Oct 30, 2016 2:50 pm, edited 1 time in total.

Newbie

Posts

Joined
Fri May 29, 2015 8:44 pm

Post by IP_CAM » Fri Oct 28, 2016 4:31 am

sorry to tell you, but your Custom Themed Site new.semenata.com looks like a rather poor mix of different languages, even in the english section, therefore, trying to assist could easy continue in an endless task, without producing any usable results. I therefore assume, that nobody will be eager to assist on such, or then, not just for the plain fun of it. But don't take it personally, I just replied, so you don't get the feeling, that nobody cares...
Good Luck ;)
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by tedbg » Fri Oct 28, 2016 2:29 pm

Thank you, you are right !
I revert custom theme and try to translate as much as possible blocks so not looks strange.
All help and tips will be appreciated.
Is it possible to get paid support on such customization or it is too small task ?

Newbie

Posts

Joined
Fri May 29, 2015 8:44 pm

Post by IP_CAM » Fri Oct 28, 2016 6:56 pm

well, I guess, someone will be reading this, and you will possibly receive some Personal Mails. BUT, just make sure, NOT to ACT on unknown persons, offering assistance, there are many screwballs around here, hiding behind trees, and waiting, to get access to others Sites, to possibly just download their paid Extensions and themes. Therefore, only trust persons, known around here, when it comes to such!
Good Luck ;)
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by tedbg » Fri Oct 28, 2016 10:51 pm

Thank you Ernie for your tips and response.

Newbie

Posts

Joined
Fri May 29, 2015 8:44 pm

Post by agatha65 » Sun Oct 30, 2016 2:12 pm

Нека го обясня на български.
Не е нужно да се добавят нови полета за продукта.
Почетете тук: http://docs.opencart.com/
за атрибути и филтри.
Има 2 възможни варианта за реализация. Тези детайли за продуктите да се добавят като филтри и и да се ползват на страницата на категориите.
Или(това, което искате всъщност) да се напише допълнение, което да добавя атрибутите на продукта когато се показва на страницата категория.
Също така вместо атрибути може да се използват и ненужните полета във формата на продукта в админа(MPN, JAN, EAN..). Тогава трябва да се променят размерите на тези полета в базата данни и да се добавят в контролера и вюто за продукта, както и езиковите файлове.

Suppliers Module - XML, CSV, XLS Product Feed Import and Update
Rich Snippets | Facebook Open Graph Meta Tags | WebP Images
Image


User avatar
Active Member

Posts

Joined
Fri Mar 16, 2012 10:18 am
Location - Canada, QC

Post by tedbg » Sun Oct 30, 2016 2:33 pm

Здравейте, благодаря за отговора. Ще разгледам информацията. Мисля че MPN, JAN, EAN полетата не ми вършат работа защото не се показват в категорията.

I think i find answer so i will remove website links because website goes in to maintenance mode. Thanks all for the answers.

I found paid extension that shows such info.

Newbie

Posts

Joined
Fri May 29, 2015 8:44 pm
Who is online

Users browsing this forum: No registered users and 20 guests