Skip to main content

Cart does not get empty after order creation?

More
12 years 11 months ago #129798 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,

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

More
12 years 11 months ago #129811 by Mohamed Thelji
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.

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

More
12 years 11 months ago #130098 by irfanhanfi
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 Log in or Create an account to join the conversation.

More
12 years 11 months ago #130281 by nicolas
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.

More
12 years 11 months ago #130285 by irfanhanfi
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,

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

More
12 years 11 months ago #130458 by Jerome
Hi,

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.

More
12 years 10 months ago #132322 by irfanhanfi
Is there any solution that I can apply?

Thanks,

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

More
12 years 10 months ago #132377 by Xavier
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:
Code:
$cartClass = hikashop_get('class.cart'); $cartClass->resetCart();
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
The following user(s) said Thank You: irfanhanfi

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

More
12 years 9 months ago #137742 by irfanhanfi
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.

More
12 years 9 months ago #138690 by Xavier
Hi,

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.

More
12 years 9 months ago #138717 by irfanhanfi
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,

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

More
12 years 8 months ago #139198 by Xavier
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:
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');
You need to adapt it for the plugin.

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

Time to create page: 0.263 seconds
Powered by Kunena Forum