product contact button with popup form?

  • Posts: 63
  • Thank you received: 1
12 years 1 month ago #70456

Hello everyone,
I want the contact button on the product will be able to click the Headline and will Appear pop up inside him will be contact form.
Where should I put the php code to it?
What files need to edit?
If someone has an idea easier to love?
:-) Thank you.

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

  • Posts: 13201
  • Thank you received: 2322
12 years 1 month ago #70491

Hi,

To do that, you have to edit the view "product / show_default" in HikaShop > Display > Views and make the modifications inside the div "hikashop_product_contact_main".
The content of the contact form is in the view "product / contact".

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

  • Posts: 63
  • Thank you received: 1
12 years 1 month ago #70493

so if i want just the button on click will popup in the same screen a contact form inside i just need to edit here? "product / show_default" HikaShop > Display > Views.?

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

  • Posts: 13201
  • Thank you received: 2322
12 years 1 month ago #70494

Yes, and some things in the "product / contact" view, to close the popup onClick on a button.

You can use this code instead of the code in the "if(){}" in the "product / show_default" view:

		<a class="modal" title="<?php echo JText::_('CONTACT_US_FOR_INFO')?>" rel="{handler: 'iframe', size: {x: 760, y: 480}}" href="<?php echo hikashop_completeLink('product&task=contact&cid=' . $this->row->product_id.'&tmpl=component');?>">
			<button class="btn" type="button" onclick="return false">
				<?php echo JText::_('CONTACT_US_FOR_INFO');?>
			</button>
		</a>

Last edit: 12 years 1 month ago by Xavier.

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

  • Posts: 63
  • Thank you received: 1
12 years 1 month ago #70495

thank u !!!

this code that you gave that what i need to do to create the pop up + the form inside ?
if it's okay for you to right the codes that i need to insert to paste the regular form in hika to a pop up form on click the button ... it will be great to all hika shop members.. :-) ?
(sorry my ability un php/javascript is not good )

milion of thankssss..

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

  • Posts: 13201
  • Thank you received: 2322
12 years 1 month ago #70499

In "Product / contact", replace the code before the "<form>" tag by:

<div id="hikashop_product_contact_<?php echo JRequest::getInt('cid');?>_page" class="hikashop_product_contact_page">
	<fieldset>
		<div class="toolbar" id="toolbar" style="float: right;">
			<button class="btn" type="button" onclick="submitform('send_email');"><img src="<?php echo HIKASHOP_IMAGES; ?>ok.png"/><?php echo JText::_('OK'); ?></button>
			<button class="btn" type="button" onclick="window.top.SqueezeBox.close();"><img src="<?php echo HIKASHOP_IMAGES; ?>cancel.png"/><?php echo JText::_('HIKA_CANCEL'); ?></button>
		</div>
	</fieldset>
	<div class="iframedoc" id="iframedoc"></div>
	<?php
	$close = JRequest::getString('box','');
	if($close == 'close'){
		$js = 'window.top.SqueezeBox.close();';
		echo '<html><head><script type="text/javascript">'.$js.'</script></head><body></body></html>';
	}
	?>

And it will work fine.

Last edit: 12 years 1 month ago by Xavier.

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

  • Posts: 63
  • Thank you received: 1
12 years 1 month ago #70503

ok i will do it and let you know

Again as always, great support, fast and courteous! It makes all the difference between you and others in my opinion. Of course, in many levels above

Thank you and I will give you a Recommendations in joomla days that I go, Forums ,jed, etc. ...

have a nice day.. :-)

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

  • Posts: 1
  • Thank you received: 0
11 years 2 months ago #124995

Hello,
I also would loike to add tyhis function ality to my shop. However I am having trouble adding the code to the "product_show_default page.
I am unsure where to add it as when I have tried I get a 500 error on the product page.
THe bit I do not understand is exactly how I needs to be added to the area where the "If () {}" statement is.

Could you pelase post the change as it should lok?

CHeers
Mark

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 2 months ago #125132

Hi,

The idea is to replace the line

echo $this->cart->displayButton(JText :: _('CONTACT_US_FOR_INFO'), 'contact_us', $params, hikashop_completeLink('product&task=contact&cid=' . $this->row->product_id.$url_itemid), 'window.location=\'' . hikashop_completeLink('product&task=contact&cid=' . $this->row->product_id.$url_itemid) . '\';return false;');
By:
?>
		<a class="modal" title="<?php echo JText::_('CONTACT_US_FOR_INFO')?>" rel="{handler: 'iframe', size: {x: 760, y: 480}}" href="<?php echo hikashop_completeLink('product&task=contact&cid=' . $this->row->product_id.'&tmpl=component');?>">
			<button class="btn" type="button" onclick="return false">
				<?php echo JText::_('CONTACT_US_FOR_INFO');?>
			</button>
		</a>
<?php
Be careful, the code work good with Joomla 1.5 and 2.5 but the popup in Joomla 3.x could not work very well depending the template you are using.
The post of Xavier have 11 months old.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 5
  • Thank you received: 0
9 years 9 months ago #190559

Hello, first at all excuse me for my english. I have insert the Contact us for more information button pop up code and works correctly. But now, I want to add in the form contact a Subjet that includes the code of the product. I will have more than 200 products so I have to know the product specifically that the client is interesting in. Thanks for your help. Any ideas?

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

  • Posts: 13201
  • Thank you received: 2322
9 years 9 months ago #190583

Hi,

You can edit the preload part of the "A contact request has been made" email (contact_request.preload.php) via the menu System > Emails for business edition or via FTP, but be careful if doing the edition via ftp, when updating the changes will be lost.

So in the preload part of the email you can add something like that:

$this->mailer->subject = 'Contact request for product: '.$data->product->product_code;

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

  • Posts: 10
  • Thank you received: 3
4 years 7 months ago #317086

Hello,

I would like to use the same form as a lightbox pop up. Since this post is more than 5 years old, wondering if there is any easier way of doing it now? Or do I have to modify the file like suggested 5 years ago?

If file needs to be modified, how can I make pop up as a full page lightbox? Please advise (sorry I have no coding experience!!). Thanks in advance

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
4 years 7 months ago #317087

Hi,

You would still need to edit the view file like suggested 5 years ago.
Which file to edit will depend on which contact button you want to change as there is both the button on the product details page and on the product listing.
To find which view file to edit, you can temporarily activate the "Display view files" setting of the HikaShop configuration and look at the page where you want to change the button:
www.hikashop.com/support/documentation/1...-display.html#layout
Now supposing that you use the "default" product layout and that you're talking about the contact button on the product page, it's still the file product / show_default.php that you'll want to edit.
There you can replace the code:

<a href="<?php echo hikashop_completeLink('product&task=contact&cid=' . (int)$this->element->product_id . $this->url_itemid); ?>" class="<?php echo $css_button; ?>"><?php
				echo JText::_('CONTACT_US_FOR_INFO');
			?></a>
by:
<a href="<?php echo hikashop_completeLink('product&task=contact&tmpl=component&cid=' . (int)$this->element->product_id . $this->url_itemid); ?>" class="modal <?php echo $css_button; ?>" rel="{handler: 'iframe', size: {x: 760, y: 480}}"><?php
				echo JText::_('CONTACT_US_FOR_INFO'); JHtml::_('behavior.modal');
			?></a>
Note however that this might not work based on the template you're using.
Please also note that our support is to help you with the setup of your shop, not to do custom development work for free.
If you need more custom development work in the future you can use our contact form to discuss that with us:
www.hikashop.com/support/contact-us.html

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

  • Posts: 10
  • Thank you received: 3
4 years 7 months ago #317477

Hi Nicolas,

Thanks a lot for your time and help. As per your note, your solution did not work probably due to the template I am using as per your concern.

And sorry I did not realise that such a small feature which should be a part of basic hikashop functionality would fall under custom job category.

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

  • Posts: 195
  • Thank you received: 13
  • Hikashop Business
3 years 6 months ago #332612

The modal solution didn't work with the template we're currently working with either but we found that we could simply add the following to the code Nicolas provided previously and the contact button then uses the same styling already loaded for the product image modals.

<a rel="shadowbox" href ... and so forth


3by400, Inc.
3by400.com
Websites that Work, Marketing that Matters
Attachments:
The following user(s) said Thank You: nicolas

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
3 years 6 months ago #332623

Hi,

Another alternative, when you don't use shadowbox for the image popup could be to use a modals ( extensions.joomla.org/extension/modals/ ) tag to generate the popup.
So it would be:

{modal <?php echo hikashop_completeLink('product&task=contact&tmpl=component&cid=' . (int)$this->element->product_id . $this->url_itemid); ?>}<?php echo JText::_('CONTACT_US_FOR_INFO'); ?>{/modal}

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

Time to create page: 0.125 seconds
Powered by Kunena Forum