Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let's do this right #2

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -731,11 +731,11 @@ function add()
'options' => array('class' => 'btn-group'),
'desc' => 'J2STORE_CONF_J2STORE_AUTO_APPLY_SHIPPING_DESC'
),
'hide_shipping_untill_address_selection' => array(
'hide_shipping_until_address_selection' => array(
'label' => 'J2STORE_CONF_AUTO_CALCULATE_SHIPPING_LABEL',
'type' => 'radio',
'name' => 'hide_shipping_untill_address_selection',
'value' => isset($vars->item->hide_shipping_untill_address_selection) && !is_null($vars->item->hide_shipping_untill_address_selection) ? $vars->item->hide_shipping_untill_address_selection : 1,
'name' => 'hide_shipping_until_address_selection',
'value' => isset($vars->item->hide_shipping_until_address_selection) && !is_null($vars->item->hide_shipping_until_address_selection) ? $vars->item->hide_shipping_until_address_selection : 1,
'options' => array('class' => 'btn-group'),
'desc' => 'J2STORE_CONF_AUTO_CALCULATE_SHIPPING_DESC'
),
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_j2store/controllers/cpanels.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function migrate_order_coupons() {
}

if (count ( $migrated_coupons )) {
// now delete the records of succesfully migrated order coupons
// now delete the records of successfully migrated order coupons
$query = $db->getQuery ( true )->delete ( '#__j2store_ordercoupons' )->where ( 'j2store_ordercoupon_id IN (' . implode ( ',', $migrated_coupons ) . ')' );
$db->setQuery ( $query );
try {
Expand Down Expand Up @@ -195,7 +195,7 @@ public function migrate_order_vouchers() {
}

if (count ( $migrated_vouchers )) {
// now delete the records of succesfully migrated order coupons
// now delete the records of successfully migrated order coupons
$query = $db->getQuery ( true )->delete ( '#__j2store_voucherhistories' )->where ( 'j2store_voucherhistory_id IN (' . implode ( ',', $migrated_vouchers ) . ')' );
$db->setQuery ( $query );
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ function checkBillingInfo($order){
if(empty( $orderinfo ) || empty( $orderinfo->billing_first_name )){
//redirect to billing
$url ='index.php?option=com_j2store&view=orders&task=createOrder&layout=billing&oid='.$order->j2store_order_id;
$app->redirect ( $url,JText::_ ( 'J2STORE_BILLING_ADDRESS_REQUIRED' ),'waring' );
$app->redirect ( $url,JText::_ ( 'J2STORE_BILLING_ADDRESS_REQUIRED' ),'warning' );
}
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1207,8 +1207,8 @@ public function getVariantListAjax()
$variantModel->setState('product_type', $item->product_type);
$variant_list = $variantModel->product_id($product_id)->limit($limit)->limitstart($limitstart)->is_master(0)->getList();
$variant_pagination = $variantModel->getPagination();
$lengths = $variantModel->getDimesions('lengths', 'j2store_length_id', 'length_title');
$weights = $variantModel->getDimesions('weights', 'j2store_weight_id', 'weight_title');
$lengths = $variantModel->getDimensions('lengths', 'j2store_length_id', 'length_title');
$weights = $variantModel->getDimensions('weights', 'j2store_weight_id', 'weight_title');
$controller = F0FController::getTmpInstance('com_j2store', 'Products');
$view = $controller->getView('Product', 'Html', 'J2StoreView');
if ($model = $controller->getModel('Products', 'J2StoreModel')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function browse()
}
$view = $this->getThisView();
$view->setModel($model);
$view->assign('shipping_avaliable',$shipping);
$view->assign('shipping_available',$shipping);
$view->assign('shipping_messages',$messages);
$view->setLayout($layout);
}elseif ($layout=='default_shipping_product'){
Expand All @@ -56,7 +56,7 @@ public function browse()
}
$view = $this->getThisView();
$view->setModel($model);
$view->assign('shipping_avaliable',$shipping);
$view->assign('shipping_available',$shipping);
$view->assign('products',$products);
$view->assign('state', $model->getState());
$view->setLayout($layout);
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_j2store/helpers/currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function getDecimalPlace($currency = '') {
}
}

public function getThousandSysmbol($currency=''){
public function getThousandSymbol($currency=''){
if (!$currency) {
return $this->currencies[$this->code]['currency_thousands'];
} elseif ($currency && isset($this->currencies[$currency])) {
Expand Down Expand Up @@ -227,7 +227,7 @@ public static function getCurrenciesNumericCode($code){
/**
* Method to get Numerice code
* @param string $code alpha 3 digit code
* @return int numberic code
* @return int numeric code
*/
public static function getNumericCode(){
$result = array('AFN' => 4,
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_j2store/helpers/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getOrderEmails($order , $receiver_type = '*'){
/**
* 1. Get order emails by type
* 2. filter by language and process each mail template ( process tags )
* 3. prepare the mailer for each template (intialize the mailer object)
* 3. prepare the mailer for each template (initialize the mailer object)
* 4. set the receivers ( customer emails / admins )
* 5. return the array
* */
Expand Down Expand Up @@ -151,7 +151,7 @@ protected function filterByLanguage($order, $mail_templates){
$default_template_group[] = (object) $standard_template;
}
}
// sort by language prefernce
// sort by language preference
krsort($filtered_templates);

$result = $default_template_group ;
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_j2store/helpers/invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function getInvoiceTemplates($order) {
return $allTemplates;
}

public function getFormatedInvoice($order){
public function getFormattedInvoice($order){
$text = $this->loadInvoiceTemplate($order);
$template = J2Store::email()->processTags($text, $order, $extras=array());
return $template;
Expand Down
10 changes: 5 additions & 5 deletions administrator/components/com_j2store/helpers/j2html.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ public static function input($type, $name, $value = null, $options = array())

//assign the html
$html = '';
//swtich the type of input
//switch the type of input
switch ($type) {

// return text input
Expand Down Expand Up @@ -859,7 +859,7 @@ public static function custom($type, $name, $value, $options = array())
}elseif ($type == 'menuitem') {
$html = self::menuItems($name, $value, $options);
} elseif ($type == 'modal_article') {
$html = self::artical($name, $value, $options);
$html = self::article($name, $value, $options);
} elseif ($type == 'enabled') {
$id = isset($options['id']) && !empty($options['id']) ? $options['id'] : $name;
$html = JHtmlSelect::booleanlist($name, $attr = array(), $value, $yes = 'JYES', $no = 'JNO', $id);
Expand Down Expand Up @@ -1121,7 +1121,7 @@ public static function getEditor($editor=''){
return $my_editor;
}

public static function artical($name, $value, $options){
public static function article($name, $value, $options){
$platform = J2Store::platform();
//
$allowClear = true;
Expand Down Expand Up @@ -1557,8 +1557,8 @@ protected static function getExpiryDate($valid_from, $valid_to)
{
$start = date("Y-m-d");
$today = date_create($start);
//assing the coupon offer start date
// Assing the coupon valid date
//assign the coupon offer start date
// Assign the coupon valid date
$date2 = date_create($valid_to);
return date_diff($today, $date2);
}
Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_j2store/helpers/strapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,17 +329,17 @@ public static function getDateLocalisation($as_array=false) {
$params = J2Store::config();
$language = JFactory::getLanguage()->getTag();
if($params->get('jquery_ui_localisation', 0) && strpos($language, 'en') === false) {
$platfrom = J2Store::platform();
$platform = J2Store::platform();
//$doc = JFactory::getDocument();
$platfrom->addScript('jquery-ui-i18n','/ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/i18n/jquery-ui-i18n.min.js');
$platform->addScript('jquery-ui-i18n','/ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/i18n/jquery-ui-i18n.min.js');
// $doc->addScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/i18n/jquery-ui-i18n.min.js');

//set the language default
$tag = explode('-', $language);
if(isset($tag[0]) && strlen($tag[0]) == 2) {
$script = "";
$script .= "(function($) { $.datepicker.setDefaults($.datepicker.regional['{$tag[0]}']); })(j2store.jQuery);";
$platfrom->addInlineScript($script);
$platform->addInlineScript($script);
//$doc->addScriptDeclaration($script);
}

Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_j2store/helpers/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ function validatePassword($password,$confirm_password,&$json){
}
}

// Minimum number of upper case ASII characters required
// Minimum number of upper case ASCII characters required
if (!empty($minimumUppercase))
{
$nUppercase = preg_match_all("/[A-Z]/", $password, $umatch);
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_j2store/helpers/utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function isJson($string) {
/**
* Method to convert an object or an array to csv
* @param mixed $data array or object
* @return string comma seperated value
* @return string comma separated value
*/

public function to_csv($data) {
Expand All @@ -90,7 +90,7 @@ public function to_csv($data) {

/**
* Method to format stock quantity
* @param Float|Int $qty An int or a float value can be formated here.
* @param Float|Int $qty An int or a float value can be formatted here.
* @return mixed
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function __construct(&$subject, $config)
*
* The methods between here
* and the next comment block are
* yours to modify by overrriding them in your shipping plugin
* yours to modify by overriding them in your shipping plugin
*
************************************/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function includeCustomModels()
*
* The methods between here
* and the next comment block are
* yours to modify by overrriding them in your shipping plugin
* yours to modify by overriding them in your shipping plugin
*
************************************/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function __construct(&$subject, $config)
*
* The methods between here
* and the next comment block are
* yours to modify by overrriding them in your shipping plugin
* yours to modify by overriding them in your shipping plugin
*
************************************/

Expand Down
26 changes: 13 additions & 13 deletions administrator/components/com_j2store/library/selectable/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function show($field,$value){
return $html;
}

function getFormatedCustomFields($row, $layout='customfields', $type='billing') {
function getFormattedCustomFields($row, $layout='customfields', $type='billing') {

$app = JFactory::getApplication();

Expand Down Expand Up @@ -113,8 +113,8 @@ function getFormatedCustomFields($row, $layout='customfields', $type='billing')

}

function getFormatedDisplay($field, $value, $name, $translate=false, $options = '', $test = false, $allFields = null, $allValues = null) {
$label = $this->getFieldName($field);
function getFormattedDisplay($field, $value, $name, $translate=false, $options = '', $test = false, $allFields = null, $allValues = null) {
$label = $this->getFieldName($field);
$input = $this->display($field, $value, $name, $translate, $options, $test, $allFields, $allValues);
$html = $label.$input;
return $html;
Expand All @@ -128,7 +128,7 @@ function validate($formData, $area, $type='address') {
$data = J2Store::platform()->toObject($formData);
$fields = $this->getFields($area,$data,$type);
$json = array();
foreach ($fields as $field) {
foreach ($fields as $field) {
$namekey = $field->field_namekey;
$field_type = $field->field_type;
if(substr($field->field_type,0,4) == 'plg.') {
Expand All @@ -145,7 +145,7 @@ function validate($formData, $area, $type='address') {
$val = $formData[$namekey];
} else {
$val = '';
}
}
$error = $class->check($field,$val, $oldValue='');
if(!empty($error)) {
$json['error'][$namekey] = $error;
Expand Down Expand Up @@ -208,7 +208,7 @@ function prepareFields(&$fields,&$data,$type='user',$url='checkout&task=state',$
}

}

$this->handleZone($fields,$test,$data);
}
}
Expand Down Expand Up @@ -242,7 +242,7 @@ function handleZone(&$fields,$test,$data){
$ok = true;
}
if($country_id) {

$zoneType = new j2storeCountryType();
$zoneType->type = 'zone';
$zoneType->published = true;
Expand Down Expand Up @@ -347,15 +347,15 @@ function getCurrentURL($checkInRequest='',$safe=true){
}

function getFields($area,&$data,$type='user',$url='checkout&task=state', $notcoreonly=false){
$fields = $this->getData($area,$type, $notcoreonly);
$this->prepareFields($fields,$data,$type,$url);
$fields = $this->getData($area,$type, $notcoreonly);
$this->prepareFields($fields,$data,$type,$url);
return $fields;
}

/*
* @area string display area - billing or shipping or payment
* @type string field table type example: address
* @notcoreonly boolen true for core fields
* @notcoreonly boolean true for core fields
*/

function &getData($area,$type,$notcoreonly=false){
Expand Down Expand Up @@ -1012,11 +1012,11 @@ function translate($name){


function check(&$field,&$value, $oldvalue){
$error = '';
$error = '';
if(!$field->field_required || is_array($value) || strlen($value) || strlen($oldvalue)){
return $error;
}

if($this->report){
$platform = J2Store::platform();
if(!$platform->isClient('administrator') || (isset($field->admin_display_error) && $field->admin_display_error)) {
Expand Down Expand Up @@ -1347,7 +1347,7 @@ function display($field, $value, $map, $inside, $options = '', $test = false, $a
break;
}
}

}
//still no. Set it to store default.
if(empty($country)){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public function onBeforeAddCartItem(&$model, $product, &$json) {
$product->product_options = $reloaded_product_options;

$product_options = $product_helper->getProductOptions($product);
$ommit_check = array();
$omit_check = array();
//iterate through stored options for this product and validate
foreach($product_options as $product_option) {
$check_require= F0FModel::getTmpInstance('ProductOptions', 'J2StoreModel')->getItem($product_option['productoption_id']);
if($check_require->required && empty($check_option[$product_option['productoption_id']]) && $check_require->parent_id == 0 || in_array($product_option['productoption_id'], $ommit_check)){
if($check_require->required && empty($check_option[$product_option['productoption_id']]) && $check_require->parent_id == 0 || in_array($product_option['productoption_id'], $omit_check)){
$errors['error']['option'][$product_option['productoption_id']] = JText::sprintf('J2STORE_ADDTOCART_PRODUCT_OPTION_REQUIRED', JText::_($product_option['option_name']));
}
else if(array_key_exists($product_option['productoption_id'],$options))
Expand All @@ -59,7 +59,7 @@ public function onBeforeAddCartItem(&$model, $product, &$json) {

if(count($attr['optionvalue']) > 0 && $attr['required'] && !array_key_exists($attr['productoption_id'],$options)) // if optionvalue exist or not. then only display form.otherwise form display only heading without option name
{
array_push($ommit_check,$attr['productoption_id']);
array_push($omit_check,$attr['productoption_id']);
}
}
}
Expand All @@ -73,7 +73,7 @@ public function onBeforeAddCartItem(&$model, $product, &$json) {

if(count($attr['optionvalue']) > 0 && $attr['required'] && !array_key_exists($attr['productoption_id'],$options)) // if optionvalue exist or not. then only display form.otherwise form display only heading without option name
{
array_push($ommit_check,$attr['productoption_id']);
array_push($omit_check,$attr['productoption_id']);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,9 @@ public function onUpdateProduct(&$model, &$product) {
$return ['pricing'] ['price'] = J2Store::product ()->displayPrice ( $price, $product, $params );
$return ['child_options'] = $response_option;
$return ['optionhtml'] = $html;
$return ['pricing'] ['orginal'] = array();
$return ['pricing'] ['orginal']['base_price'] = $base_price;
$return ['pricing'] ['orginal']['price'] = $price;
$return ['pricing'] ['original'] = array();
$return ['pricing'] ['original']['base_price'] = $base_price;
$return ['pricing'] ['original']['price'] = $price;
J2Store::plugin()->event('AfterUpdateProductReturn',array(&$return,$product,$params));
return $return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,9 @@ public function onUpdateProduct(&$model, &$product) {
$return ['pricing'] = array ();
$return ['pricing'] ['base_price'] = $product_helper->displayPrice ( $base_price, $product, $params );
$return ['pricing'] ['price'] = $product_helper->displayPrice ( $price, $product, $params );
$return ['pricing'] ['orginal'] = array();
$return ['pricing'] ['orginal']['base_price'] = $base_price;
$return ['pricing'] ['orginal']['price'] = $price;
$return ['pricing'] ['original'] = array();
$return ['pricing'] ['original']['base_price'] = $base_price;
$return ['pricing'] ['original']['price'] = $price;
J2Store::plugin()->event('AfterUpdateProductReturn',array(&$return,$product,$params));
return $return;
}
Expand Down
Loading