PATH:
home
/
sparklp6
/
public_html
/
sparklerfilters-org
/
administrator
/
components
/
com_j2store
/
models
<?php /** * @package J2Store * @copyright Copyright (c)2014-17 Ramesh Elamathi / J2Store.org * @license GNU GPL v3 or later */ // No direct access to this file defined('_JEXEC') or die; class J2StoreModelMyProfiles extends F0FModel { /** * Method for building Query object * @retun Query object joomla's default query Object */ public function getAddress() { /** Get a DB Object */ $db = JFactory::getDbo(); /** get the current query Object **/ $query = $db->getQuery(true); /** Add a single column, or array of columns to the SELECT clause of the query */ $query->select('a.*')->from('#__j2store_addresses AS a'); /** Add a LEFT JOIN clause to the query */ $query->leftJoin('#__j2store_countries AS c ON c.j2store_country_id = a.country_id'); $query->select('c.country_name'); $query->leftJoin('#__j2store_zones AS z ON z.j2store_zone_id=a.zone_id'); $query->select('z.zone_name'); $this->_buildWhere($query); $db->setQuery($query); return $db->loadObjectList(); } public function _buildWhere(&$query){ $db = JFactory::getDbo(); $user = JFactory::getUser(); $query->where('a.email='.$db->quote($user->email)) ->where('a.user_id='.$db->quote($user->id)); } function getBillingAddress($order_info,$email){ $address = F0FTable::getAnInstance ( 'Address', 'J2StoreTable' )->getClone (); $table_array = array(); if(!empty( $order_info->billing_first_name )){ $table_array['first_name'] = $order_info->billing_first_name; } if(!empty( $order_info->billing_last_name )){ $table_array['last_name'] = $order_info->billing_last_name; } if(!empty( $order_info->billing_country_id )){ $table_array['country_id'] = $order_info->billing_country_id; } if(!empty( $order_info->billing_zone_id )){ $table_array['zone_id'] = $order_info->billing_zone_id; } if(!empty( $email )){ $table_array['email'] = $email; } // do email $address->load ($table_array); return $address; } function getShippingAddress($order_info,$email){ $address = F0FTable::getAnInstance ( 'Address', 'J2StoreTable' )->getClone (); $table_array = array(); if(!empty( $order_info->billing_first_name )){ $table_array['first_name'] = $order_info->billing_first_name; } if(!empty( $order_info->billing_last_name )){ $table_array['last_name'] = $order_info->billing_last_name; } if(!empty( $order_info->billing_country_id )){ $table_array['country_id'] = $order_info->billing_country_id; } if(!empty( $order_info->billing_zone_id )){ $table_array['zone_id'] = $order_info->billing_zone_id; } if(!empty( $email )){ $table_array['email'] = $email; } // do email $address->load ($table_array); return $address; } }
[-] shippings.php
[edit]
[-] coupons.php
[edit]
[-] productoptions.php
[edit]
[-] inventories.php
[edit]
[-] configurations.php
[edit]
[-] orders.php
[edit]
[+]
fields
[-] productprices.php
[edit]
[-] index.html
[edit]
[-] customers.php
[edit]
[-] apps.php
[edit]
[-] productoptionvalues.php
[edit]
[-] myprofiles.php
[edit]
[-] queues.php
[edit]
[-] emailtemplates.php
[edit]
[-] eupdates.php
[edit]
[+]
behavior
[-] reports.php
[edit]
[-] invoicetemplates.php
[edit]
[-] addresses.php
[edit]
[-] taxprofiles.php
[edit]
[-] orderhistories.php
[edit]
[-] manufacturers.php
[edit]
[-] carts.php
[edit]
[-] orderitems.php
[edit]
[-] storeprofiles.php
[edit]
[-] products.php
[edit]
[-] geozones.php
[edit]
[-] currencies.php
[edit]
[-] cartitems.php
[edit]
[-] filtergroups.php
[edit]
[-] orderdownloads.php
[edit]
[-] options.php
[edit]
[-] appstores.php
[edit]
[-] customfields.php
[edit]
[-] vouchers.php
[edit]
[-] vendors.php
[edit]
[-] shippingtroubles.php
[edit]
[-] updates.php
[edit]
[-] variants.php
[edit]
[+]
..
[-] promotions.php
[edit]
[-] cartadmins.php
[edit]
[-] producttags.php
[edit]
[-] payments.php
[edit]