without a great deal of documentation, it's hard to code for opencart, but mostly easy to understand...
how do we logicly get datas that we need if there is no modules with the code getting that datas...
i need a zone code.
when a zone is setup, we enter a zone code, there is 2 iso codes for country (Canada -> iso_code2 = CA, iso_code3 => CAD) and 1 code for a zone (Quebec => QC)
HOW do we get thoses codes within a checkout?
I'm developping a paiement module for InternetSecure, they accept address data, but need Country Codes and Zonde code to work... frankly i'm at a lost on this one!
what you need is shown in \catalog\controller\checkout_confirm.php as follows
and \library\cart\address.php
Code: Select all
$order->set('shipping_firstname', $address->getFirstName($session->get('shipping_address_id')));
$order->set('shipping_lastname', $address->getLastName($session->get('shipping_address_id')));
$order->set('shipping_company', $address->getCompany($session->get('shipping_address_id')));
$order->set('shipping_address_1', $address->getAddress1($session->get('shipping_address_id')));
$order->set('shipping_address_2', $address->getAddress2($session->get('shipping_address_id')));
$order->set('shipping_city', $address->getCity($session->get('shipping_address_id')));
$order->set('shipping_postcode', $address->getPostCode($session->get('shipping_address_id')));
$order->set('shipping_zone', $address->getZone($session->get('shipping_address_id')));
$order->set('shipping_country', $address->getCountry($session->get('shipping_address_id')));
$order->set('shipping_address_format', $address->getFormat($session->get('shipping_address_id')));
Thanks, but it wasn't working.
so i've access this data this way :
$this->address->data[$this->address->customer->data['customer_id']]['iso_code_2']
it's working, but i think it now the real good way to do it.. hehehe
so i've access this data this way :
$this->address->data[$this->address->customer->data['customer_id']]['iso_code_2']
it's working, but i think it now the real good way to do it.. hehehe
you mean this code ? :
it's in my payment method's fields() fonction.
Code: Select all
$ouput .= '<input type="hidden" name="xxxCompany" value="' . trim($this->order->get('payment_company')) . ' ' . $this->order->get('lastname') . '" />' . "\n";
$ouput .= '<input type="hidden" name="xxxAddress" value="' . trim($this->order->get('payment_address_1')) . ' ' . trim($this->order->get('payment_address_2')) . '" />' . "\n";
$ouput .= '<input type="hidden" name="xxxCity" value="' . trim($this->order->get('payment_city')) . '" />' . "\n";
$ouput .= '<input type="hidden" name="xxxProvince" value="' . $this->address->data[$this->address->customer->data['customer_id']]['code'] . '" />' . "\n";
$ouput .= '<input type="hidden" name="xxxPostal" value="' . trim($this->order->get('payment_postcode')) . '" />' . "\n";
$ouput .= '<input type="hidden" name="xxxCountry" value="' . $this->address->data[$this->address->customer->data['customer_id']]['iso_code_2'] . '" />' . "\n";
$ouput .= '<input type="hidden" name="xxxEmail" value="' . trim($this->order->get('email')) . '" />' . "\n";
$ouput .= '<input type="hidden" name="xxxVar1" value="' . $this->order->getReference() . '" />' . "\n";
Last edited by X-Rayden on Mon Mar 17, 2008 5:26 pm, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 2 guests