- Posts: 8
- Thank you received: 0
close the model window with the add to cart button
-- HikaShop version -- :HikaShop Business: 2.2.3
-- Joomla version -- :2.5.17 Stable
-- PHP version -- :5.4.17
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message
Hi,
I want my product view to show in a pop-up, i have done it like explained here: www.hikashop.com/forum/2-general-talk-ab...cart-popup-help.html
And it works fine but now it has to close when i click on the add to cart button. is this possible??
thanks frank
Please Log in or Create an account to join the conversation.
I guess that you'll want to change the line:
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax,'',$max,$min);
of the view file quantity (via Display>Views) to something like that:
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,'window.top.hikashop.closeBox();'.$this->ajax,'',$max,$min);
Please Log in or Create an account to join the conversation.
Thanks for the help and quick reply.
I changed the line in the quantity file. and now he close with the button
do u have any suggestion what could cause that?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
What do u mean with JS message?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Anyway it's going to be a bit harder than I though. The code that add to the cart end up by reloading the page so you can see you added your product. In this case the code closing the popup can't be executed so it will require mode code at different steps.
Please Log in or Create an account to join the conversation.
yes he have to close just before the refresh but that wont be possible?
Maybe it makes a deference if we use dialog instead of mode?
Or on the product_list as accordion?
And thank you very much for the support so far.
Please Log in or Create an account to join the conversation.
The problem is that the code called to add to cart is also called in other places and modifying it may create issues on other aspects.
The function called is hikashopModifyQuantity in the file cart.php (administrator/components/com_hikashop/helpers).
You can try to add the code window.top.hikashop.closeBox(); either à the beginning (after the '(' ) or after these lines:
Please Log in or Create an account to join the conversation.
I've tried putting the code at both places (and some other places i could think of). but it doesn't work.
its either closing or add to cart never both..
May it help to use a dialog instead of model?
Please Log in or Create an account to join the conversation.
Have you tried tu put it after:
In this file the function is present twice, have you tried to add the code at the both places ?
Please Log in or Create an account to join the conversation.
put the code
window.top.hikashop.closeBox();
after both
if(hikaModule) hikaModule.innerHTML = result;
lines
But it doesn't close the model
Please Log in or Create an account to join the conversation.
So it will require more editions than just add some javascript.
As it's a customization, we can't really help you on the forum.
If you really need this feature, you can potentially post a request in the commercial jobs part of our forum.
Please Log in or Create an account to join the conversation.