Skip to main content

Error in the backend of the module cart

More
8 years 4 weeks ago #297331 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
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'); } } }
In my case $this->element = 1, look at the picture.


When I log some variables:
Code:
error_log('small_cart = '.$this->element['small_cart']);) error_log('show_cart_proceed = '.$this->element['show_cart_proceed']);
I can see:
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.

More
8 years 4 weeks ago #297349 by Mohamed Thelji
Hello,

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.

More
8 years 4 weeks ago - 8 years 4 weeks ago #297368 by almika
Thank you, Mohamed Thelji
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
Powered by Kunena Forum