Skip to content

Commit

Permalink
4.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
PhocaCz committed May 4, 2023
1 parent b19aa3d commit 81115e4
Show file tree
Hide file tree
Showing 17 changed files with 181 additions and 95 deletions.
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Phoca Cart is e-commerce extension - powerful shopping cart for Joomla! CMS. Pho

## Version (Joomla! 4.x)

4.0.6
4.0.7



Expand Down
1 change: 1 addition & 0 deletions admin/controllers/phocacartexport.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
require_once JPATH_COMPONENT.'/controllers/phocacartcommon.php';
class PhocaCartCpControllerPhocaCartExport extends PhocaCartCpControllerPhocaCartCommon {

public $t;

public function export() {

Expand Down
2 changes: 2 additions & 0 deletions admin/controllers/phocacartimport.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
class PhocaCartCpControllerPhocaCartImport extends PhocaCartCpControllerPhocaCartCommon {


public $t;

public function import() {


Expand Down
145 changes: 75 additions & 70 deletions admin/install/sql/mysql/uninstall.utf8.sql
Original file line number Diff line number Diff line change
@@ -1,91 +1,96 @@
-- Revision done 4.0.7
DROP TABLE IF EXISTS `#__phocacart_attributes`;
DROP TABLE IF EXISTS `#__phocacart_attribute_values`;
DROP TABLE IF EXISTS `#__phocacart_bulk_prices`;
DROP TABLE IF EXISTS `#__phocacart_cart_multiple`;
DROP TABLE IF EXISTS `#__phocacart_categories`;
DROP TABLE IF EXISTS `#__phocacart_category_access`;
DROP TABLE IF EXISTS `#__phocacart_countries`;
DROP TABLE IF EXISTS `#__phocacart_coupons`;
DROP TABLE IF EXISTS `#__phocacart_coupon_categories`;
DROP TABLE IF EXISTS `#__phocacart_coupon_count`;
DROP TABLE IF EXISTS `#__phocacart_coupon_count_user`;
DROP TABLE IF EXISTS `#__phocacart_coupon_products`;
DROP TABLE IF EXISTS `#__phocacart_currencies`;
DROP TABLE IF EXISTS `#__phocacart_discounts`;
DROP TABLE IF EXISTS `#__phocacart_discount_products`;
DROP TABLE IF EXISTS `#__phocacart_discount_categories`;
DROP TABLE IF EXISTS `#__phocacart_export`;
DROP TABLE IF EXISTS `#__phocacart_feeds`;
DROP TABLE IF EXISTS `#__phocacart_form_fields`;
DROP TABLE IF EXISTS `#__phocacart_groups`;
DROP TABLE IF EXISTS `#__phocacart_hits`;
DROP TABLE IF EXISTS `#__phocacart_import`;
DROP TABLE IF EXISTS `#__phocacart_item_access`;
DROP TABLE IF EXISTS `#__phocacart_item_groups`;
DROP TABLE IF EXISTS `#__phocacart_logs`;
DROP TABLE IF EXISTS `#__phocacart_manufacturers`;
DROP TABLE IF EXISTS `#__phocacart_opening_times`;
DROP TABLE IF EXISTS `#__phocacart_orders`;
DROP TABLE IF EXISTS `#__phocacart_order_attributes`;
DROP TABLE IF EXISTS `#__phocacart_order_coupons`;
DROP TABLE IF EXISTS `#__phocacart_order_discounts`;
DROP TABLE IF EXISTS `#__phocacart_order_downloads`;
DROP TABLE IF EXISTS `#__phocacart_order_history`;
DROP TABLE IF EXISTS `#__phocacart_order_products`;
DROP TABLE IF EXISTS `#__phocacart_order_product_discounts`;
DROP TABLE IF EXISTS `#__phocacart_order_statuses`;
DROP TABLE IF EXISTS `#__phocacart_order_tax_recapitulation`;
DROP TABLE IF EXISTS `#__phocacart_order_total`;
DROP TABLE IF EXISTS `#__phocacart_order_users`;
DROP TABLE IF EXISTS `#__phocacart_parameters`;
DROP TABLE IF EXISTS `#__phocacart_parameter_values`;
DROP TABLE IF EXISTS `#__phocacart_parameter_values_related`;
DROP TABLE IF EXISTS `#__phocacart_payment_methods`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_countries`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_currencies`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_regions`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_shipping`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_zones`;
DROP TABLE IF EXISTS `#__phocacart_products`;
DROP TABLE IF EXISTS `#__phocacart_product_categories`;
DROP TABLE IF EXISTS `#__phocacart_product_discounts`;
DROP TABLE IF EXISTS `#__phocacart_product_featured`;
DROP TABLE IF EXISTS `#__phocacart_product_images`;
DROP TABLE IF EXISTS `#__phocacart_product_files`;
DROP TABLE IF EXISTS `#__phocacart_product_access`;
DROP TABLE IF EXISTS `#__phocacart_product_discounts`;
DROP TABLE IF EXISTS `#__phocacart_product_discount_access`;
DROP TABLE IF EXISTS `#__phocacart_product_price_groups`;
DROP TABLE IF EXISTS `#__phocacart_product_images`;
DROP TABLE IF EXISTS `#__phocacart_product_point_groups`;
DROP TABLE IF EXISTS `#__phocacart_product_price_groups`;
DROP TABLE IF EXISTS `#__phocacart_product_price_history`;
DROP TABLE IF EXISTS `#__phocacart_product_stock`;
DROP TABLE IF EXISTS `#__phocacart_attributes`;
DROP TABLE IF EXISTS `#__phocacart_attribute_values`;
DROP TABLE IF EXISTS `#__phocacart_specifications`;
DROP TABLE IF EXISTS `#__phocacart_specification_groups`;
DROP TABLE IF EXISTS `#__phocacart_product_related`;
DROP TABLE IF EXISTS `#__phocacart_product_stock`;
DROP TABLE IF EXISTS `#__phocacart_questions`;
DROP TABLE IF EXISTS `#__phocacart_regions`;
DROP TABLE IF EXISTS `#__phocacart_reviews`;
DROP TABLE IF EXISTS `#__phocacart_reward_points`;
DROP TABLE IF EXISTS `#__phocacart_sections`;
DROP TABLE IF EXISTS `#__phocacart_shipping_methods`;
DROP TABLE IF EXISTS `#__phocacart_shipping_method_countries`;
DROP TABLE IF EXISTS `#__phocacart_shipping_method_regions`;
DROP TABLE IF EXISTS `#__phocacart_shipping_method_zones`;
DROP TABLE IF EXISTS `#__phocacart_shipping_method_access`;
DROP TABLE IF EXISTS `#__phocacart_countries`;
DROP TABLE IF EXISTS `#__phocacart_regions`;
DROP TABLE IF EXISTS `#__phocacart_zones`;
DROP TABLE IF EXISTS `#__phocacart_zone_countries`;
DROP TABLE IF EXISTS `#__phocacart_zone_regions`;
DROP TABLE IF EXISTS `#__phocacart_manufacturers`;
DROP TABLE IF EXISTS `#__phocacart_specifications`;
DROP TABLE IF EXISTS `#__phocacart_specification_groups`;
DROP TABLE IF EXISTS `#__phocacart_stock_statuses`;
DROP TABLE IF EXISTS `#__phocacart_submit_items`;
DROP TABLE IF EXISTS `#__phocacart_taglabels_related`;
DROP TABLE IF EXISTS `#__phocacart_tags`;
DROP TABLE IF EXISTS `#__phocacart_tags_related`;
DROP TABLE IF EXISTS `#__phocacart_taglabels_related`;
DROP TABLE IF EXISTS `#__phocacart_parameters`;
DROP TABLE IF EXISTS `#__phocacart_parameter_values`;
DROP TABLE IF EXISTS `#__phocacart_parameter_values_related`;
DROP TABLE IF EXISTS `#__phocacart_taxes`;
DROP TABLE IF EXISTS `#__phocacart_tax_countries`;
DROP TABLE IF EXISTS `#__phocacart_tax_plugins`;
DROP TABLE IF EXISTS `#__phocacart_tax_regions`;
DROP TABLE IF EXISTS `#__phocacart_currencies`;
DROP TABLE IF EXISTS `#__phocacart_coupons`;
DROP TABLE IF EXISTS `#__phocacart_coupon_count`;
DROP TABLE IF EXISTS `#__phocacart_coupon_count_user`;
DROP TABLE IF EXISTS `#__phocacart_coupon_products`;
DROP TABLE IF EXISTS `#__phocacart_coupon_categories`;
DROP TABLE IF EXISTS `#__phocacart_units`;
DROP TABLE IF EXISTS `#__phocacart_users`;
DROP TABLE IF EXISTS `#__phocacart_vendors`;
DROP TABLE IF EXISTS `#__phocacart_wishlists`;
DROP TABLE IF EXISTS `#__phocacart_zones`;
DROP TABLE IF EXISTS `#__phocacart_zone_countries`;
DROP TABLE IF EXISTS `#__phocacart_zone_regions`;

-- Obsolete
DROP TABLE IF EXISTS `#__phocacart_cart`;
DROP TABLE IF EXISTS `#__phocacart_category_access`;
DROP TABLE IF EXISTS `#__phocacart_coupon_access`;
DROP TABLE IF EXISTS `#__phocacart_discounts`;
DROP TABLE IF EXISTS `#__phocacart_discount_products`;
DROP TABLE IF EXISTS `#__phocacart_discount_categories`;
DROP TABLE IF EXISTS `#__phocacart_discount_access`;
DROP TABLE IF EXISTS `#__phocacart_payment_methods`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_countries`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_regions`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_zones`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_shipping`;
DROP TABLE IF EXISTS `#__phocacart_payment_method_access`;
DROP TABLE IF EXISTS `#__phocacart_reviews`;
DROP TABLE IF EXISTS `#__phocacart_form_fields`;
DROP TABLE IF EXISTS `#__phocacart_users`;
DROP TABLE IF EXISTS `#__phocacart_cart`;
DROP TABLE IF EXISTS `#__phocacart_cart_multiple`;
DROP TABLE IF EXISTS `#__phocacart_order_statuses`;
DROP TABLE IF EXISTS `#__phocacart_orders`;
DROP TABLE IF EXISTS `#__phocacart_order_users`;
DROP TABLE IF EXISTS `#__phocacart_order_products`;
DROP TABLE IF EXISTS `#__phocacart_order_attributes`;
DROP TABLE IF EXISTS `#__phocacart_order_coupons`;
DROP TABLE IF EXISTS `#__phocacart_order_total`;
DROP TABLE IF EXISTS `#__phocacart_order_tax_recapitulation`;
DROP TABLE IF EXISTS `#__phocacart_order_history`;
DROP TABLE IF EXISTS `#__phocacart_order_downloads`;
DROP TABLE IF EXISTS `#__phocacart_order_discounts`;
DROP TABLE IF EXISTS `#__phocacart_order_product_discounts`;
DROP TABLE IF EXISTS `#__phocacart_logs`;
DROP TABLE IF EXISTS `#__phocacart_feeds`;
DROP TABLE IF EXISTS `#__phocacart_wishlists`;
DROP TABLE IF EXISTS `#__phocacart_questions`;
DROP TABLE IF EXISTS `#__phocacart_hits`;
DROP TABLE IF EXISTS `#__phocacart_groups`;
DROP TABLE IF EXISTS `#__phocacart_item_groups`;
DROP TABLE IF EXISTS `#__phocacart_reward_points`;
DROP TABLE IF EXISTS `#__phocacart_item_access`;
DROP TABLE IF EXISTS `#__phocacart_export`;
DROP TABLE IF EXISTS `#__phocacart_import`;
DROP TABLE IF EXISTS `#__phocacart_vendors`;
DROP TABLE IF EXISTS `#__phocacart_sections`;
DROP TABLE IF EXISTS `#__phocacart_units`;
DROP TABLE IF EXISTS `#__phocacart_opening_times`;
DROP TABLE IF EXISTS `#__phocacart_submit_items`;
DROP TABLE IF EXISTS `#__phocacart_bulk_prices`;
DROP TABLE IF EXISTS `#__phocacart_product_access`;
DROP TABLE IF EXISTS `#__phocacart_product_discount_access`;
DROP TABLE IF EXISTS `#__phocacart_shipping_method_access`;
2 changes: 2 additions & 0 deletions admin/language/en-GB/en-GB.com_phocacart.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ COM_PHOCACART_ORDER_PAYMENT_PROCESSED_ADDITIONAL_INFO=""
COM_PHOCACART_ORDER_PAYMENT_PROCESSED_DOWNLOADABLE_ITEMS_ADDITIONAL_INFO=""
COM_PHOCACART_ORDER_PAYMENT_CANCELED_ADDITIONAL_INFO=""

;[4.0.7]
COM_PHOCACART_FIELD_HIDE_TAX_DESC="If tax calculation is enabled (prices include tax), the tax or netto item can be hidden for different views. Select in which views the tax or netto item will not be displayed - it only applies to this tax."
;[4.0.6]
COM_PHOCACART_FIELD_CURRENCY_LABEL="Currency"
COM_PHOCACART_FIELD_CURRENCY_DESC="Select currency"
Expand Down
26 changes: 13 additions & 13 deletions admin/layouts/product_export.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;


// Specific function for CSV
Expand Down Expand Up @@ -338,7 +338,7 @@ function str_putcsv($input, $delimiter = ';', $enclosure = '"') {
}

if (isset($v[$col])) {
$iP[] = $t1 . '<'.strip_tags($iCN[$k2]).$title.'>' . $l . $v[$col] . $r. '</'.strip_tags($iCN[$k2]).'>';
$iP[] = $t1 . '<'.strip_tags($iCN[$k2]).$title.'>' . $l . htmlspecialchars($v[$col], ENT_XML1) . $r. '</'.strip_tags($iCN[$k2]).'>';
}
} else {
$iP[] = $v[$col];
Expand Down Expand Up @@ -446,7 +446,7 @@ function str_putcsv($input, $delimiter = ';', $enclosure = '"') {
if ($xml) {
$iP[] = $t2 . '<attribute>';
$iP[] = $t3 . '<id>'.$vX->id.'</id>';
$iP[] = $t3 . '<title>'.$vX->title.'</title>';
$iP[] = $t3 . '<title>'.htmlspecialchars($vX->title, ENT_XML1).'</title>';
$iP[] = $t3 . '<alias>'.$vX->alias.'</alias>';
$iP[] = $t3 . '<required>'.$vX->required.'</required>';
$iP[] = $t3 . '<type>'.$vX->type.'</type>';
Expand All @@ -455,17 +455,17 @@ function str_putcsv($input, $delimiter = ';', $enclosure = '"') {
foreach($vX->options as $kX2 => $vX2) {
$iP[] = $t4 . '<option>';
$iP[] = $t5 . '<id>'.$vX2->id.'</id>';
$iP[] = $t5 . '<title>'.$vX2->title.'</title>';
$iP[] = $t5 . '<title>'.htmlspecialchars($vX2->title, ENT_XML1) .'</title>';
$iP[] = $t5 . '<alias>'.$vX2->alias.'</alias>';
$iP[] = $t5 . '<amount>'.$vX2->amount.'</amount>';
$iP[] = $t5 . '<operator>'.$vX2->operator.'</operator>';
$iP[] = $t5 . '<stock>'.$vX2->stock.'</stock>';
//$iP[] = $t5 . '<stock_calculation>'.$vX2->stock_calculation.'</stock_calculation>';
$iP[] = $t5 . '<operator_weight>'.$vX2->operator_weight.'</operator_weight>';
$iP[] = $t5 . '<weight>'.$vX2->weight.'</weight>';
$iP[] = $t5 . '<image>'.$vX2->image.'</image>';
$iP[] = $t5 . '<image_medium>'.$vX2->image_medium.'</image_medium>';
$iP[] = $t5 . '<image_small>'.$vX2->image_small.'</image_small>';
$iP[] = $t5 . '<image>'.htmlspecialchars($vX2->image, ENT_XML1) .'</image>';
$iP[] = $t5 . '<image_medium>'.htmlspecialchars($vX2->image_medium, ENT_XML1) .'</image_medium>';
$iP[] = $t5 . '<image_small>'.htmlspecialchars($vX2->image_small, ENT_XML1) .'</image_small>';
$iP[] = $t5 . '<download_folder>'.$vX2->download_folder.'</download_folder>';
$iP[] = $t5 . '<download_token>'.$vX2->download_token.'</download_token>';
$iP[] = $t5 . '<download_file>'.$vX2->download_file.'</download_file>';
Expand Down Expand Up @@ -515,7 +515,7 @@ function str_putcsv($input, $delimiter = ';', $enclosure = '"') {
$iP[] = $t2 . '<specification>';
$iP[] = $t3 . '<id>'.$vX['id'].'</id>';
$iP[] = $t3 . '<group_id>'.$vX['group_id'].'</group_id>';
$iP[] = $t3 . '<title>'.$vX['title'].'</title>';
$iP[] = $t3 . '<title>'.htmlspecialchars($vX['title'], ENT_XML1) .'</title>';
$iP[] = $t3 . '<alias>'.$vX['alias'].'</alias>';
$iP[] = $t3 . '<value>'.$vX['value'].'</value>';
$iP[] = $t3 . '<alias_value>'.$vX['alias_value'].'</alias_value>';
Expand Down Expand Up @@ -566,7 +566,7 @@ function str_putcsv($input, $delimiter = ';', $enclosure = '"') {
if ($xml) {
$iP[] = $t2 . '<discount>';
$iP[] = $t3 . '<id>'.$vX['id'].'</id>';
$iP[] = $t3 . '<title>'.$vX['title'].'</title>';
$iP[] = $t3 . '<title>'.htmlspecialchars($vX['title'], ENT_XML1) .'</title>';
$iP[] = $t3 . '<alias>'.$vX['alias'].'</alias>';
$iP[] = $t3 . '<discount>'.$vX['discount'].'</discount>';
$iP[] = $t3 . '<access>'.$vX['access'].'</access>';
Expand All @@ -583,7 +583,7 @@ function str_putcsv($input, $delimiter = ';', $enclosure = '"') {
foreach($groups as $kY => $vY) {
$iP[] = $t4 . '<group>';
$iP[] = $t5 . '<id>'.$vY['id'].'</id>';
$iP[] = $t5 . '<title>'.$vY['title'].'</title>';
$iP[] = $t5 . '<title>'.htmlspecialchars($vY['title'], ENT_XML1) .'</title>';
$iP[] = $t4 . '</group>';
}

Expand Down Expand Up @@ -787,7 +787,7 @@ function str_putcsv($input, $delimiter = ';', $enclosure = '"') {
if (!empty($pA)) {
$iP[] = $t2 . '<parameter>';
$iP[] = $t3 . '<id>'.$vX->id.'</id>';
$iP[] = $t3 . '<title>'.$vX->title.'</title>';
$iP[] = $t3 . '<title>'.htmlspecialchars($vX->title, ENT_XML1).'</title>';
$iP[] = $t3 . '<alias>'.$vX->alias.'</alias>';
$iP[] = $t3 . '<values>';
foreach($pA as $kX2 => $vX2) {
Expand Down Expand Up @@ -839,7 +839,7 @@ function str_putcsv($input, $delimiter = ';', $enclosure = '"') {
if ($xml) {
$iP[] = $t2 . '<group>';
$iP[] = $t3 . '<id>'.$vX['id'].'</id>';
$iP[] = $t3 . '<title>'.$vX['title'].'</title>';
$iP[] = $t3 . '<title>'.htmlspecialchars($vX['title'], ENT_XML1).'</title>';
$iP[] = $t2 . '</group>';
} else {
//$x[] = $vX['image'];
Expand Down
3 changes: 3 additions & 0 deletions admin/libraries/phocacart/category/multiple.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;

phocacartimport('phocacart.category.category');

class PhocacartCategoryMultiple
{
public static function getCategories($productId, $select = 0) {
Expand Down Expand Up @@ -454,6 +456,7 @@ public static function getCurrentCategoryId() {


public static function getCategoryChildrenString($id, $children = '') {

$categories = PhocaCartCategory::getChildren($id);
if ($categories) {
foreach ($categories as $v) {
Expand Down
2 changes: 2 additions & 0 deletions admin/libraries/phocacart/filter/filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ public function renderList(array $params = [])
$activeProductsSpecifications = array();
if ($this->limit_attributes_category == 1 || $this->limit_tags_category == 1 || $this->limit_labels_category == 1 || $this->limit_parameters_category == 1
|| $this->limit_price_category == 1 || $this->limit_manufacturers_category == 1 || $this->limit_specifications_category == 1) {


if ((int)$category['id'] > 0) {
$activeCategory[] = (int)$category['id'];

Expand Down
4 changes: 2 additions & 2 deletions admin/libraries/phocacart/order/order.php
Original file line number Diff line number Diff line change
Expand Up @@ -1521,15 +1521,15 @@ public function saveOrderProducts($d, $orderId) {

if (!$row->check()) {
//throw new Exception($row->getError());
$msg = Text::_($row->getErrorMsg());
$msg = Text::_($row->getError());
$app->enqueueMessage($msg, 'error');
return false;
}


if (!$row->store()) {
//throw new Exception($row->getError());
$msg = Text::_($row->getErrorMsg());
$msg = Text::_($row->getError());
$app->enqueueMessage($msg, 'error');
return false;
}
Expand Down
16 changes: 16 additions & 0 deletions admin/libraries/phocacart/product/product.php
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,22 @@ public static function storeProduct($data, $importColumn = 1)
$table->date = Factory::getDate()->toSql();
}

if(isset($table->manufacturer_id) && $table->manufacturer_id == '') {$table->manufacturer_id = 0;}
if(isset($table->type) && $table->type == '') {$table->type = 0;}
if(isset($table->min_quantity) && $table->min_quantity == '') {$table->min_quantity = 0;}
if(isset($table->min_multiple_quantity) && $table->min_multiple_quantity == '') {$table->min_multiple_quantity = 0;}
if(isset($table->min_quantity_calculation) && $table->min_quantity_calculation == '') {$table->min_quantity_calculation = 0;}
if(isset($table->condition) && $table->condition == '') {$table->condition = 0;}
if(isset($table->points_received) && $table->points_received == '') {$table->points_received = 0;}
if(isset($table->points_needed) && $table->points_needed == '') {$table->points_needed = 0;}
if(isset($table->stock_calculation) && $table->stock_calculation == '') {$table->stock_calculation = 0;}
if(isset($table->featured) && $table->featured == '') {$table->featured = 0;}
if(isset($table->tax_id) && $table->tax_id == '') {$table->tax_id = 0;}
if(isset($table->stock) && $table->stock == '') {$table->stock = 0;}
if(isset($table->modified_by) && $table->modified_by == '') {$table->modified_by = 0;}
if(isset($table->sales) && $table->sales == '') {$table->sales = 0;}
if(isset($table->sales) && $table->sales == '') {$table->sales = 0;}

if (!$table->check()) {
throw new Exception($table->getError());
return false;
Expand Down
Loading

0 comments on commit 81115e4

Please sign in to comment.