Hello!
I'm trying to create a query using DbQuery() and it seems that this class automatically sets the table prefix 'ps_' or whichever you have so you don't have to set it. For example:
$query = new DbQuery();
$query->select('
whatever
');
$query->from('product', 'p');
$query->innerJoin('product_lang', 'pl', 'pl.id_product = p.id_product');
$query->innerJoin('category_product', 'cp', 'cp.id_product = p.id_product');
As you can see, you don't need to write $query->from('ps_product', 'p'); It knows already the prefix to the tables.
My problem is that I am trying to make a Left Join to a table I created with a different prefix, or not using the preset prefix at all. Having done that maybe a mistake, I don't know, but usually, the tables I create in my Prestashop database, have a different prefix to indicate to myself those are my tables.
I know that there is something like '$addprefix = false' for DbQuery() but I can't find the documentation about it and where to set that false, and how to write the code about the table then. I am sure this has an easy solution. I have tried something like this:
$query->leftJoin('frik_location', 'fl', 'fl.id_product = p.id_product AND fl.id_product_attribute = IFNULL(pa.id_product_attribute, 0)' , false);
With that false at the end, but it does not work.
So my table is called fik_location instead of ps_location (if i were to use the default prefix), anyone could help me with this?
Thanks a lot in advance!