Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenCart adding "informational" field in admin
    primarykey
    data
    text
    <p>I am looking for a way to add a field in the admin for my information pages. I just need it in the admin and not looking to show any data from the field on front end.</p> <p>To explain better the list page for my information pages is set up like this:</p> <pre><code>Information Title | Sort Order | Action </code></pre> <p>I want to add an identifying blurb that will display before the title in admin so at a glance I can look and see which store (I'm running multi-store) that info page is assigned to. I'm guessing the actual field would need to be added to the add/edit form and then somehow told to display that field input on the list page.</p> <p>I do have vQmod installed and have looked at the documentation but I just can't wrap my head around this.</p> <p>I would REALLY appreciate any help on this.</p> <p>Here's the code from information.php.</p> <pre><code>&lt;?php class ModelCatalogInformation extends Model { public function getInformation($information_id) { $query = $this-&gt;db-&gt;query("SELECT DISTINCT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE i.information_id = '" . (int)$information_id . "' AND id.language_id = '" . (int)$this-&gt;config-&gt;get('config_language_id') . "' AND i2s.store_id = '" . (int)$this-&gt;config-&gt;get('config_store_id') . "' AND i.status = '1'"); //return $query-&gt;row; $r = $query-&gt;row; $r['title'] = preg_replace('/ ## .+/','',$r['title']); return $r; } public function getInformations() { $query = $this-&gt;db-&gt;query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE id.language_id = '" . (int)$this-&gt;config-&gt;get('config_language_id') . "' AND i2s.store_id = '" . (int)$this-&gt;config-&gt;get('config_store_id') . "' AND i.status = '1' ORDER BY i.sort_order, LCASE(id.title) ASC"); //return $query-&gt;rows; $result = $query-&gt;rows; foreach ($result as $key =&gt; $r){ $result[$key] = preg_replace('/ ## .+/','',$r['title']); } return $result; } public function getInformationLayoutId($information_id) { $query = $this-&gt;db-&gt;query("SELECT * FROM " . DB_PREFIX . "information_to_layout WHERE information_id = '" . (int)$information_id . "' AND store_id = '" . (int)$this-&gt;config-&gt;get('config_store_id') . "'"); if ($query-&gt;num_rows) { return $query-&gt;row['layout_id']; } else { return $this-&gt;config-&gt;get('config_layout_information'); } } } ?&gt; </code></pre> <p>When you mentioned checking the vQmod cache it dawned on me that I'm using a mod that hides info pages from the menu by using -1 sort order. Here's the information.php from the cache folder.</p> <pre><code>&lt;?php class ModelCatalogInformation extends Model { public function getInformation($information_id) { $query = $this-&gt;db-&gt;query("SELECT DISTINCT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE i.information_id = '" . (int)$information_id . "' AND id.language_id = '" . (int)$this-&gt;config-&gt;get('config_language_id') . "' AND i2s.store_id = '" . (int)$this-&gt;config-&gt;get('config_store_id') . "' AND i.status = '1'"); return $query-&gt;row; } public function getInformations() { $query = $this-&gt;db-&gt;query("SELECT * FROM " . DB_PREFIX . "information i LEFT JOIN " . DB_PREFIX . "information_description id ON (i.information_id = id.information_id) LEFT JOIN " . DB_PREFIX . "information_to_store i2s ON (i.information_id = i2s.information_id) WHERE id.language_id = '" . (int)$this-&gt;config-&gt;get('config_language_id') . "' AND i2s.store_id = '" . (int)$this-&gt;config-&gt;get('config_store_id') . "' AND i.status = '1' AND i.sort_order &lt;&gt; '-1' ORDER BY i.sort_order, LCASE(id.title) ASC"); return $query-&gt;rows; } public function getInformationLayoutId($information_id) { $query = $this-&gt;db-&gt;query("SELECT * FROM " . DB_PREFIX . "information_to_layout WHERE information_id = '" . (int)$information_id . "' AND store_id = '" . (int)$this-&gt;config-&gt;get('config_store_id') . "'"); if ($query-&gt;num_rows) { return $query-&gt;row['layout_id']; } else { return $this-&gt;config-&gt;get('config_layout_information'); } } } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload