- Posts: 152
- Thank you received: 11
Terms and condition depends on usergroups?
13 years 10 months ago - 13 years 10 months ago #73326
by holm76
I'm using firebug, forumsearch, dokumentation and then I ask.. It's so easy
Terms and condition depends on usergroups? was created by holm76
We have created some user groups and categorizes existing customers in these.
Is it possible that you can set the shop so that only the individual user to accepetere terms and condition when they purchase?
/EDIT: have placed this topic in a wrong category..
Is it possible that you can set the shop so that only the individual user to accepetere terms and condition when they purchase?
/EDIT: have placed this topic in a wrong category..
I'm using firebug, forumsearch, dokumentation and then I ask.. It's so easy
Last edit: 13 years 10 months ago by holm76.
Please Log in or Create an account to join the conversation.
13 years 10 months ago - 13 years 10 months ago #73393
by Xavier
Replied by Xavier on topic Re: Terms and condition depends on usergroups?
Hi,
You can try to edit the view "checkout / terms" and use this code:
Change the number '8' by the id of your individual group.
You can try to edit the view "checkout / terms" and use this code:
Code:
<div id="hikashop_checkout_terms" class="hikashop_checkout_terms">
<?php
$user =& JFactory::getUser();
$individual = 1;
foreach($user->groups as $group){
if($group != '8'){
$individual = 0;
}
}
if($individual){
?>
<input class="hikashop_checkout_terms_checkbox" id="hikashop_checkout_terms_checkbox" type="checkbox" name="hikashop_checkout_terms" value="1" <?php echo $this->terms_checked; ?> />
<?php
}
$text = JText::_('PLEASE_ACCEPT_TERMS_BEFORE_FINISHING_ORDER');
$terms_article = $this->config->get('checkout_terms');
if(!empty($terms_article)){
JHTML::_('behavior.modal');
$text = '<a href="'.JRoute::_('index.php?option=com_content&view=article&id='.$terms_article.'&tmpl=component').'" class="modal" rel="{handler: \'iframe\', size: {x: 450, y: 480}}" target="_blank">'.$text.'</a>';
}
?>
<label for="hikashop_checkout_terms_checkbox"><?php echo $text; ?></label>
</div>
<?php
if(!$individual){
?>
<input class="hikashop_checkout_terms_checkbox" id="hikashop_checkout_terms_checkbox" type="checkbox" name="hikashop_checkout_terms" value="1" <?php echo $this->terms_checked; ?> />
<script type="text/javascript">
document.getElementById('hikashop_checkout_terms').style.display = 'none';
document.getElementById('hikashop_checkout_terms_checkbox').style.display = 'none';
</script>
<?php
}
?>
Change the number '8' by the id of your individual group.
Last edit: 13 years 10 months ago by Xavier.
Please Log in or Create an account to join the conversation.
13 years 10 months ago #74111
by holm76
I'm using firebug, forumsearch, dokumentation and then I ask.. It's so easy
Replied by holm76 on topic Re: Terms and condition depends on usergroups?
what if I have more groups, is it then with commas between or how to do
I'm using firebug, forumsearch, dokumentation and then I ask.. It's so easy
Please Log in or Create an account to join the conversation.
13 years 10 months ago #74243
by Xavier
Replied by Xavier on topic Re: Terms and condition depends on usergroups?
Hi,
In the "if" condition you can add more group id like in this example:
In the "if" condition you can add more group id like in this example:
Code:
if($group != '8' && $group != '9' && ...){
The following user(s) said Thank You: holm76
Please Log in or Create an account to join the conversation.
13 years 10 months ago #74498
by holm76
I'm using firebug, forumsearch, dokumentation and then I ask.. It's so easy
Replied by holm76 on topic Re: Terms and condition depends on usergroups?
Hello
I have now made the changes you propose. It works when checkbox is no longer visible. But when I test a purchase with it, the system will still have to be checked. The field is no longer displayed and therefore I can not continue ..
Is it possible to remove this?
I have now made the changes you propose. It works when checkbox is no longer visible. But when I test a purchase with it, the system will still have to be checked. The field is no longer displayed and therefore I can not continue ..
Is it possible to remove this?
I'm using firebug, forumsearch, dokumentation and then I ask.. It's so easy
Please Log in or Create an account to join the conversation.
13 years 10 months ago #74542
by Xavier
Replied by Xavier on topic Re: Terms and condition depends on usergroups?
Instead of
Can you try:
Code:
$group != '8' && $group != '9'
Can you try:
Code:
$group == '8' || $group == '9'
Please Log in or Create an account to join the conversation.
13 years 10 months ago #75060
by holm76
I'm using firebug, forumsearch, dokumentation and then I ask.. It's so easy
Replied by holm76 on topic Re: Terms and condition depends on usergroups?
I have made the proposed amendment and at first glance it seems.
but maybe not, when I would go further payment is not checked (set it to the invoice) and when I feel it in the radiobuton, says that I must accept the terms
but maybe not, when I would go further payment is not checked (set it to the invoice) and when I feel it in the radiobuton, says that I must accept the terms
I'm using firebug, forumsearch, dokumentation and then I ask.. It's so easy
Please Log in or Create an account to join the conversation.
13 years 10 months ago #75242
by Xavier
Replied by Xavier on topic Re: Terms and condition depends on usergroups?
Hi,
try to replace:
By:
try to replace:
Code:
if(!$individual){
?>
<input class="hikashop_checkout_terms_checkbox" id="hikashop_checkout_terms_checkbox" type="checkbox" name="hikashop_checkout_terms" value="1" <?php echo $this->terms_checked; ?> />
Code:
if(!$individual){
?>
<input class="hikashop_checkout_terms_checkbox" id="hikashop_checkout_terms_checkbox" type="checkbox" name="hikashop_checkout_terms" value="1" checked="checked" />
Please Log in or Create an account to join the conversation.
Time to create page: 0.229 seconds