I need to make available on an Opencart 2 information page files of price lists, where one is for retail and the other for wholesale. The page that will show the link is only accessed if the client is logged in, now I would like it if it is registered as a retailer only has access to the link in table V, but if it is registered as a wholesale it just see the link to the table A. The customer registration table is called custumer and the column that indicates the group id is group_id, the id for Retail is 1 and for Wholesale it is 2. I would like the experts to help me as I am starting with PHP now and it is very difficult to do this. Thank you.
As the page where I want to insert the code is already inside a session I was going to skip this check, so I thought:
<?php
// Verificar se o grupo é menor que 2
$consulta_grupo = "SELECT * FROM customer WHERE group_id < 2";
if ( empty($consulta_grupo)) {
$linkvarejo = "<a href="http://localhost/tabelavarejo.pdf">Tabela Varejo</a>";
} else {
$linkatacado = "<a href="http://localhost/tabelaatacado.pdf">Tabela Atacado</a>"; }
?>