- Posts: 382
- Thank you received: 77
Error in the backend of the module cart
8 years 4 weeks ago #297331
by almika
Error in the backend of the module cart was created by almika
-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.12
Hi, Hikashop Team!
On the site the cart works perfectly.
But, in the settings of the cart module ih the backend, an error is displayed - You have to set at least one element to display in your module cart.
I'm using a mini cart. There should be no elements in it.
I suspect there is a logical error in the file \administrator\components\com_hikashop\views\cartmodules\view.html.php
In my case $this->element = 1, look at the picture.
When I log some variables:
I can see:
And HIKA_MOD_DISPLAY_ERROR is displayed:
if (($this->element == 0) && ($find == 0))
$error_message = JText::_('HIKA_MOD_DISPLAY_ERROR');
This is a bug?
Thank you
Best regards
-- Joomla version -- : 3.8.12
Hi, Hikashop Team!
On the site the cart works perfectly.
But, in the settings of the cart module ih the backend, an error is displayed - You have to set at least one element to display in your module cart.
I'm using a mini cart. There should be no elements in it.
I suspect there is a logical error in the file \administrator\components\com_hikashop\views\cartmodules\view.html.php
Code:
if ($this->element['small_cart'] != 0) {
$disaply_settings_array = array(
'image_in_cart' => $this->element['image_in_cart'],
'show_cart_quantity' => $this->element['show_cart_quantity'],
'show_cart_delete' => $this->element['show_cart_delete'],
'show_coupon' => $this->element['show_coupon'],
'show_shipping' => $this->element['show_shipping'],
'show_taxes' => @$this->element['show_taxes'],
'print_cart' => @$this->element['print_cart'],
);
$error_message = '';
$find= 0;
foreach($disaply_settings_array as $k => $v) {
if ($v == 1) {
$find = 1;
break;
}
}
if (($this->element['show_cart_proceed'] == 1) && ($find == 0))
$error_message = JText::_('HIKA_MOD_DISPLAY_ERROR_PROCEED');
if (($this->element['show_cart_proceed'] == 0) && ($find == 0))
$error_message = JText::_('HIKA_MOD_DISPLAY_ERROR');
if ($error_message != '') {
$app = JFactory::getApplication();
$app->enqueueMessage($error_message, 'error');
}
}
}
When I log some variables:
Code:
error_log('small_cart = '.$this->element['small_cart']);)
error_log('show_cart_proceed = '.$this->element['show_cart_proceed']);
Code:
[Thu Aug 30 11:28:58.815880 2018] [:error] [pid 11384:tid 956] [client 127.0.0.1:49281] small_cart = 1, referer: http://site/administrator/index.php?option=com_modules&view=modules
[Thu Aug 30 11:28:58.816380 2018] [:error] [pid 11384:tid 956] [client 127.0.0.1:49281] show_cart_proceed = 0, referer: http://site/administrator/index.php?option=com_modules&view=modules
And HIKA_MOD_DISPLAY_ERROR is displayed:
if (($this->element == 0) && ($find == 0))
$error_message = JText::_('HIKA_MOD_DISPLAY_ERROR');
This is a bug?
Thank you
Best regards
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
8 years 4 weeks ago #297349
by Mohamed Thelji
Replied by Mohamed Thelji on topic Error in the backend of the module cart
Hello,
We successfully reproduced that issue on our end and fixed it.
The solution will be to directly edit the following lines :
by :
Thank you for your feedback !
Kind regards,
Mohamed Thelji.
We successfully reproduced that issue on our end and fixed it.
The solution will be to directly edit the following lines :
Code:
if(empty($this->element['small_cart']))
by :
Code:
if(empty($this->element['small_cart']) || $this->element['small_cart'] == 1)
Thank you for your feedback !
Kind regards,
Mohamed Thelji.
The following user(s) said Thank You: almika
Please Log in or Create an account to join the conversation.
8 years 4 weeks ago - 8 years 4 weeks ago #297368
by almika
Replied by almika on topic Error in the backend of the module cart
Thank you, Mohamed Thelji
Best regards,
Best regards,
Last edit: 8 years 4 weeks ago by almika.
Please Log in or Create an account to join the conversation.
Time to create page: 0.167 seconds