add custom iframe to product page below wish list

  • Posts: 17
  • Thank you received: 0
9 years 3 months ago #242444

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3
-- PHP version -- : 5
-- Browser(s) name and version -- : ie11

Hi,
I've been struggling to figure out how to add a button or link below the "Add to Wishlist" button on the Product page that can contain an iframe?

is this possible?

Regards,
Craig.

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 3 months ago #242448

Hi,

You would have to add such code:

echo 'my iframe HTML code';
after the code:
echo '<div id="hikashop_add_wishlist">' .
					$this->cart->displayButton(JText::_('ADD_TO_WISHLIST'), 'add', $this->params, $url, $wishlistAjax, '', @$this->row->product_max_per_order, 1, '', false) .
					'</div>';
in the file "quantity" via the menu Display>Views

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

  • Posts: 17
  • Thank you received: 0
9 years 2 months ago #244915

hi,
I've added the IFRAME code to the quantity view and the FRAME now shows below the Wishlist which is what I want, however, the JBUTTON you mentioned, once I add this it just shows another "Add to wishlist" button below the IFRAME.

What I require is that the IFRAME is hidden until the Button is clicked.

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 2 months ago #244924

Hi,

I didn't say that you should add the code:

echo '<div id="hikashop_add_wishlist">' .
					$this->cart->displayButton(JText::_('ADD_TO_WISHLIST'), 'add', $this->params, $url, $wishlistAjax, '', @$this->row->product_max_per_order, 1, '', false) .
					'</div>';
It was just an indication of where to put the code of your iframe.

If you want the iframe to be hidden until you click on the add to wishlist button, you need to add an id in your iframe and add CSS code to hide it by default:
#my_iframe_id{ display: none; }
Then, before the code of the add to wishlist button, you need to prepend to the variable $wishlistAjax some javascript code to display the iframe. Something like that:
$wishlistAjax = 'document.getElementById(\'my_iframe_id\').style.display = \'block\''. $wishlistAjax;

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

  • Posts: 17
  • Thank you received: 0
9 years 2 months ago #244993

thanks.

I understand what you are saying, however I dont want ot use the WISHLIST button.. I want a NEW button that when clicked shows the frame.. What I found that is when I click the add to wishlist button, it shows the frame, however the button performs a POST on the page and redirects me to the CART. I dont want this to happen.. all that should happen is when the NEW button is clicked the frame is shown and the POST should not be completed. i.e user stays on same page.

regards,
Craig.

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 2 months ago #245018

Hi,

Then, it's even easier.
Just add your own button like that:

<input type="button" onclick="document.getElementById('my_iframe_id').style.display = 'block';return false;" value="Display iframe" />

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

Time to create page: 0.069 seconds
Powered by Kunena Forum