- Posts: 6
- Thank you received: 0
Convert cart to wishlist
11 years 8 months ago - 11 years 8 months ago #190413
by Ducnb
Convert cart to wishlist was created by Ducnb
-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : LinuxMint 17.1 FireFox 35.0.1
I want have function will convert alll products in cart to wishlist.
Current, I only can convert wishlist to cart.
when order, I see have the button call "Convert cart in wishlist", but when I click on it, it show blank page, dont have any products in this page.
I try fix this error and I see this code (components/com_hikashop/controllers/cart.php):
When I change
to
it's work, it will convert all product in cart to wishlist. and set empty cart.
but will have problem when I upgrade. Please let me know other solution, add all products in cart to wishlist but not empty cart.
Thanks.
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : LinuxMint 17.1 FireFox 35.0.1
I want have function will convert alll products in cart to wishlist.
Current, I only can convert wishlist to cart.
when order, I see have the button call "Convert cart in wishlist", but when I click on it, it show blank page, dont have any products in this page.
I try fix this error and I see this code (components/com_hikashop/controllers/cart.php):
Code:
function convert(){
$app = JFactory::getApplication();
$cart_type = JRequest::getString('cart_type','cart');
$cart_id = JRequest::getInt('cart_id','0');
$cartClass = hikashop_get('class.cart');
$cartInfo = $cartClass->loadCart($cart_id);
$currUser = hikashop_loadUser(true);
if($cartInfo != null && $currUser->user_cms_id == $cartInfo->user_id){
$app->setUserState(HIKASHOP_COMPONENT.'.'.$cart_type.'_id', 0);
$cartClass->convert($cart_id, $cart_type);
if($cart_type != 'wishlist'){
JRequest::setVar('cart_type','wishlist');
}
}
JRequest::setVar('cart_id',$cart_id);
JRequest::setVar('layout', 'showcart');
return parent::display();
}
Code:
$app->setUserState(HIKASHOP_COMPONENT.'.'.$cart_type.'_id', 0);
Code:
$app->setUserState(HIKASHOP_COMPONENT.'.'.$cart_type.'_id', $cart_id);
it's work, it will convert all product in cart to wishlist. and set empty cart.
but will have problem when I upgrade. Please let me know other solution, add all products in cart to wishlist but not empty cart.
Thanks.
Last edit: 11 years 8 months ago by Ducnb.
Please Log in or Create an account to join the conversation.
11 years 8 months ago #190433
by Xavier
Replied by Xavier on topic Convert cart to wishlist
Hi,
Please try to update to HikaShop 2.3.5, few changes have been made on the cart and wishlist.
If it is still not working on the latest version, you can apply your patch, and keep us informed in order to do deeper check.
Please try to update to HikaShop 2.3.5, few changes have been made on the cart and wishlist.
If it is still not working on the latest version, you can apply your patch, and keep us informed in order to do deeper check.
Please Log in or Create an account to join the conversation.
11 years 6 months ago #197071
by ShinKou
Replied by ShinKou on topic Convert cart to wishlist
-- HikaShop version -- : 2.3.5 Business
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : 41.0.2272.101 m
I am having a similar problem but when I click on "convert cart in wishlist" the page shows "you are not authorized to see this page" even though I am registered and logged in during checkout. I have to click on "display my carts" button to see the item added. Is there a way that the page displays correctly, instead of showing "you are not authorized to see this page"?
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.3.29
-- Browser(s) name and version -- : 41.0.2272.101 m
I am having a similar problem but when I click on "convert cart in wishlist" the page shows "you are not authorized to see this page" even though I am registered and logged in during checkout. I have to click on "display my carts" button to see the item added. Is there a way that the page displays correctly, instead of showing "you are not authorized to see this page"?
Please Log in or Create an account to join the conversation.
11 years 6 months ago #197083
by Xavier
Replied by Xavier on topic Convert cart to wishlist
Hi,
There is fixes done in the latest version of HikaShop for that kind of issues, so please download and install the latest version.
There is fixes done in the latest version of HikaShop for that kind of issues, so please download and install the latest version.
Please Log in or Create an account to join the conversation.
11 years 6 months ago #197731
by ShinKou
Replied by ShinKou on topic Convert cart to wishlist
My order was made on 2015-01-09 is there a more recent version than this?
Please Log in or Create an account to join the conversation.
11 years 6 months ago #197735
by Xavier
Replied by Xavier on topic Convert cart to wishlist
Hi,
The current version is the 2.4.0
The current version is the 2.4.0
Please Log in or Create an account to join the conversation.
11 years 6 months ago #198071
by ShinKou
Replied by ShinKou on topic Convert cart to wishlist
I updated to the latest version 2.4.0, but the "You are not authorized to see this resource" still remains.
Please Log in or Create an account to join the conversation.
11 years 6 months ago #198335
by Xavier
Replied by Xavier on topic Convert cart to wishlist
Hi,
I don't have the message displayed when testing on you website.
Do you have edited anything ?
I don't have the message displayed when testing on you website.
Do you have edited anything ?
Please Log in or Create an account to join the conversation.
11 years 6 months ago #198502
by ShinKou
Replied by ShinKou on topic Convert cart to wishlist
No I haven't edited anything. I am wondering would it have something to do with caching?
Please Log in or Create an account to join the conversation.
11 years 6 months ago #198505
by Xavier
Replied by Xavier on topic Convert cart to wishlist
Hi,
Yes indeed, I forgot to ask you that. If you have any cache, please disable it (Joomla settings, Joomla plugin, template cache...)
Yes indeed, I forgot to ask you that. If you have any cache, please disable it (Joomla settings, Joomla plugin, template cache...)
Please Log in or Create an account to join the conversation.
Time to create page: 0.348 seconds