Post by skip » Tue Oct 15, 2019 9:15 pm

In opencart 2.3.0.2 I use the default customergroup with id = 1 and seller customergroup with id = 2.
How to apply code below only for the default customergroup and not for the seller customergroup?

Code: Select all

 <div class="checkbox" style="display:none;">
Thanks

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by grgr » Wed Oct 16, 2019 10:52 am

WHY and WHERE do you want to do that? You'll get a better answer if we know that.

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by cedcommerceteam » Wed Oct 16, 2019 2:33 pm

Hi there,

Yes can add a customer_group_id check before this code as below :

Code: Select all

<?php if($customergroup == 1){ ?> 
       <div class="checkbox" style="display:none;"> 
<?php } ?>
Note: $customergroup variable is just an example, you can set whatever Key you had set for customer groups in controller

Thanks.

Kind Regards:

Call us at : (+91) -8765210318 , Skype: live:carlmorgan.cedcommerce , Email: support@cedcommerce.com
CedCommerece : Officail Opencart Partners
CedCommerce Official : www.cedcommerce.com
Opencart Services : www.cedcommerce/opencart-services.com
Sell On various Marketplace Integration : Opencart-Extensions
Magenative Mobile App/IOS Development : magenative.com
Webinar : Power up Your holiday season marketing with the Automation tool


User avatar
Active Member

Posts

Joined
Wed Aug 09, 2017 9:02 pm

Post by skip » Mon Oct 21, 2019 10:25 pm

@cedcommerceteam Thank You -this works for me :

Code: Select all

<?php if($customer_group_id == 2){ ?>
<div class="checkbox">
  <label>
    <input type="checkbox" name="shipping_address" value="1" checked="checked" />
    <?php echo $entry_shipping; ?></label>
</div>
<?php } ?>
So variable $customer_group_id is defined in register.tpl (oc version 2302)
But I also need same variable $customer_group_id for checkout.tpl is it posible to define this variable there ? thanks

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by skip » Tue Oct 22, 2019 11:56 am

@grgr Im trying to hide payment address division in journal quick checkout but only for specific customer_group_id , dont know does it posible to get this variable customer_group_id in checkout.tpl and how.
This is codde and division

Code: Select all

<?php if($customer_group_id == 2){ ?><?php echo $payment_address; ?><?php } ?>
After apply I get message variable $customer_group_id is not defined

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by cedcommerceteam » Tue Oct 22, 2019 4:19 pm

Hello there,

I am glad that my solution worked for you.

For checkout.tpl page, you need to look into check out controller whether you are getting customer group id or not, if not then need to prepare data to get customer group id.

Try to print data of checkout & check whether you are getting customer group id or not.

Thanks.

Kind Regards:

Call us at : (+91) -8765210318 , Skype: live:carlmorgan.cedcommerce , Email: support@cedcommerce.com
CedCommerece : Officail Opencart Partners
CedCommerce Official : www.cedcommerce.com
Opencart Services : www.cedcommerce/opencart-services.com
Sell On various Marketplace Integration : Opencart-Extensions
Magenative Mobile App/IOS Development : magenative.com
Webinar : Power up Your holiday season marketing with the Automation tool


User avatar
Active Member

Posts

Joined
Wed Aug 09, 2017 9:02 pm

Post by grgr » Tue Oct 22, 2019 8:44 pm

skip wrote:
Tue Oct 22, 2019 11:56 am
@grgr Im trying to hide payment address division in journal quick checkout
Journal 2 or 3? If 2 I can't help as I don't have a copy.

But more so, the payment address is fairly fundemental, so as long as they are logged in with an address and you are just wanting to hide it then it shouldn't be a problem, which I guess is what you are doing as you are doing it by customer group.

Either way, you need to get the custome group which you can do with this: $this->customer->getGroupId();

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by skip » Wed Oct 23, 2019 6:10 am

@cedcommerceteam Thank You,
@grgr Journal is 2.14.2 version Thank You, Div payment address for returning customer is posible hide very easy on quick checkout - I know how to do that allready, customer_ group_ id is condition more for hidding.

Active Member

Posts

Joined
Mon May 09, 2011 9:57 pm

Post by cedcommerceteam » Wed Oct 23, 2019 12:22 pm

skip wrote:
Wed Oct 23, 2019 6:10 am
@cedcommerceteam Thank You,
@grgr Journal is 2.14.2 version Thank You, Div payment address for returning customer is posible hide very easy on quick checkout - I know how to do that allready, customer_ group_ id is condition more for hidding.
@skip, Your Welcome :)

Call us at : (+91) -8765210318 , Skype: live:carlmorgan.cedcommerce , Email: support@cedcommerce.com
CedCommerece : Officail Opencart Partners
CedCommerce Official : www.cedcommerce.com
Opencart Services : www.cedcommerce/opencart-services.com
Sell On various Marketplace Integration : Opencart-Extensions
Magenative Mobile App/IOS Development : magenative.com
Webinar : Power up Your holiday season marketing with the Automation tool


User avatar
Active Member

Posts

Joined
Wed Aug 09, 2017 9:02 pm
Who is online

Users browsing this forum: No registered users and 74 guests