Post by faulksandcox » Wed Jul 23, 2014 6:44 pm

Hi,

I need a way of showing the price WITH tax for one customer group and WITHOUT for another.

i.e. Consumers will see the price inclusive of VAT and Trade will see the price on the store without VAT (However will still be charged VAT at the checkout).

Need this quite urgently, please point me to a mod that will do it!

Thanks :)

- Lea

Newbie

Posts

Joined
Fri Jul 18, 2014 9:39 pm

Post by Xyph3r » Thu Jul 24, 2014 6:57 pm

A quick change that I did to one of the stores I've made:

NOTE: You must edit the "index.php" file

Add this code:

Code: Select all

// Taxes selector
if (isset($session->data['customer_id'])) {
	$customer_get_group_querry = $db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE customer_id = '" . (int)$session->data['customer_id'] . "' AND status = '1'");
	$customer_get_group = $customer_get_group_querry->row['customer_group_id'];

	if ($customer_get_group == 2 ) {		
		$config->set('config_tax', 0);
	}
}
before "//Language" line

NOTE: Change "2" from "if ($customer_get_group == 2 ) {" with your customer group id.

ImageImageImage
Opencart Templates, Modules, Themes & Custom Development | ShopThemer


User avatar
Active Member

Posts

Joined
Sun Feb 10, 2013 1:08 am


Post by fabius » Sun Jan 19, 2020 3:21 am

Opencart 3.x version here for free:

https://www.opencart.com/index.php?rout ... n_id=38381

Newbie

Posts

Joined
Mon Sep 09, 2013 1:51 am

Post by straightlight » Sun Jan 19, 2020 10:33 pm

Using the extension provided above, based on the described screenshots from the extension page, would also remove the ability to users to use the default customer group ID since check boxes could now be used. We need to be reminded that the customer group does use a default value during startup and may also interfere with the internal APIs for registered customers.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by fabius » Sun Feb 09, 2020 6:05 pm

@straightlight
I haven't removed the "default customer groups" option, that is still present in the account section. The extension only affect the $tax_status variable at website page startup.
Or you mean something different?

Newbie

Posts

Joined
Mon Sep 09, 2013 1:51 am
Who is online

Users browsing this forum: No registered users and 0 guests