/** * Gets a user's geozone * @param int $userid * @return unknown_type */ public static function getGeoZones($userid) { Tienda::load('TiendaHelperShipping', 'helpers.shipping'); $address = TiendaHelperUser::getPrimaryAddress($userid, 'billing'); if (empty($address->zone_id)) { return array(); } $geozones = TiendaHelperShipping::getGeoZones($address->zone_id, '1', $address->postal_code); return $geozones; }
/** * Prepares vars for the recurring prepayment * * @param object vars * @return object vars */ function prepareSecondVars($order, $orderpayment) { $vars = new JObject(); $vars->action_url = $this->_getActionUrl(); // properties as specified in moneybookers gateway manual $vars->pay_to_email = $this->_getParam('receiver_email'); $vars->transaction_id = Tienda::getInstance()->get('order_number_prefix') . $orderpayment->orderpayment_id; // this need to be subscription id?? $vars->return_url = JURI::root() . "index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type={$this->_element}&paction=message&checkout=0"; $vars->return_url_text = 'Exit Secure Payment'; //A $vars->cancel_url = JURI::root() . "index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type={$this->_element}&paction=cancel"; $vars->status_url = JURI::root() . "index.php?option=com_tienda&view=checkout&task=confirmPayment&orderpayment_type={$this->_element}&paction=process&tmpl=component"; $vars->status_url2 = 'mailto:bojan.programer@gmail.com'; $vars->language = $this->_getParam('language', 'EN'); $vars->confirmation_note = JText::_('TIENDA MONEYBOOKERS CONFIRMATION NOTE'); $vars->logo_url = JURI::root() . $this->_getParam('logo_image'); $vars->currency = $this->_getParam('currency', 'EUR'); $vars->detail1_description = $order->order_id; $vars->detail1_text = JText::_('TIENDA MONEYBOOKERS DETAIL1 DESCRIPTION'); $vars->detail2_description = $orderpayment->orderpayment_id; $vars->detail2_text = JText::_('TIENDA MONEYBOOKERS DETAIL2 DESCRIPTION'); //pay from email + All Customer Details to prefill MoneyBookers form //MD5 and other comparison $vars->user_id = JFactory::getUser()->id; $vars->order_id = $order->order_id; $vars->orderpayment_id = $orderpayment->orderpayment_id; $vars->orderpayment_type = $this->_element; $vars->is_recurring = $order->isRecurring(); $vars->mixed_cart = false; $billing_address = TiendaHelperUser::getPrimaryAddress($vars->user_id, 'billing'); $vars->first_name = $billing_address->first_name; $vars->last_name = $billing_address->last_name; $vars->phone_number = $billing_address->phone1; $vars->email = JFactory::getUser()->email; $vars->address = $billing_address->address_1; $vars->postal_code = $billing_address->postal_code; $vars->city = $billing_address->city; $vars->country = $billing_address->country; $vars->state = $billing_address->zone_name; $vars->rec_amount = $order->recurring_trial ? $order->recurring_trial_price : $order->order_total; $vars->rec_start_date = ''; $vars->rec_period = $order->recurring_trial ? $order->recurring_trial_period_interval : $order->recurring_period_interval; $vars->rec_cycle = $this->_getDurationUnit($order->recurring_trial ? $order->recurring_trial_period_unit : $order->recurring_period_unit); // (day | week | month) // a period of days during which the customer can still process the transaction in case it originally failed. $vars->rec_grace_period = 3; $vars->transaction_id = Tienda::getInstance()->get('order_number_prefix') . $orderpayment->orderpayment_id; // this need to be subscription id?? return $vars; }
"> <?php echo JText::_('COM_TIENDA_EDIT'); ?> </a> </td> </tr> <tr> <th style="width: 100px;"> <?php echo JText::_('COM_TIENDA_PRIMARY_BILLING_ADDRESS'); ?> </th> <td> <?php if ($address = TiendaHelperUser::getPrimaryAddress(JFactory::getUser()->id, 'billing')) { echo $address->title . " " . $address->first_name . " " . $address->last_name . "<br>"; echo $address->company . "<br>"; echo $address->address_1 . " " . $address->address_2 . "<br>"; echo $address->city . ", " . $address->zone_name . ", " . $address->postal_code . "<br>"; echo $address->country_name . "<br>"; } else { echo JText::_('COM_TIENDA_NONE_SELECTED'); } ?> </td> <td> <a href="<?php echo JRoute::_("index.php?option=com_tienda&view=addresses"); ?> ">