Version: 1.0, by zefyx
Developer Last Online: Jan 2013
Category: Mini Mods -
Version: 3.8.x
Rating:
Released: 04-17-2009
Last Update: 09-01-2015
Installs: 43
DB Changes Uses Plugins Template Edits
Re-useable Code Additional Files Translations Is in Beta Stage
No support by the author.
Quote:
This modification is released with permission of the Re-usable Code from this modification.
vBDiscounts v1.0:
This hack allows the user to input a discount code that deducts the value of it from the subscription costs before they go to pay for a subscription.
For example:
1. You advertise for new members and have and advert saying 'Join before the end of April and get $10.00 off the first month! Just register and enter discount code 10OFF"
2. In Admincp -> vbDiscounts you configure a discount called 10OFF with value of 10, and set a date for the validity of the discount.
3. User registers, and enters discount code 10OFF on the payments.php page. The page updates the normal subscription prices to reflect the offer. Then they go to pay for it.
Notes:
1. Since the offer code expires when you set it to, the users will not be able to renew with that discount unless the subscription runs out before the discount validity does; thus it's better to use short-validity discounts and constantly change them.
2. The value of the discount in the Admin Panel is given as a monetary value, e.g. a discount with value 3.50 will give $3.50 (?3.50; ?3.50, depending on currencies activated) off paid subscription before the user goes to pay for it.
Features:
* Fully working on vBulletin 3.8.x
* Manage Discounts: Singly Add/Edit/Delete; Mass-delete.
* Set discount valid for particular subscription ID's.
* Limit use by date or times it can be used.
* Mass-Generate discounts for distribution.
* Generate discount discount codes and post to a new thread in a specified forum. A message may be sent with the codes. You can decide the thread title too.
I have it installed for a client and all the templates are ok but discounts are not going through to PayPal once a member is redirected there..
Thanks
I have almost the same problem, i charge ?4 per month VIP and the discount ment to discount ?2 but no its not taken off the costs even though it states its updated the prices. :l
CREATE TABLE IF NOT EXISTS `coupons` (
`couponid` int(10) unsigned NOT NULL auto_increment,
`couponname` varchar(50) NOT NULL default '',
`couponvalue` int(3) unsigned NOT NULL default '0',
`couponvalidfrom` DATE,
`couponvalidto` DATE,
PRIMARY KEY (`couponid`)
) TYPE=MyISAM;
MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 8
Error Number : 1064
Request Date : Tuesday, September 1st 2015 @ 04:27:39 AM
Error Date : Tuesday, September 1st 2015 @ 04:27:39 AM
Script : http://www.premiumkenti.com/gizlicp/...=productimport
Referrer : http://www.premiumkenti.com/gizlicp/...?do=productadd
IP Address : REMOVED
Username : REMOVED
Classname : vB_Database
MySQL Version : 5.5.42-cll
CREATE TABLE IF NOT EXISTS `coupons` (
`couponid` int(10) unsigned NOT NULL auto_increment,
`couponname` varchar(50) NOT NULL default '',
`couponvalue` int(3) unsigned NOT NULL default '0',
`couponvalidfrom` DATE,
`couponvalidto` DATE,
PRIMARY KEY (`couponid`)
) TYPE=MyISAM;
MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 8
Error Number : 1064
Request Date : Tuesday, September 1st 2015 @ 04:27:39 AM
Error Date : Tuesday, September 1st 2015 @ 04:27:39 AM
Script : http://www.premiumkenti.com/gizlicp/...=productimport
Referrer : http://www.premiumkenti.com/gizlicp/...?do=productadd
IP Address : REMOVED
Username : REMOVED
Classname : vB_Database
MySQL Version : 5.5.42-cll
I removed your username and IP address form this error message, never post your IP - simply edit and remove .
Also please do not report a modification thread unless its a security risk, a general error is not deemed a report worthy.... umm report!
Edit: Ignore the below strike through notes, I left them for reference purposes only. Instead of doing the below edit, simply download the file "product-vbdiscountsTYPE-OR-ENGINE-MySQL-Fix.xml " and install that XML file instead of the one included, this willnew version will check to see what mysql version you're on and assign type or engine accordingly. I took the original file and edited for those who do not know how. *This is NOT required unless you have an error identical to Premiumkenti's issue above.
[S]On a side note, seems the .xml needs to be edited, edit the .xml file with Notepad++ (Google it and download and install that program to edit, DO NOT USE Windows Notepad/Wordpad it can cause issues) and find this in the file:
Code:
TYPE=MyISAM;
Change to:
Code:
ENGINE=MyISAM;
Save the .xml file, now install the mod and done .[/S]
Updated once more, the fixed file "product-vbdiscountsTYPE-OR-ENGINE-MySQL-Fix.xml" now checks your mysql version and assigns TYPE or ENGINE accordingly .
Example:
PHP Code:
// Check for TYPE or ENGINE based on version from what I read it was still in 5.1.45 fully but only partially there afterwords - TheLastSuperman $mysql_version = $db->query_first("SELECT version() AS version"); define('MYSQL_VERSION', $mysql_version['version']); $type_or_engine = (version_compare(MYSQL_VERSION, '5.1.45', '<')) ? 'TYPE' : 'ENGINE';
$vbulletin->db->query_write(" CREATE TABLE IF NOT EXISTS `". TABLE_PREFIX ."discounts` ( `discountid` int(10) unsigned NOT NULL auto_increment, `discountname` varchar(50) NOT NULL default '', `discountvalue` int(3) unsigned NOT NULL default '0', `discountvalidfrom` DATE, `discountvalidto` DATE, PRIMARY KEY (`discountid`) ) $type_or_engine=MyISAM ");