Popup not displaying for some items

  • Posts: 75
  • Thank you received: 2
10 years 11 months ago #159343

-- url of the page with the problem -- : www.inkacollective.com/testing/consilium/
-- HikaShop version -- : 2.3.1
-- Joomla version -- : 3.3
-- PHP version -- : 5.x

I have "stay and display popup" selected in configuration of "After a product is added to the cart", on products pages/articles that use the product TAG insertion method ( www.inkacollective.com/testing/consilium...f-probe-station.html ) the popup does not display but it does stay on the page. How can I fix this behaviour?

Also, for other pages I have custom coded the cart insertion code in order to support more than 1 TAG inserted product on the page using the code

http://www.demo.hikashop.com/index.php?option=com_hikashop&ctrl=product&task=updatecart&data[ZZ]=YY&data[AA]=BB&checkout=1
( www.inkacollective.com/testing/consilium...ions/rf-probing.html ) What would be the best way to make the popup display using this code? If you could direct me or show me the code that displays the popup for other pages that would be beneficial.

Thanks.

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

  • Posts: 83932
  • Thank you received: 13588
  • MODERATOR
10 years 11 months ago #159494

Hi,

1. From what I can see, the issue here is that the hikashop.js file is missing from the page header. That should however never happen since the hikashop.js file is added to the page by the main helper.php file of HikaShop which is called by the tag insertion plugin in order to be able to load the add to cart button system in order to display it.
Try to add the code:

if(!strpos($body,'/media/com_hikashop/js/hikashop.js')){
					$body=str_replace('</head>','<script src="/media/com_hikashop/js/hikashop.js" type="text/javascript"></script></head>',$body);
					JResponse::setBody($body);
				}
after the code:
if(!strpos($body,'function hikashopModifyQuantity(')){
					$body=str_replace('</head>','<script type="text/javascript">'.$this->addToCartJs.'</script></head>',$body);
					JResponse::setBody($body);
				}
in the file components/com_hikashop/views/product/view.html.php and try again. That shoudl inject the file in the HTML source of the page if missing.

2. It's not impossible to have popups for custom made buttons but it's clearly not easy. Instead of a link, you need to have a form going to www.demo.hikashop.com/index.php?option=c...duct&task=updatecart with hidden input fields for the parameters and a submit button type field to click on it. However, that button should not use the normal form submit system of HTML but instead call the javascript hikashopModifyQuantity function with the correct parameters to submit the form via this function. And this function needs to be loaded in the headers of the page by calling the getJS function of the administrator/components/com_hikashop/helpers/cart.php file.
Basically, if you're not a developer, you would need a developer to help you with such development as it's not a few lines of code that you can just plug in there.

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

  • Posts: 75
  • Thank you received: 2
10 years 11 months ago #159565

Nicolas,
Thanks for your reply. I changed the code like you suggested but the problem still persists.

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

  • Posts: 83932
  • Thank you received: 13588
  • MODERATOR
10 years 11 months ago #159654

Hi,

Can you provide a FTP access to your website via our contact form so that we can look at the code ?
Please include a link to this thread.
www.hikashop.com/contact-us.html

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

  • Posts: 75
  • Thank you received: 2
10 years 11 months ago #159810

Nicolas,
I have sent an email a few days ago and still not seen a reply.

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

  • Posts: 83932
  • Thank you received: 13588
  • MODERATOR
10 years 11 months ago #159827

Several other issues were present in order to make the popup work for your configuration.
First, first the mootools-more library was not loading.
Second the jquery library was loaded twice.
I've had to add a few changes in the code of the same file (near the code change you already made), and also install the plugin jquery easy to fix the jquery library problem between your template and another extension.

The popup is working now.

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

Time to create page: 0.061 seconds
Powered by Kunena Forum