Skip to content

Commit

Permalink
3.5.4
Browse files Browse the repository at this point in the history
3.5.4
  • Loading branch information
PhocaCz committed Oct 29, 2020
1 parent a7dd21f commit 9eda8a8
Show file tree
Hide file tree
Showing 109 changed files with 11,579 additions and 5,673 deletions.
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Phoca Cart is e-commerce extension - powerful shopping cart for Joomla! CMS. Pho

## Version

3.5.3
3.5.4



Expand Down
42 changes: 39 additions & 3 deletions admin/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,11 @@
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>

<field name="phocahead39" type="phocahead" default="COM_PHOCACART_INFO_VIEW_LABEL" label="" description=""/>

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


<field name="phocahead7" type="phocahead" default="COM_PHOCACART_GENERAL_DISPLAY_OPTIONS_LABEL" label="" description=""/>
Expand Down Expand Up @@ -614,8 +619,21 @@
<option value="0">COM_PHOCACART_NO</option>
</field>

<field name="dynamic_change_image" type="radio" class="btn-group btn-group-yesno" default="0" label="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_IMAGE_LABEL"
<field name="dynamic_change_image" type="list" class="btn-group btn-group-yesno" default="0" label="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_IMAGE_LABEL"
description="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_IMAGE_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="2">COM_PHOCACART_YES_ADVANCED_STOCK_MANAGEMENT</option>
<option value="0">COM_PHOCACART_NO</option>
</field>

<field name="dynamic_change_id" type="radio" class="btn-group btn-group-yesno" default="0" label="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_ID_LABEL"
description="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_ID_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>

<field name="dynamic_change_url_attributes" type="radio" class="btn-group btn-group-yesno" default="0" label="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_URL_ATTRIBUTES_LABEL"
description="COM_PHOCACART_FIELD_DYNAMIC_CHANGE_URL_ATTRIBUTES_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>
Expand Down Expand Up @@ -658,8 +676,9 @@
<field name="cart_metadesc" default="" type="textarea" label="COM_PHOCACART_FIELD_META_DESCRIPTION_LABEL" description="COM_PHOCACART_FIELD_META_DESCRIPTION_DESC"/>


<field name="image_popup_method" type="radio" class="btn-group btn-group-yesno" default="1" label="COM_PHOCACART_FIELD_IMAGE_POPUP_METHOD_LABEL" description="COM_PHOCACART_FIELD_IMAGE_POPUP_METHOD_DESC">
<option value="1">COM_PHOCACART_PRETTYPHOTO</option>
<field name="image_popup_method" type="list" class="btn-group btn-group-yesno" default="1" label="COM_PHOCACART_FIELD_IMAGE_POPUP_METHOD_LABEL" description="COM_PHOCACART_FIELD_IMAGE_POPUP_METHOD_DESC">
<option value="0">COM_PHOCACART_NONE</option>
<option value="1">COM_PHOCACART_PRETTYPHOTO</option>
<option value="2">COM_PHOCACART_MAGNIFIC</option>
</field>

Expand Down Expand Up @@ -1020,6 +1039,16 @@
<option value="2">COM_PHOCACART_YES_OVERALL_NO_PAYMENT_METHOD_PUBLISHED</option>
<option value="3">COM_PHOCACART_YES_OVERALL_NO_PAYMENT_METHOD_FOUND_DESPITE_CHECKING_RULES</option>
</field>

<field name="change_remove_shipping_method" default="1" type="list" label="COM_PHOCACART_FIELD_REMOVE_SHIPPING_METHOD_CHANGE_LABEL" description="COM_PHOCACART_FIELD_REMOVE_SHIPPING_METHOD_CHANGE_DESC">
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>

<field name="change_remove_payment_method" default="1" type="list" label="COM_PHOCACART_FIELD_REMOVE_PAYMENT_METHOD_CHANGE_LABEL" description="COM_PHOCACART_FIELD_REMOVE_PAYMENT_METHOD_CHANGE_DESC">
<option value="0">COM_PHOCACART_NO</option>
<option value="1">COM_PHOCACART_YES</option>
</field>

<field name="default_order_status_free_download" default="1" type="PhocacartOrderstatus" label="COM_PHOCACART_FIELD_DEFAULT_ORDER_STATUS_FREE_DOWNLOAD_LABEL"
description="COM_PHOCACART_FIELD_DEFAULT_ORDER_STATUS_FREE_DOWNLOAD_DESC">
Expand Down Expand Up @@ -1371,6 +1400,13 @@
<option value="1">COM_PHOCACART_YES</option>
<option value="0">COM_PHOCACART_NO</option>
</field>

<field name="sql_search_skip_id" type="list" class="btn-group btn-group-yesno" default="1" label="COM_PHOCACART_FIELD_SQL_SEARCH_SKIP_ID_ATTRIBUTES_LABEL" description="COM_PHOCACART_FIELD_SQL_SEARCH_SKIP_ID_ATTRIBUTES_DESC">
<option value="1">COM_PHOCACART_YES</option>
<option value="2">COM_PHOCACART_ONLINE_SHOP_ONLY</option>
<option value="3">COM_PHOCACART_POS_ONLY</option>
<option value="0">COM_PHOCACART_NO</option>
</field>

<field name="product_image_path" default="images/phocacartproducts" size="4" type="text" label="COM_PHOCACART_FIELD_PRODUCT_IMAGE_PATH_LABEL" description="COM_PHOCACART_FIELD_PRODUCT_IMAGE_PATH_DESC"/>
<field name="category_image_path" default="images/phocacartcategories" size="4" type="text" label="COM_PHOCACART_FIELD_CATEGORY_IMAGE_PATH_LABEL" description="COM_PHOCACART_FIELD_CATEGORY_IMAGE_PATH_DESC"/>
Expand Down
3 changes: 3 additions & 0 deletions admin/install/sql/mysql/install.utf8.sql
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_products` (
`public_play_file` varchar(255) NOT NULL DEFAULT '',
`public_play_text` varchar(255) NOT NULL DEFAULT '',
`featured` tinyint(1) NOT NULL DEFAULT '0',
`featured_background_image` varchar(255) NOT NULL DEFAULT '',
`allow_upload` tinyint(1) NOT NULL DEFAULT '0',
`custom_text` text,
`download_token` char(64) NOT NULL DEFAULT '',
Expand Down Expand Up @@ -251,6 +252,8 @@ CREATE TABLE IF NOT EXISTS `#__phocacart_product_stock` (
`product_id` int(11) NOT NULL DEFAULT '0',
`product_key` text,
`attributes` text,
`sku` varchar(255) NOT NULL DEFAULT '',
`ean` varchar(15) NOT NULL DEFAULT '',
`stock` int(11) NOT NULL DEFAULT '0',
`image` varchar(255) NOT NULL DEFAULT '',
`image_small` varchar(255) NOT NULL DEFAULT '',
Expand Down
43 changes: 32 additions & 11 deletions admin/language/en-GB/en-GB.com_phocacart.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@ COM_PHOCACART_ORDER_PAYMENT_PROCESSED_DOWNLOADABLE_ITEMS_ADDITIONAL_INFO=""
COM_PHOCACART_ORDER_PAYMENT_CANCELED_ADDITIONAL_INFO=""


;[3.5.4]
COM_PHOCACART_INFO_VIEW_LABEL="Info View"
COM_PHOCACART_FIELD_INFO_VIEW_DESCRIPTION_LABEL="Info View Description"
COM_PHOCACART_FIELD_INFO_VIEW_DESCRIPTION_DESC="Set Info View description"
COM_PHOCACART_YES_ADVANCED_STOCK_MANAGEMENT="Yes (Advanced Stock Management)"
COM_PHOCACART_FIELD_DYNAMIC_CHANGE_URL_ATTRIBUTES_LABEL="Interactive Change (Attributes in URL)"
COM_PHOCACART_FIELD_DYNAMIC_CHANGE_URL_ATTRIBUTES_DESC="Set if attributes in URL will be changed dynamically when changing the attribute options in Item view."
COM_PHOCACART_FIELD_SQL_SEARCH_SKIP_ID_ATTRIBUTES_LABEL="SQL - Search - Skip Attribute ID"
COM_PHOCACART_FIELD_SQL_SEARCH_SKIP_ID_ATTRIBUTES_DESC="Skip product attribute ID (SKU, EAN used in Advanced Stock Management) search in SQL queries when searching products."
COM_PHOCACART_FIELD_REMOVE_SHIPPING_METHOD_CHANGE_LABEL="Remove Shipping Method (Change)"
COM_PHOCACART_FIELD_REMOVE_SHIPPING_METHOD_CHANGE_DESC="Remove shipping method in checkout when cart is changed (added or removed product, updated quantity, etc.). If set to 'No', shipping method will be checked at each change and will only be removed if it does not comply with the shipping method rules."
COM_PHOCACART_FIELD_REMOVE_PAYMENT_METHOD_CHANGE_LABEL="Remove Payment Method (Change)"
COM_PHOCACART_FIELD_REMOVE_PAYMENT_METHOD_CHANGE_DESC="Remove payment method in checkout when cart is changed (added or removed product, updated quantity, etc.). If set to 'No', payment method will be checked at each change and will only be removed if it does not comply with the payment method rules."
COM_PHOCACART_ADVANCED_STOCK_AND_PRICE_MANAGEMENT="Advanced Stock And Price Management"
COM_PHOCACART_ONLY_STOCK_VALUES_ARE_ACTIVE="Only stock values are active (price values are ignored)"
COM_PHOCACART_STOCK_VALUES_AND_PRICE_VALUES_ARE_ACTIVE="Stock values and price values are active"
COM_PHOCACART_PRICE_VALUES_OVERWRITE_CUSTOMER_GROUP_PRICES="Be aware, price values overwrite customer group prices."
COM_PHOCACART_FIELD_DYNAMIC_CHANGE_ID_LABEL="Interactive Change (ID)"
COM_PHOCACART_FIELD_DYNAMIC_CHANGE_ID_DESC="Set if displayed ID (SKU, EAN) will be changed dynamically when changing the attribute options"
COM_PHOCACART_FIELD_FEATURED_PRODUCT_BACKGROUND_IMAGE_LABEL="Featured Product Background Image"
COM_PHOCACART_FIELD_FEATURED_PRODUCT_BACKGROUND_IMAGE_DESC="Set featured product background image"

;[3.5.3]
COM_PHOCACART_FIELD_QUEUE_NUMBER_LENGTH_LABEL="Queue Number Length"
Expand Down Expand Up @@ -406,25 +427,25 @@ COM_PHOCACART_FIELD_SKIP_CATEGORY_VIEW_DESC="If yes, Items view will be displaye
COM_PHOCACART_FIELD_CATEGORY_ICON_CLASS_LABEL="Icon Class"
COM_PHOCACART_FIELD_CATEGORY_ICON_CLASS_DESC="Set icon class"
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_ACCESS_LABEL="SQL - Products - Skip Access"
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_ACCESS_DESC="Skip access level check in sql queries when loading products."
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_ACCESS_DESC="Skip access level check in SQL queries when loading products."
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_GROUP_LABEL="SQL - Products - Skip Customer Group"
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_GROUP_DESC="Skip customer group check in sql queries when loading products."
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_GROUP_DESC="Skip customer group check in SQL queries when loading products."
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_ATTRIBUTES_LABEL="SQL - Products - Skip Attributes"
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_ATTRIBUTES_DESC="Skip loading of attributes in sql queries when loading products."
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_ATTRIBUTES_DESC="Skip loading of attributes in SQL queries when loading products."
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_CATEGORY_TYPE_LABEL="SQL - Products - Skip Category Type"
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_CATEGORY_TYPE_DESC="Skip category type check in sql queries when loading products."
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_CATEGORY_TYPE_DESC="Skip category type check in SQL queries when loading products."
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_TAX_LABEL="SQL - Products - Skip Tax"
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_TAX_DESC="Skip loading of tax information in sql queries when loading products."
COM_PHOCACART_FIELD_SQL_PRODUCTS_SKIP_TAX_DESC="Skip loading of tax information in SQL queries when loading products."
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_ACCESS_LABEL="SQL - Product - Skip Access"
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_ACCESS_DESC="Skip access level check in sql queries when loading product."
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_ACCESS_DESC="Skip access level check in SQL queries when loading product."
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_GROUP_LABEL="SQL - Product - Skip Customer Group"
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_GROUP_DESC="Skip customer group check in sql queries when loading product."
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_GROUP_DESC="Skip customer group check in SQL queries when loading product."
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_ATTRIBUTES_LABEL="SQL - Product - Skip Attributes"
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_ATTRIBUTES_DESC="Skip loading of attributes in sql queries when loading product."
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_ATTRIBUTES_DESC="Skip loading of attributes in SQL queries when loading product."
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_CATEGORY_TYPE_LABEL="SQL - Product - Skip Category Type"
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_CATEGORY_TYPE_DESC="Skip category type check in sql queries when loading product."
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_CATEGORY_TYPE_DESC="Skip category type check in SQL queries when loading product."
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_TAX_LABEL="SQL - Product - Skip Tax"
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_TAX_DESC="Skip loading of tax information in sql queries when loading product."
COM_PHOCACART_FIELD_SQL_PRODUCT_SKIP_TAX_DESC="Skip loading of tax information in SQL queries when loading product."
COM_PHOCACART_CLEAR_ALL="Clear all"
COM_PHOCACART_FIELD_DISPLAY_PAGINATION_LABELS_CATEGORY_ITEMS_VIEW_LABEL="Display Pagination Labels"
COM_PHOCACART_FIELD_DISPLAY_PAGINATION_LABELS_CATEGORY_ITEMS_VIEW_DESC="Display or hide pagination labels"
Expand Down Expand Up @@ -1595,7 +1616,7 @@ COM_PHOCACART_FIELD_ZERO_PAYMENT_PRICE_DESC="Set the value which will be display
COM_PHOCACART_DISPLAY_PRICE="Display price"
COM_PHOCACART_DISPLAY_NOTHING="Display nothing"
COM_PHOCACART_DISPLAY_FREE_TEXT="Display "_QQ_"Free"_QQ_" text"
; For Translators - free means "for free" - gratis, kostenlos/gratis/frei, gratuit, бесплатно, zdarma
; For Translators - free means "for free" - gratis, kostenlos/gratis/frei, gratuit, беѝплатно, zdarma
COM_PHOCACART_FREE="Free"
COM_PHOCACART_UPC="UPC"
COM_PHOCACART_EAN="EAN"
Expand Down
70 changes: 66 additions & 4 deletions admin/libraries/phocacart/attribute/attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -1289,6 +1289,10 @@ public static function makeCombination($array, $requiredArray) {
$current['product_key'] = $key;
$current['product_title'] = $current['product_title'];
$current['stock'] = 0;
$current['price'] = '';
$current['ean'] = '';
$current['sku'] = '';
$current['image'] = '';


/*
Expand Down Expand Up @@ -1373,17 +1377,21 @@ public static function getCombinations($id, $title, $attributes, &$combinations
$pI[$pIPK]['attributes'] = array();
$pI[$pIPK]['product_key'] = $pIPK;
$pI[$pIPK]['stock'] = 0;
$pI[$pIPK]['price'] = '';
$pI[$pIPK]['sku'] = '';
$pI[$pIPK]['ean'] = '';
$pI[$pIPK]['image'] = '';
}

$combinations = array_merge($pI, $pA);
return true;

}

public static function getCombinationsStockByProductId($id) {
public static function getCombinationsDataByProductId($id) {
if ($id > 0) {
$db = JFactory::getDBO();
$query = ' SELECT a.product_id, a.product_key, a.stock'
$query = ' SELECT a.product_id, a.product_key, a.stock, a.price, a.sku, a.ean, a.image'
. ' FROM #__phocacart_product_stock AS a'
. ' WHERE a.product_id = ' . (int)$id
. ' ORDER BY a.id';
Expand All @@ -1402,6 +1410,21 @@ public static function getCombinationsStockByProductId($id) {
return false;
}

public static function getCombinationsDataByKey($productKey) {

$db = JFactory::getDBO();

$query = 'SELECT product_id, product_key, stock, price, sku, ean, image'
. ' FROM #__phocacart_product_stock'
. ' WHERE product_key = ' . $db->quote($productKey)
. ' ORDER BY product_key'
. ' LIMIT 1';
$db->setQuery($query);
$data = $db->loadAssoc();

return $data;
}

public static function getCombinationsStockByKey($productKey) {

$db = JFactory::getDBO();
Expand All @@ -1421,6 +1444,25 @@ public static function getCombinationsStockByKey($productKey) {
return 0;
}

public static function getCombinationsPriceByKey($productKey) {

$db = JFactory::getDBO();

$query = 'SELECT price'
. ' FROM #__phocacart_product_stock'
. ' WHERE product_key = ' . $db->quote($productKey)
. ' ORDER BY product_key'
. ' LIMIT 1';
$db->setQuery($query);
$price = $db->loadResult();

if (isset($price) && $price > 0) {
return $price;
}

return 0;
}


public static function getCombinationsStockById($productId, $returnArray = 0) {

Expand Down Expand Up @@ -1483,6 +1525,22 @@ public static function storeCombinationsById($productId, $aosArray, $new = 0) {
$v['stock'] = '';
}

if (empty($v['price'])) {
$v['price'] = '';
}

if (empty($v['sku'])) {
$v['sku'] = '';
}

if (empty($v['ean'])) {
$v['ean'] = '';
}

if (empty($v['image'])) {
$v['image'] = '';
}

if ($v['product_key'] == '') {
continue;
}
Expand All @@ -1509,6 +1567,10 @@ public static function storeCombinationsById($productId, $aosArray, $new = 0) {
. ' product_id = ' . (int)$productId . ','
. ' product_key = ' . $db->quote($v['product_key']) . ','
. ' stock = ' . (int)$v['stock'] . ','
. ' price = ' . $db->quote($v['price']) . ','
. ' sku = ' . $db->quote($v['sku']) . ','
. ' ean = ' . $db->quote($v['ean']) . ','
. ' image = ' . $db->quote($v['image']) . ','
. ' WHERE id = ' . (int)$idExists;
$db->setQuery($query);
$db->execute();
Expand All @@ -1517,10 +1579,10 @@ public static function storeCombinationsById($productId, $aosArray, $new = 0) {

} else {

$values = '(' . (int)$productId . ', ' . $db->quote($v['product_key']) . ', ' . $db->quote($v['attributes']) . ', ' . (int)$v['stock'] . ')';
$values = '(' . (int)$productId . ', ' . $db->quote($v['product_key']) . ', ' . $db->quote($v['attributes']) . ', ' . (int)$v['stock'] . ', ' . (int)$v['price']. ', ' . (int)$v['sku']. ', ' . (int)$v['ean']. ', '.$db->quote($v['image']).')';


$query = ' INSERT INTO #__phocacart_product_stock (product_id, product_key, attributes, stock)'
$query = ' INSERT INTO #__phocacart_product_stock (product_id, product_key, attributes, stock, price, sku, ean, image)'
. ' VALUES ' . $values;
$db->setQuery($query);
$db->execute();
Expand Down
Loading

0 comments on commit 9eda8a8

Please sign in to comment.