Jump to content

How to obtain Vat number and group_id in order page


Recommended Posts

Hi everybody,

 

I'm trying to modify my order-address.tpl (in my prestashop v. 1.5.5) becouse I woult to show the user VAT number and other informations that depends from the group, so, I need the id_group too.

After some hours of work, I can say that I have no idea about how to solve this.

Somebody can help me?

 

Thank's in advance.

Link to comment
Share on other sites

  • 2 weeks later...

I don't know if someone is interested in this solution for make some DB data always available in a simple array, but I solved this making a new little and simple module hooked in header. This is the main method:

        public function hookHeader()
        {
                global $smarty;
                $context = Context::getContext();
                $id_lang = $context->cart->id_lang;
                $customer = $context->customer;
                $id_customer = $customer->id;
				
				$partitaiva = Db::getInstance()->executeS("SELECT " ._DB_PREFIX_. "customer.piva 
				FROM " ._DB_PREFIX_. "customer                                
                                WHERE " ._DB_PREFIX_. "customer.id_customer = '$id_customer'");
                if(!isset($partitaiva[0])) $partitaiva = FALSE;
                $smarty->assign('piva', $partitaiva);
        }

'piva' is a custom field in our DB, but this can be used for each field.

Link to comment
Share on other sites

×
×
  • Create New...