Contact us Button adds "administrator" into URL

  • Posts: 41
  • Thank you received: 0
11 years 11 months ago #82619

This is odd but when customers use the contact button and we receive the email it adds "admininstrator into the url"

For example from the email.
Link to the product page < www.furnitureandthings.com/administrator...mp;task=edit&cid []=1223&Itemid=389>

You will notice that"administrator" therefore not allowing he user to access the view the product on the site by just clicking...

Could you at least point me to the file that renders that url so I can take a look at it?

Thanks!

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

  • Posts: 13201
  • Thank you received: 2322
11 years 11 months ago #82717

This url is in the view "product / show_default" in HikaShop > Display > Views.
The code you are looking for is:

	<div id="hikashop_product_contact_main" class="hikashop_product_contact_main">
		<?php
		$contact = $this->config->get('product_contact',0);
		if (hikashop_level(1) && ($contact == 2 || ($contact == 1 && !empty ($this->element->product_contact)))) {
			$empty = '';
			$params = new HikaParameter($empty);
			echo $this->cart->displayButton(JText :: _('CONTACT_US_FOR_INFO'), 'contact_us', $params, hikashop_completeLink('product&task=contact&cid=' . $this->row->product_id), 'window.location=\'' . hikashop_completeLink('product&task=contact&cid=' . $this->row->product_id) . '\';return false;');
		}
		?>
	</div>

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

  • Posts: 41
  • Thank you received: 0
11 years 11 months ago #83043

Unfortunately I can't figure this out. The code is the same but when I use the contact button and receive the email it adds /administrator/ in the url after the domain ie. .com... So the link is not valid within the email.

Any ideas of how to fix this?

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
11 years 11 months ago #83233

Since you're the administrator of the shop you should be able to access the link of the contact email.
That should not be a problem.
If you want to change the link in the contact email, you need to edit the contact email via the menu System->Emails and change the link there:
$url = JRoute::_('administrator/index.php?option=com_hikashop&ctrl=product&task=edit&cid[]='.$data->product->product_id.$url_itemid,false,true);

Maybe something like that:
$url = JRoute::_('index.php?option=com_hikashop&ctrl=product&task=show&cid='.$data->product->product_id.$url_itemid,false,true);

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

  • Posts: 41
  • Thank you received: 0
11 years 10 months ago #83552

Thanks very helpful. Almost there just one little issue.

It adds "https" into the url. Usually that would be good with an e-commerce site but we're just using hikashop as a catalog to browse.

I can't figure out how to change the https to just regular http that shows up in the link of the email since we don't have an SSL certificate.

Thanks!

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 10 months ago #83555

Hi,

So you can just $url = str_replace('https://', 'http://', $url);, no ?

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: 41
  • Thank you received: 0
11 years 10 months ago #83560

I tried putting the code in but it didn't work. However you help realize how simple the solution really was. So in the string I just added

http://sitedomain.com/

Thanks for your help!

Last edit: 11 years 10 months ago by Jerome. Reason: The submit on the forum left out "http://". Fixed by moderator

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

Time to create page: 0.074 seconds
Powered by Kunena Forum