contact vendor button always shown for guest users redirect to registration form

  • Posts: 48
  • Thank you received: 0
6 years 6 months ago #277146

-- HikaShop version -- : 3.1.1
-- HikaMarket version -- : 1.7.3
-- Joomla version -- : 3.7.5
-- PHP version -- : 7

hi,

i found a tread to show the contact us button only for restricted users.

www.hikashop.com/forum/product-category-...egistered-users.html

that works fine.
is it possible to show the button all users and redirect guests with a information to the registration form?


thx

Steve

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
6 years 6 months ago #277147

Hi,

Sure. Instead of that code change, in the same place, change the code:

$url_itemid='';
			if(!empty($Itemid)){
				$url_itemid='&Itemid='.$Itemid;
			}
to:
				$url_itemid='&Itemid=XXX';
where XXX is the id of a menu item of the HikaShop component which has its "access level" setting set to "registered".
That way, the button will always display, but it will point to the contact page on a menu item which isn't accessible to him based on the Joomla access level setting of that menu item, and thus Joomla will automatically redirect the user to the login form with a message explaining the situation, which will also have a link for registration if necessary.

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

  • Posts: 48
  • Thank you received: 0
6 years 6 months ago #277192

sorry. i can´t find that code in the display product/show_default. i delete the override so that i have the originale code, but i can´t find it.

the code looks like that

<?php
}
?>

<div id="hikashop_product_contact_main" class="hikashop_product_contact_main"><?php
$contact = (int)$this->config->get('product_contact', 0);
if(hikashop_level(1) && ($contact == 2 || ($contact == 1 && !empty($this->element->product_contact)))) {
$css_button = $this->config->get('css_button', 'hikabtn');
?>
<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>
<?php
}
?>
</div>

<?php

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
6 years 6 months ago #277211

Hi,

You previously said that you applied the modification there:
www.hikashop.com/forum/product-category-...ed-users.html#166105
But both the original and the modified code have the code I'm talking about in my message...

Anyway, that new code your providing is basically the same. You just need to replace $this->url_itemid by '&Itemid=XXX'

The following user(s) said Thank You: Nabo

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

  • Posts: 48
  • Thank you received: 0
6 years 4 months ago #282862

hi Nicolas,

this works fine.

how i can do this with the vendor contactbutton on the vendor page. i found the display HikaMarket - vendormarket / showcontainer_default.php . is this the right display and how i have to change the source.


thx

Steve

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
6 years 4 months ago #282874

Hello,

Yes it is the right view.
You'll see the contact starting with

if($this->config->get('display_vendor_contact', 0)) {

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.
The following user(s) said Thank You: Nabo

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

Moderators: Obsidev
Time to create page: 0.065 seconds
Powered by Kunena Forum