Skip to main content

Carts are displayed instead of Wishlists

More
13 years 8 months ago - 13 years 8 months ago #85317 by likandev
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.
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:
Code:
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
likandevelopment.com
Last edit: 13 years 8 months ago by likandev. Reason: Added Joomla and HS versions

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

More
13 years 8 months ago #85403 by Xavier
Hi,

Thanks for the report.
You should better use this correction:
Code:
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.

More
13 years 8 months ago #85542 by likandev
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
likandevelopment.com

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

More
13 years 8 months ago #85600 by Xavier
Yes, my mistake.
Code:
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.

More
13 years 8 months ago - 13 years 8 months ago #86482 by ricalex
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: 13 years 8 months ago by ricalex.

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

More
13 years 8 months ago #86483 by ricalex
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.

More
13 years 8 months ago #86484 by likandev
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
likandevelopment.com
The following user(s) said Thank You: ricalex

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

More
13 years 8 months ago #86552 by ricalex
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.

More
13 years 8 months ago #86725 by Xavier
Have you tried my latest given code ?

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

More
13 years 8 months ago #86733 by ricalex
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.

More
13 years 8 months ago #86735 by Xavier
Can you give me this 500 error ?

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

More
13 years 8 months ago #86736 by ricalex
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.

More
13 years 8 months ago - 13 years 8 months ago #86880 by likandev
You have a syntax error, missing ")" on the second IF

Use this code: (Xavier's)
Code:
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
likandevelopment.com
Last edit: 13 years 8 months ago by likandev.
The following user(s) said Thank You: ricalex

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

More
13 years 7 months ago #88516 by ricalex
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.

More
13 years 7 months ago #88560 by Xavier
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.

More
13 years 7 months ago #88604 by ricalex
Thanks. I will let you know.

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

More
13 years 6 months ago #93028 by goloon
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.

More
13 years 6 months ago #93036 by goloon
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.332 seconds
Powered by Kunena Forum