- Posts: 64
- Thank you received: 0
Cart does not get empty after order creation?
- irfanhanfi
-
Topic Author
- Offline
Less
More
12 years 11 months ago #129798
by irfanhanfi
Cart does not get empty after order creation? was created by irfanhanfi
I am using Entry fields form.And after order creation cart does not get empty.I have got the same issue in demo site.Is this intentional or how can I change this?
Thanks,
Thanks,
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 11 months ago #129811
by Mohamed Thelji
Replied by Mohamed Thelji on topic Cart does not get empty after order creation?
Hi,
Can you give us more information about the issue that you're having, through some screenshots for example ? Note that It's maybe a cache issue, thansk to try to disable the Joomla cache, and clear it. You'll also have to disable it in the joomla config, and unpublish the cache plugin.
Can you give us more information about the issue that you're having, through some screenshots for example ? Note that It's maybe a cache issue, thansk to try to disable the Joomla cache, and clear it. You'll also have to disable it in the joomla config, and unpublish the cache plugin.
Please Log in or Create an account to join the conversation.
- irfanhanfi
-
Topic Author
- Offline
Less
More
- Posts: 64
- Thank you received: 0
12 years 11 months ago #130098
by irfanhanfi
Replied by irfanhanfi on topic Cart does not get empty after order creation?
The problem is once order is created all cart products should be removed.I have attached two snapshot.
Please have a look and let me know if not clear.
Thanks,
Please have a look and let me know if not clear.
Thanks,
Please Log in or Create an account to join the conversation.
12 years 11 months ago #130281
by nicolas
Replied by nicolas on topic Cart does not get empty after order creation?
Please make sure that you configured the option "Clean cart when order is" of the configuration to "created".
Please Log in or Create an account to join the conversation.
- irfanhanfi
-
Topic Author
- Offline
Less
More
- Posts: 64
- Thank you received: 0
12 years 11 months ago #130285
by irfanhanfi
Replied by irfanhanfi on topic Cart does not get empty after order creation?
Yes,setting is exactly what you said.It works fine for other case but if product is added through entry fields then there is a problem.
Thanks,
Thanks,
Please Log in or Create an account to join the conversation.
12 years 11 months ago #130458
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Cart does not get empty after order creation?
Hi,
I created a ticket in our bug tracker.
Regards,
I created a ticket in our bug tracker.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
- irfanhanfi
-
Topic Author
- Offline
Less
More
- Posts: 64
- Thank you received: 0
12 years 10 months ago #132322
by irfanhanfi
Replied by irfanhanfi on topic Cart does not get empty after order creation?
Is there any solution that I can apply?
Thanks,
Thanks,
Please Log in or Create an account to join the conversation.
12 years 10 months ago #132377
by Xavier
Replied by Xavier on topic Cart does not get empty after order creation?
Hi,
As temporary fix, you can probably create a plugin based on the function: onAfterOrderCreate(&$order,&$send_email)
And in this function use the code:
This will force the reset of the cart when entering the order create function.
Here is some documentation about plugins:
www.hikashop.com/support/documentation/6...mentation.html#order
As temporary fix, you can probably create a plugin based on the function: onAfterOrderCreate(&$order,&$send_email)
And in this function use the code:
Code:
$cartClass = hikashop_get('class.cart');
$cartClass->resetCart();
Here is some documentation about plugins:
www.hikashop.com/support/documentation/6...mentation.html#order
The following user(s) said Thank You: irfanhanfi
Please Log in or Create an account to join the conversation.
- irfanhanfi
-
Topic Author
- Offline
Less
More
- Posts: 64
- Thank you received: 0
12 years 9 months ago #137742
by irfanhanfi
Replied by irfanhanfi on topic Cart does not get empty after order creation?
It was seem to be working fine.But I noticed that it does not save entries if we reset the cart after order create.Could you please help me to solve this?
Please Log in or Create an account to join the conversation.
12 years 9 months ago #138690
by Xavier
Replied by Xavier on topic Cart does not get empty after order creation?
Hi,
Thanks to explain with more details what you mean by "it does not save entries" ?
Thanks to explain with more details what you mean by "it does not save entries" ?
Please Log in or Create an account to join the conversation.
- irfanhanfi
-
Topic Author
- Offline
Less
More
- Posts: 64
- Thank you received: 0
12 years 9 months ago #138717
by irfanhanfi
Replied by irfanhanfi on topic Cart does not get empty after order creation?
For example if I have two fields in Entry form Name and Product Dropdown.It adds product as per drop down selection but does not save entries in Entry table(#__hikashop_entry).The reason is Entry inserted into table after onAfterOrderCreate Event.Is there any other way to empty cart?
I hope this is clear.
Thanks,
I hope this is clear.
Thanks,
Please Log in or Create an account to join the conversation.
12 years 8 months ago #139198
by Xavier
Replied by Xavier on topic Cart does not get empty after order creation?
Another way to clean the cart could be to jsut create a new cart for the current user.
Like it's done in the "newcart()" function in the frontend cart controller.
The content of the function is:
You need to adapt it for the plugin.
Like it's done in the "newcart()" function in the frontend cart controller.
The content of the function is:
Code:
$app = JFactory::getApplication();
$cartClass = hikashop_get('class.cart');
$cart_type = JRequest::getString('cart_type','cart');
// set all the user carts cart_current to 0 in DB
$result = $cartClass->setCurrent('0',$cart_type);
// Create a new cart
$session = JFactory::getSession();
$curUser = hikashop_loadUser(true);
$newCart = new stdClass();
if($curUser == null)
$newCart->user_id = 0;
else
$newCart->user_id = $curUser->user_cms_id;
$newCart->session_id = $session->getId();
$newCart->cart_modified = time();
$newCart->cart_type = $cart_type;
$newCart->cart_current = 1;
$newCart->cart_share = 'nobody';
$cartClass->save($newCart);
// EO Create a new cart
// set the current cart to 0 in session.
$app->setUserState(HIKASHOP_COMPONENT.'.'.$cart_type.'_id', '0');
// set the "new_cart" parameter in session
$app->setUserState(HIKASHOP_COMPONENT.'.'.$cart_type.'_new', '1');
Please Log in or Create an account to join the conversation.
Time to create page: 0.263 seconds