Post by zChris » Tue Dec 20, 2011 4:21 pm

Hello!

I've made a vqmod that adds a sitewide customer group discount. In admin you can add a percantage to the group you wise to have that discount. Then when a user logs in to buy and is in that group he will get that percantage off on all items in the store.

Use this mod as you will and on your own risk, just dont sell it off (if it works that is) ;P

Installation:
Add a table colum to customer_group that is named group_discount and of type int.
Move discount.xml to xml folder in VQmod folder.

Attachments


http://www.gbtrading.se - villalarm, hemlarm och gsmlarm.


New member

Posts

Joined
Mon Dec 12, 2011 6:24 pm

Post by uksitebuilder » Wed Dec 21, 2011 7:31 pm

Moved to the vQmods forum

OP can you come back and tell us what version this is for, thanks

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by Sz.L. » Thu Dec 29, 2011 9:05 pm

Hello zChris!

I'm using OC 1.5.1.3, and there was a small problem with your mod. After the upload, and inserting the group_discount row to the DB, the OC FrontEnd (when I was logged in like a customer, with special customer group) showed me: SET and all content disappeared. :/
I did change the code around the line 582 from:

Code: Select all

				
if(empty($query->row['special']) == false)
		die("SET");
//$query->row['special'] = $query->row['special']-(($this->session->data['group_discount']/100)*$query->row['special']);
To:

Code: Select all

if(empty($query->row['special']) == false)
	//die("SET");
$query->row['special'] = $query->row['special']-(($this->session->data['group_discount']/100)*$query->row['special']);
I'm still testing, but for now it seems to work fine!
Thank you very much for this mod (and for FREE)! :)

Sz.L.

Newbie

Posts

Joined
Thu Dec 29, 2011 8:43 pm

Post by JamesMason » Fri Jan 27, 2012 1:52 am

Thank you for this addon, it will help me a lot in the coming months.

www.polarlinks.co.uk - Advertising solution within the UK


User avatar
Newbie

Posts

Joined
Sat Dec 17, 2011 2:42 am

Post by Qphoria » Fri Jan 27, 2012 2:22 am

Good idea but implemented very badly. It looks like you are attempting to replace the full admin/controller/sale/customer_group.php file using vQmod. Looking at the code, I see no reason why you are replacing functions like delete and update which have no changes from the original.

if you are looking to simply give a site wide discount by customer group, simply adding the discount field to the customer group would be only a few lines, and then altering the currency library calculation to display the discount is just one line change.

You are changing a ton of major files with over 2000 lines of code by replacing the entire files and it is just madness the way it is being done. I'm sorry but I would not touch this file and don't recommend anyone uses it in it's current state.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JamesMason » Fri Jan 27, 2012 2:37 am

Erm.... Then can you please realise a free addon to do that same which you do say is a safe method of doing the same. Please make sure it will be a % discount, and not a fixed value.

Oh and make it a vQmod if you can.

www.polarlinks.co.uk - Advertising solution within the UK


User avatar
Newbie

Posts

Joined
Sat Dec 17, 2011 2:42 am
Who is online

Users browsing this forum: No registered users and 3 guests