Carts are displayed instead of Wishlists

  • Posts: 69
  • Thank you received: 11
11 years 10 months ago #85317

Joomla 2.5.
Hikashop 2.0.0


I had the wishlists and carts working properly and I'm not sure when ( we did 2 updates since then and installed Hikamarket ) they stopped working properly.

Currently, if I go to:

http://localhost/made/index.php?option=com_hikashop&ctrl=cart&task=showcarts&cart_type=wishlist&Itemid=512&lang=es

It will show CARTS, not WISHLISTS. --> Note that the cart_type var is specifying "wishlist".

I checked the code and, on line #279 of front_End../views/cart/view.html.php I see the following code.

                if(empty($cart_type)){
			if (is_object( $menu )) {
				$cart_type = $menu->params->get('cart_type');
				JRequest::setVar('cart_type',$cart_type);
			}
		}
		if(empty($cart_type)){
			$cart_type = JRequest::getString('cart_type','cart');
		}

I thought the order is causing HS to always set the cart type to "cart". I changed the order of the to IFs to:
                if(empty($cart_type)){
			$cart_type = JRequest::getString('cart_type','cart');
		}
                if(empty($cart_type)){
			if (is_object( $menu )) {
				$cart_type = $menu->params->get('cart_type');
				JRequest::setVar('cart_type',$cart_type);
			}
		}
		

This worked and I was able to get my carts and wishlist displaying according to the cart_type specified.

Q: is this the correct thing to do to get it fixed?


Eduardo Chongkan - Likan Development
http://likandevelopment.com
Last edit: 11 years 10 months ago by likandev. Reason: Added Joomla and HS versions

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #85403

Hi,

Thanks for the report.
You should better use this correction:

              if(empty($cart_type)){
			if (is_object( $menu ) && !empty($menu->params->get('cart_type'))) {
				$cart_type = $menu->params->get('cart_type');
				JRequest::setVar('cart_type',$cart_type);
			}else{
                                $cart_type = JRequest::getString('cart_type','cart');
                         }
		}

The following user(s) said Thank You: likandev

Please Log in or Create an account to join the conversation.

  • Posts: 69
  • Thank you received: 11
11 years 10 months ago #85542

I tried it but it returns:

Fatal error: Can't use method return value in write context in ..components/com_hikashop/views/cart/view.html.php on line 281


Eduardo Chongkan - Likan Development
http://likandevelopment.com

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #85600

Yes, my mistake.

              if(empty($cart_type)){
			if (is_object( $menu )) {
				$cart_type = $menu->params->get('cart_type');
                        }
                        if(!empty($cart_type){
				JRequest::setVar('cart_type',$cart_type);
			}else{
                                $cart_type = JRequest::getString('cart_type','cart');
                         }
		}

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 2
11 years 10 months ago #86482

Hey, thanks a lot, I also used your fix (switching the order) and it worked. Please post if you encounter any bugs and I will do the same.

Last edit: 11 years 10 months ago by ricalex.

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 2
11 years 10 months ago #86483

Bug encountered, when I click on the wishlist ID, it shows a blank list. Any Ideas?

Please Log in or Create an account to join the conversation.

  • Posts: 69
  • Thank you received: 11
11 years 10 months ago #86484

It doesn't happen to me, I click on the ID / Name, and it takes me to the wishlist details.

I ended up using my code, not Xavier's because I didn't have time that day to wait for the fix, since it worked I didn't test Xavier's last suggestion.

What code are you using?


Eduardo Chongkan - Likan Development
http://likandevelopment.com
The following user(s) said Thank You: ricalex

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 2
11 years 10 months ago #86552

I used your idea, just switching stuff around. the Id not working is a bummer though....I hope an admin can help.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #86725

Have you tried my latest given code ?

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 2
11 years 10 months ago #86733

I tried your latest code on line 279 and it's giving me a HTTP Error 500

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #86735

Can you give me this 500 error ?

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 2
11 years 10 months ago #86736

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

this is how the code looks in the site:


$menu = $menus->getItem($Itemid);
}
}
if(empty($cart_type)){
if (is_object( $menu )) {
$cart_type = $menu->params->get('cart_type');
}
if(!empty($cart_type){
JRequest::setVar('cart_type',$cart_type);
}else{
$cart_type = JRequest::getString('cart_type','cart');
}
}
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo

Please Log in or Create an account to join the conversation.

  • Posts: 69
  • Thank you received: 11
11 years 10 months ago #86880

You have a syntax error, missing ")" on the second IF

Use this code: (Xavier's)

                    if(empty($cart_type)){
			if (is_object( $menu )) {
				$cart_type = $menu->params->get('cart_type');
			}
			if(!empty($cart_type)) { 
				JRequest::setVar('cart_type',$cart_type);
			}else{
				$cart_type = JRequest::getString('cart_type','cart');
			}
		}

I also recommend you to use a good IDE or editor, one that points syntax errors.

I use Aptana, but I think Notepad++ also works.


Eduardo Chongkan - Likan Development
http://likandevelopment.com
Last edit: 11 years 10 months ago by likandev.
The following user(s) said Thank You: ricalex

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 2
11 years 9 months ago #88516

Thanks, I added the code that was missing, but it's still not working for me.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 9 months ago #88560

The correction will be in the next release which should arrive soon.
Thanks to wait for it, and then tell us if the problem is solved.

Please Log in or Create an account to join the conversation.

  • Posts: 15
  • Thank you received: 2
11 years 9 months ago #88604

Thanks. I will let you know.

Please Log in or Create an account to join the conversation.

  • Posts: 84
  • Thank you received: 1
11 years 8 months ago #93028

I'm experiencing some of these problems as well. Wishlist list page shows cart list. Is there a solid fix/update for this?

Please Log in or Create an account to join the conversation.

  • Posts: 84
  • Thank you received: 1
11 years 8 months ago #93036

ok, downloaded the todays latest version and seems to work fine now. Thanks.

Please Log in or Create an account to join the conversation.

Time to create page: 0.114 seconds
Powered by Kunena Forum