-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.11
Hi,
we would like users to have only one cart, but they are allowed to have multiple wishlists.
In the configuration we've switched "Enable multi carts" to NO and "Enable multi wishlists" to YES, but this doesn't work entirely. Users can move products to different wishlists, the problem is that there is no way to access the different wishlists as the listing page is inaccessible, both the "Cart listing" menu item with wishlist selected and in the user cpanel "Wishlists" will not redirect to a listing but directly to only one wishlist.
We can see in the sourcecode this is because both multicart and multiwishlist must be true to be able to see the wislist listing page. This means at the moment you only have 3 options: multicart/multiwishlist, multicart/singlewishlist or singlecart/singlewishlist.
We would like to propose making the configuration settings "Enable multi carts" and "Enable multi wishlists" independent of each other so the option singlecart/multiwishlist is also possible.
We've had a look at the code and the changes appear to be only a few to make this work:
In views/user/view.html.php change line 82 from
if($config->get('enable_multicart') && $config->get('enable_multiwishlist', 1))
to
if($config->get('enable_multiwishlist', 1))
In controllers/cart.php change line 196 from
if($cart_type == 'wishlist' && $multi_cart)
to
if($cart_type == 'wishlist')
In views/cart/view.html.php change line 423 from
if($cart->cart_type == 'wishlist' && $multi_cart)
to
if($cart->cart_type == 'wishlist')
And perhaps a small mistake we found on line 285, instead of
$multi_wishlist = (int)$config->get('enable_wishlist', 1);
should this be
$multi_wishlist = (int)$config->get('enable_multiwishlist', 1);
Thanks.