Skip to main content

close the model window with the add to cart button

More
12 years 7 months ago #142522 by deambacht
-- url of the page with the problem -- : cafetariadeambacht.nl/bestel
-- 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.

More
12 years 7 months ago #142579 by nicolas
Hi,

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.

More
12 years 7 months ago #142599 by deambacht
Hi Nicolas,

Thanks for the help and quick reply.
I changed the line in the quantity file. and now he close with the button :) , but he doesn't do the add to cart function anymore.
do u have any suggestion what could cause that?

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

More
12 years 7 months ago #142629 by Eliot
Try this instead:
Code:
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax.'window.top.hikashop.closeBox();','',$max,$min);

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

More
12 years 7 months ago #142672 by deambacht
i tried it, but now the model doesn't close anymore..

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

More
12 years 7 months ago #142688 by Eliot
Does it add to cart? Do you have a JS message? Maybe this will be enought:
Code:
echo $this->cart->displayButton(JText::_('ADD_TO_CART'),'add',$this->params,$url,$this->ajax.'; window.top.hikashop.closeBox();','',$max,$min);

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

More
12 years 7 months ago #142706 by deambacht
Yes it did add to cart and with the last modification it still add to cart. but not closing the model.
What do u mean with JS message?

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

More
12 years 7 months ago #142725 by Eliot
I just checked, could you put back Nicolas code so I can try again and see what's wrong?

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

More
12 years 7 months ago #142787 by deambacht
oke, Nicolas his code is back now ;)

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

More
12 years 7 months ago #143478 by Eliot
Really? It does close but doesn't add to the cart, that's not what Nicolas' code should do?
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.

More
12 years 7 months ago #143994 by deambacht
Yes that was indeed the result of nicolas'code modification.
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.

More
12 years 7 months ago #144563 by Eliot
You can try this solution but I'm not sure it will work.
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:
Code:
if(hikaModule) hikaModule.innerHTML = result; };

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

More
12 years 6 months ago #147646 by deambacht
Hi,
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.

More
12 years 6 months ago #148261 by Xavier
Hi,

Have you tried tu put it after:
Code:
if(hikaModule) hikaModule.innerHTML = result;
and before the "};" ?

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.

More
12 years 6 months ago #148594 by deambacht
To make sure i've just tried that again

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.

More
12 years 6 months ago - 12 years 6 months ago #149064 by Xavier
Hi,

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.
Last edit: 12 years 6 months ago by Xavier.

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

Time to create page: 0.291 seconds
Powered by Kunena Forum