Search found 303 matches

Search found 303 matches

Re: Is the database connection available in a system variable?

I'll mind my tone if you mind yours, ok? You started this, I never said anything rude to you. Anyway, I have zero interest in helping you anymore. Use Google. You are correct. I should not have called you a jerk, so I do apologize for that. I should have said "Please try to be more polite when tryi...

Jump to post
  • Sat May 09, 2020 12:47 am
  • Replies 8
  • Views 166
Re: Is the database connection available in a system variable?

thekrotek wrote:
Sat May 09, 2020 12:22 am
Mind your tone. I did try to help you and you called me a jerk in return. If you keep calling other people jerks you won't find much help (if any). Good luck in solving this issue by yourself.
I'll mind my tone if you mind yours, ok?

Jump to post
  • Sat May 09, 2020 12:38 am
  • Replies 8
  • Views 166
Re: Is the database connection available in a system variable?

If it doesn't exist, you create it. If key doesn't exist, you need to add a key. If record doesn't exist, you add a record. These are 3 different operations, which you do with different queries, not only when table doesn't exist. Short version: you're doing it wrong. Yeah, I already knew there was ...

Jump to post
  • Sat May 09, 2020 12:12 am
  • Replies 8
  • Views 166
Re: Is the database connection available in a system variable?

Use "CREATE TABLE IS EXISTS" instead and loose the first query. That won't suffice in this situation. If the table does not exist, I not only need to create it, but i need to add a primary key and INSERT some records. I think there is a way to add the primary key in the CREATE TABLE statement, with...

Jump to post
  • Sat May 09, 2020 12:02 am
  • Replies 8
  • Views 166
Is the database connection available in a system variable?

OpenCart 3.0.2.0. Hello all, I have added the following mod to my /admin/controller/sale/order.php file to add a table to the database if it does not already exist: $order_shipment_query = $this->db->query("SELECT 1 from `bt_order_shipment` LIMIT 1"); if (mysqli_errno() == 1146) { // Table does not ...

Jump to post
  • Fri May 08, 2020 11:36 pm
  • Replies 8
  • Views 166
Re: Module Development Question - Models and DB Tables.

Just add install() and uninstall() functions to your controller and make them public, that's all. Do everything you like with database inside these functions. Can you please provide an example Controller file (OpenCart 3.x), showing installation/uninstallation of database tables? And where does thi...

Jump to post
  • Wed May 06, 2020 11:38 pm
  • Replies 9
  • Views 1919
[SOLVED] Re: How to add data from different table to getOrders() query result?

Hello all, I have what is already a complicated query, in the getOrders() function of admin/model/sale/order.php: public function getOrders($data = array()) { $sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os....

Jump to post
  • Wed May 06, 2020 9:56 am
  • Replies 1
  • Views 81
[SOLVED] - How to add data from different table to getOrders() query result?

Hello all, I have what is already a complicated query, in the getOrders() function of admin/model/sale/order.php: public function getOrders($data = array()) { $sql = "SELECT o.order_id, CONCAT(o.firstname, ' ', o.lastname) AS customer, (SELECT os.name FROM " . DB_PREFIX . "order_status os WHERE os.o...

Jump to post
  • Wed May 06, 2020 8:10 am
  • Replies 1
  • Views 81
Re: Need another set of eyes on a MySQL INSERT statement

As mentioned you are trying to parse NOW() as a PHP variable. Below should work for you. public function updateCarrier( $order_id, $carrier ) { $this->db->query( "INSERT INTO `bt_order_shipment` (order_id, date_added, shipping_carrier_id) VALUES(" . (int) $order_id . ",NOW(), " . (int) $carrier . "...

Jump to post
  • Tue May 05, 2020 2:42 pm
  • Replies 4
  • Views 222
[SOLVED] - Need another set of eyes on a MySQL INSERT statement

OpenCart 3.0.2.0. I have a table defined like this: DROP TABLE IF EXISTS `bt_order_shipment`; CREATE TABLE `bt_order_shipment` ( `order_id` int(11) NOT NULL, `date_added` datetime NOT NULL, `shipping_carrier_id` int(11) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; ALTER TABLE `bt_order_shipment` A...

Jump to post
  • Tue May 05, 2020 1:10 pm
  • Replies 4
  • Views 222
Re: Extension not modifying .twig files

letxobnav wrote:
Thu Apr 30, 2020 10:40 pm
Again, the "</tbody> tag is not unique, so I cannot use an "<add position="before">" tag.
you could use index.
Could you please elaborate?

Jump to post
  • Fri May 01, 2020 2:51 am
  • Replies 11
  • Views 350
Extension not modifying .twig files

Hello, I am trying to learn more about extensions, and how the Extension Installer works. Here is a snippet of an install.xml file that is supposed to add some lines of code to admin/view/template/sale/order_info.twig: <file path="admin/view/template/sale/order_info.twig"> <operation error="skip"> <...

Jump to post
  • Thu Apr 30, 2020 8:57 pm
  • Replies 11
  • Views 350
Re: OpenCart 3.0.2.0: How to convert .tpl snippet to .twig snippet?

Then, according to your posted controller codes, it should either be: {% if tracking %} {{ tracking }} {% endif %} or in the foreach statement: {% if order.tracking %} {{ order.tracking }} {% endif %} Then, to follow this FAQ: https://forum.opencart.com/viewtopic.php?f=134&t=215776#p718325 . {{ tra...

Jump to post
  • Wed Apr 29, 2020 8:38 am
  • Replies 8
  • Views 189
Re: OpenCart 3.0.2.0: How to convert .tpl snippet to .twig snippet?

Then, according to your posted controller codes, it should either be: {% if tracking %} {{ tracking }} {% endif %} or in the foreach statement: {% if order.tracking %} {{ order.tracking }} {% endif %} Then, to follow this FAQ: https://forum.opencart.com/viewtopic.php?f=134&t=215776#p718325 . {{ tra...

Jump to post
  • Wed Apr 29, 2020 8:29 am
  • Replies 8
  • Views 189
Re: OpenCart 3.0.2.0: How to convert .tpl snippet to .twig snippet?

The tracking_number must be called from the admin/controller/sale/order.php file. If it's already called, please provide the codes from that controller as well. Yes, I know. I've already made the changes to the admin/contrller/sale/order.php file. If you need that information to answer my question,...

Jump to post
  • Wed Apr 29, 2020 8:14 am
  • Replies 8
  • Views 189
OpenCart 3.0.2.0: How to convert .tpl snippet to .twig snippet?

Hello all, In my previous 2.3.0.2 store, added a link with the order tracking number to the Admin panel's order information screen. Here was the snippet of code I added to the /store/admin/view/template/sale/order_info.tpl file: <tr> <td><button data-toggle="tooltip" title="<?php echo $text_tracking...

Jump to post
  • Wed Apr 29, 2020 7:18 am
  • Replies 8
  • Views 189
Re: Recent Activity area in Dashboard not updating

You just don't seem to be able to grasp the simple concept that someone trying to figure out that message is not going to know there is anything in the FAQ about it, or necessarily even KNOW that there IS a FAQ. That is because people don't take the time to read what's on top of the forum when ente...

Jump to post
  • Sat Apr 25, 2020 1:45 am
  • Replies 24
  • Views 3157
Re: Recent Activity area in Dashboard not updating

Which is why, the very first post of the FAQ topic indicates the fact on this. Only use the automated move out if you have a dedicated server. Otherwise, this modal window becomes a decoration due to the chance of succession on moving this storage folder outside its public_html folder without crash...

Jump to post
  • Fri Apr 24, 2020 12:04 pm
  • Replies 24
  • Views 3157
Re: Recent Activity area in Dashboard not updating

When I upgraded to 3.0.2.0, I found the popup message in the Admin panel confusing, the message that says to "move your storage folder outside the system folder (i.e., public_html)". That could be interpreted this way: "Move your storage file under the /public_html folder". The /public_html folder ...

Jump to post
  • Fri Apr 24, 2020 5:44 am
  • Replies 24
  • Views 3157
Re: Recent Activity area in Dashboard not updating

I thought the storage folder needed to be located outside (above) the /store folder, but you are saying that the storage folder needs to be up even further, like above the /public_html folder? This is exactly what the FAQ instructs; to move the storage folder outside of the public_html folder. Ok, ...

Jump to post
  • Fri Apr 24, 2020 5:34 am
  • Replies 24
  • Views 3157

Search found 303 matches