Skip to content

Commit

Permalink
3.0.0RC8
Browse files Browse the repository at this point in the history
3.0.0RC8
  • Loading branch information
PhocaCz committed Jun 1, 2017
1 parent 515e2a6 commit 19a27e0
Show file tree
Hide file tree
Showing 253 changed files with 9,228 additions and 2,317 deletions.
50 changes: 45 additions & 5 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<fields addfieldpath="/administrator/components/com_phocacart/models/fields">
<fieldset name="display" label="COM_PHOCACART_CONFIG_HEAD_DISPLAY_LABEL">

<field name="main_description" type="editor" buttons="true" hide="pagebreak,readmore" class="inputbox" label="COM_PHOCACART_FIELD_MAIN_DESCRIPTION_LABEL" filter="safehtml" description="COM_PHOCACART_FIELD_MAIN_DESCRIPTION_DESC" />

<field name="terms_conditions" type="editor" buttons="true" hide="pagebreak,readmore" class="inputbox" label="COM_PHOCACART_FIELD_MAIN_TERMS_AND_CONDITIONS_LABEL" filter="safehtml" description="COM_PHOCACART_FIELD_MAIN_TERMS_AND_CONDITIONS_DESC" />
<field name="main_description" type="modal_article" select="true" new="true" edit="true" clear="true" class="inputbox" label="COM_PHOCACART_FIELD_MAIN_DESCRIPTION_LABEL" description="COM_PHOCACART_FIELD_MAIN_DESCRIPTION_DESC" addfieldpath="/administrator/components/com_content/models/fields" />

<field name="checkout_desc" type="editor" buttons="true" hide="pagebreak,readmore" class="inputbox" label="COM_PHOCACART_FIELD_CHECKOUT_DESCRIPTION_LABEL" filter="safehtml" description="COM_PHOCACART_FIELD_CHECKOUT_DESCRIPTION_DESC" />
<field name="terms_conditions" type="modal_article" select="true" new="true" edit="true" clear="true" class="inputbox" label="COM_PHOCACART_FIELD_MAIN_TERMS_AND_CONDITIONS_LABEL" description="COM_PHOCACART_FIELD_MAIN_TERMS_AND_CONDITIONS_DESC" addfieldpath="/administrator/components/com_content/models/fields" />

<field name="checkout_desc" type="modal_article" select="true" new="true" edit="true" clear="true" class="inputbox" label="COM_PHOCACART_FIELD_CHECKOUT_DESCRIPTION_LABEL" description="COM_PHOCACART_FIELD_CHECKOUT_DESCRIPTION_DESC" addfieldpath="/administrator/components/com_content/models/fields" />


<field name="phocahead1" type="phocahead" default="COM_PHOCACART_CATEGORIES_VIEW_LABEL" label="" description=""/>
Expand Down Expand Up @@ -243,6 +243,12 @@
<option value="0">COM_PHOCACART_NO</option>
</field>

<field name="enable_price_history" type="radio" class="btn-group btn-group-yesno" default="0" label="COM_PHOCACART_FIELD_DISPLAY_PRODUCT_PRICE_HISTORY_LABEL" description="COM_PHOCACART_FIELD_DISPLAY_PRODUCT_PRICE_HISTORY_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>




<field name="phocahead6" type="phocahead" default="COM_PHOCACART_CHECKOUT_VIEW_LABEL" label="" description=""/>
Expand Down Expand Up @@ -275,6 +281,12 @@
<option value="1">COM_PHOCACART_YES</option>
</field>

<field name="enable_captcha_checkout" type="list" class="btn-group btn-group-yesno" default="2" label="COM_PHOCACART_FIELD_ENABLE_CAPTCHA_CHECKOUT_LABEL" description="COM_PHOCACART_FIELD_ENABLE_CAPTCHA_CHECKOUT_DESC">
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_ALL_CUSTOMERS</option>
<option value="2">COM_PHOCACART_GUESTS_ONLY</option>
</field>



<field name="phocahead7" type="phocahead" default="COM_PHOCACART_GENERAL_DISPLAY_OPTIONS_LABEL" label="" description=""/>
Expand All @@ -296,6 +308,11 @@
<option value="0">COM_PHOCACART_NO</option>
</field>

<field name="display_addtocart_icon" type="radio" class="btn-group btn-group-yesno" default="0" label="COM_PHOCACART_FIELD_DISPLAY_ADD_TO_CART_ICON_LABEL" description="COM_PHOCACART_FIELD_DISPLAY_ADD_TO_CART_ICON_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>

<field name="fade_in_action_icons" type="radio" class="btn-group btn-group-yesno" default="0" label="COM_PHOCACART_FIELD_FADE_IN_ACTION_ICONS_LABEL" description="COM_PHOCACART_FIELD_FADE_IN_ACTION_ICONS_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
Expand Down Expand Up @@ -441,6 +458,16 @@
<option value="1">COM_PHOCACART_ROUND_HALF_DOWN</option>
</field>

<field name="enable_coupons" type="list" default="1" label="COM_PHOCACART_FIELD_ENABLE_COUPONS_LABEL" description="COM_PHOCACART_FIELD_ENABLE_COUPONS_DESC">
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>

<field name="enable_rewards" type="list" default="1" label="COM_PHOCACART_FIELD_ENABLE_REWARD_POINTS_LABEL" description="COM_PHOCACART_FIELD_ENABLE_REWARD_POINTS_DESC">
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>


<!--
<field name="rounding_calculation_subtotal" type="list" default="2" label="COM_PHOCACART_FIELD_ROUNDING_SUBTOTAL_AMOUNT_LABEL" description="COM_PHOCACART_FIELD_ROUNDING_SUBTOTAL_AMOUNT_LABEL">
Expand Down Expand Up @@ -542,6 +569,11 @@

<fieldset name="discount" label="COM_PHOCACART_CONFIG_HEAD_DISCOUNT_LABEL">

<field name="discount_priority" default="1" type="list" class="btn-group btn-group-yesno" label="COM_PHOCACART_FIELD_DISCOUNT_PRIORITY_LABEL" description="COM_PHOCACART_FIELD_DISCOUNT_PRIORITY_DESC" >
<option value="1">COM_PHOCACART_HIGHEST_DISCOUNT</option>
<option value="2">COM_PHOCACART_HIGHEST_QUANTITY</option>
</field>

<field name="phocahead21" type="phocahead" default="COM_PHOCACART_CONFIG_PRODUCT_DISCOUNT_OPTIONS_LABEL" label="" description=""/>

<field name="discount_product_variations_quantity" default="1" type="radio" class="btn-group btn-group-yesno" label="COM_PHOCACART_FIELD_QUANTITY_RULE_PRODUCT_VARIATIONS_LABEL" description="COM_PHOCACART_FIELD_QUANTITY_RULE_PRODUCT_VARIATIONS_DESC" >
Expand Down Expand Up @@ -590,6 +622,12 @@
<option value="0">COM_PHOCACART_NO</option>
</field>

<field name="user_group_change_rule" default="0" type="list" class="btn-group btn-group-yesno" label="COM_PHOCACART_FIELD_USER_GROUP_CHANGE_RULE_LABEL" description="COM_PHOCACART_FIELD_USER_GROUP_CHANGE_RULE_DESC" >
<option value="0">COM_PHOCACART_NEVER_CHANGE_USER_GROUP</option>
<option value="1">COM_PHOCACART_ONE_GROUP_HIGHEST_MINIMAL_SUM_OF_PURCHACHES_INCLUDING_DEFAULT</option>
<option value="2">COM_PHOCACART_ALL_GROUPS_INCLUDING_DEFAULT</option>
</field>



<field name="phocahead12" type="phocahead" default="COM_PHOCACART_CONFIG_DOWNLOAD_LABEL" label="" description=""/>
Expand Down Expand Up @@ -701,7 +739,9 @@
<option value="0">COM_PHOCACART_NO</option>
</field>

<field name="question_description" type="editor" buttons="true" hide="pagebreak,readmore" class="inputbox" label="COM_PHOCACART_FIELD_ASK_QUESTION_DESCRIPTION_LABEL" filter="safehtml" description="COM_PHOCACART_FIELD_ASK_QUESTION_DESCRIPTION_DESC" />
<field name="question_description" type="modal_article" select="true" new="true" edit="true" clear="true" class="inputbox" label="COM_PHOCACART_FIELD_ASK_QUESTION_DESCRIPTION_LABEL" description="COM_PHOCACART_FIELD_ASK_QUESTION_DESCRIPTION_DESC" addfieldpath="/administrator/components/com_content/models/fields" />



<field name="display_name_form" type="radio" class="btn-group btn-group-yesno" default="2" label="COM_PHOCACART_FIELD_DISPLAY_NAME_FORM_LABEL" description="COM_PHOCACART_FIELD_DISPLAY_NAME_FORM_DESC">
<option value="1">COM_PHOCACART_YES</option>
Expand Down Expand Up @@ -842,8 +882,8 @@

<field name="store_logo" type="media" default="" directoryimg="1" label="COM_PHOCACART_FIELD_STORE_LOGO_LABEL" description="COM_PHOCACART_FIELD_STORE_LOGO_DESC" />

<field name="store_info" type="editor" buttons="true" hide="pagebreak,readmore" class="inputbox" label="COM_PHOCACART_FIELD_STORE_INFORMATION_LABEL" filter="safehtml" description="COM_PHOCACART_FIELD_STORE_INFORMATION_DESC" />

<field name="store_info" type="modal_article" select="true" new="true" edit="true" clear="true" class="inputbox" label="COM_PHOCACART_FIELD_STORE_INFORMATION_LABEL" description="COM_PHOCACART_FIELD_STORE_INFORMATION_DESC" addfieldpath="/administrator/components/com_content/models/fields" />

</fieldset>

Expand Down
4 changes: 3 additions & 1 deletion controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
$l['pa'] = array('COM_PHOCACART_PAYMENT', 'phocacartpayments');
$l['cu'] = array('COM_PHOCACART_CURRENCIES', 'phocacartcurrencies');
$l['tx'] = array('COM_PHOCACART_TAXES', 'phocacarttaxes');
$l['us'] = array('COM_PHOCACART_USERS', 'phocacartusers');
$l['us'] = array('COM_PHOCACART_CUSTOMERS', 'phocacartusers');
$l['gr'] = array('COM_PHOCACART_CUSTOMER_GROUPS', 'phocacartgroups');
$l['rp'] = array('COM_PHOCACART_REWARD_POINTS', 'phocacartrewards');
$l['ff'] = array('COM_PHOCACART_FORM_FIELDS', 'phocacartformfields');
$l['rw'] = array('COM_PHOCACART_REVIEWS', 'phocacartreviews');
//$l['vo'] = array('COM_PHOCACART_VOUCHERS', 'phocacartvouchers');
Expand Down
48 changes: 48 additions & 0 deletions controllers/phocacarteditproductpointgroup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartEditProductPointGroup extends PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartEditProductPointGroup', $prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}

function save() {

if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}

$app = JFactory::getApplication();
$jform = $app->input->get('jform', array(), 'array');
$id = $app->input->get('id', 0, 'int');


if (!empty($jform)) {
$model = $this->getModel( 'phocacarteditproductpointgroup' );
if(!$model->save($jform, $id)) {
$message = JText::_( 'COM_PHOCACART_ERROR_ADD_CUSTOMER_GROUP_DATA' );
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_( 'COM_PHOCACART_SUCCESS_ADD_CUSTOMER_GROUP_DATA' );
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacarteditproductpointgroup&tmpl=component&id='.(int)$id);
} else {

$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ITEM_FOUND'), 'error');
$app->redirect('index.php?option=com_phocacart&view=phocacarteditproductpointgroup&tmpl=component');
}
}

}
?>
48 changes: 48 additions & 0 deletions controllers/phocacarteditproductpricegroup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartEditProductPriceGroup extends PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartEditProductPriceGroup', $prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}

function save() {

if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}

$app = JFactory::getApplication();
$jform = $app->input->get('jform', array(), 'array');
$id = $app->input->get('id', 0, 'int');


if (!empty($jform)) {
$model = $this->getModel( 'phocacarteditproductpricegroup' );
if(!$model->save($jform, $id)) {
$message = JText::_( 'COM_PHOCACART_ERROR_ADD_CUSTOMER_GROUP_DATA' );
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_( 'COM_PHOCACART_SUCCESS_ADD_CUSTOMER_GROUP_DATA' );
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacarteditproductpricegroup&tmpl=component&id='.(int)$id);
} else {

$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ITEM_FOUND'), 'error');
$app->redirect('index.php?option=com_phocacart&view=phocacarteditproductpricegroup&tmpl=component');
}
}

}
?>
48 changes: 48 additions & 0 deletions controllers/phocacarteditproductpricehistory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocaCartEditProductPriceHistory extends PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocaCartEditProductPriceHistory', $prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}

function save() {

if (!JSession::checkToken('request')) {
$app->enqueueMessage('Invalid Token', 'message');
return false;
}

$app = JFactory::getApplication();
$jform = $app->input->get('jform', array(), 'array');
$id = $app->input->get('id', 0, 'int');


if (!empty($jform)) {
$model = $this->getModel( 'phocacarteditproductpricehistory' );
if(!$model->save($jform, $id)) {
$message = JText::_( 'COM_PHOCACART_ERROR_ADD_PRODUCT_PRICE_HISTORY' );
$app->enqueueMessage($message, 'error');
} else {
$message = JText::_( 'COM_PHOCACART_SUCCESS_ADD_PRODUCT_PRICE_HISTORY' );
$app->enqueueMessage($message, 'message');
}
$app->redirect('index.php?option=com_phocacart&view=phocacarteditproductpricehistory&tmpl=component&id='.(int)$id);
} else {

$app->enqueueMessage(JText::_('COM_PHOCACART_NO_ITEM_FOUND'), 'error');
$app->redirect('index.php?option=com_phocacart&view=phocacarteditproductpricehistory&tmpl=component&id='.(int)$id);
}
}

}
?>
2 changes: 1 addition & 1 deletion controllers/phocacartexport.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function export() {
}
$limitCount = $this->t['import_export_pagination'];

$d = '';
$d = array();
$d['products'] = PhocacartProduct::getProductsFull($limitOffset, $limitCount, 11);
//$d['productcolumns'] = PhocacartProduct::getProductColumns();// 1 and 2 line - Header - Filtering of columns Set in layout
$d['page'] = $page;// Pagination
Expand Down
32 changes: 31 additions & 1 deletion controllers/phocacartformfields.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public function __construct($config = array())
$this->registerTask('hidebilling', 'displaybilling');
$this->registerTask('hideshipping', 'displayshipping');
$this->registerTask('hideaccount', 'displayaccount');
$this->registerTask('disablerequired', 'enablerequired');

}

Expand Down Expand Up @@ -83,15 +84,44 @@ function displayshipping() {
$this->setRedirect(JRoute::_('index.php?option='.$this->option.'&view='.$this->view_list, false));
}

function displayaccount() {
function enablerequired() {
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));

$app = JFactory::getApplication();
$cid = $app->input->get('cid', array(), '', 'array');
$data = array('enablerequired' => 1, 'disablerequired' => 0);
$task = $this->getTask();
$value = JArrayHelper::getValue($data, $task, 0, 'int');

if (empty($cid)) {
$app->enqueueMessage(JText::_($this->text_prefix.'_NO_ITEM_SELECTED'), 'error');
} else {
$model = $this->getModel();
JArrayHelper::toInteger($cid);
if (!$model->displayItem($cid, $value, 'required')) {
$app->enqueueMessage($model->getError(), 'error');
} else {
if ($value == 1) {
$ntext = $this->text_prefix.'_N_ITEMS_MADE_REQUIRED';
} else if ($value == 0) {
$ntext = $this->text_prefix.'_N_ITEMS_MADE_NOT_REQUIRED';
}
$this->setMessage(JText::plural($ntext, count($cid)));
}
}
$this->setRedirect(JRoute::_('index.php?option='.$this->option.'&view='.$this->view_list, false));
}

function displayaccount() {
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));

$app = JFactory::getApplication();
$cid = $app->input->get('cid', array(), '', 'array');
$data = array('displayaccount' => 1, 'hideaccount' => 0);
$task = $this->getTask();
$value = JArrayHelper::getValue($data, $task, 0, 'int');


if (empty($cid)) {
$app->enqueueMessage(JText::_($this->text_prefix.'_NO_ITEM_SELECTED'), 'error');
} else {
Expand Down
12 changes: 12 additions & 0 deletions controllers/phocacartgroup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocacartGroup extends PhocaCartCpControllerPhocaCartCommon {}
?>
18 changes: 18 additions & 0 deletions controllers/phocacartgroups.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
require_once JPATH_COMPONENT.'/controllers/phocacartcommons.php';
class PhocaCartCpControllerPhocacartGroups extends PhocaCartCpControllerPhocaCartCommons
{
public function &getModel($name = 'PhocacartGroup', $prefix = 'PhocaCartCpModel', $config = array()) {
$model = parent::getModel($name, $prefix, array('ignore_request' => true));
return $model;
}
}
?>
2 changes: 1 addition & 1 deletion controllers/phocacartimport.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function import() {

$model = $this->getModel();

$d = '';
$d = array();
$d['file_type'] = $model->getFileType();
$d['products'] = $model->getUploadedProducts($limitOffset, $limitCount);
$d['productcolumns'] = $model->getUploadedProductColumns();// 1 and 2 line - Header - Filtering of columns Set in layout
Expand Down
Loading

0 comments on commit 19a27e0

Please sign in to comment.