|How to Install Discount Module For Virtuemart|
Latest version 1.1
Virtuemart version 1.1.3
Follow the same instructions below for upgrade, skip the Step 4 (Running SQL queries Modifying Database) only if you are upgrading.
Note: If you are facing problems in implementation of this module, I will do it for you, Please Contact me here
Step 1 (Download)
First you will need to download the files here
Step 2 (Replacing Old Files)
Now Please take the backup of all files and database ... If you cannot take backup of whole site take the back of at least vituemart component foldes which are
Step 3 (Hacking files)
Note: If your virtuemart code is already modified by installation of some other module , Please don't replace the files by unzipping, But add the code in each file by editing the files mentioned below, You can trace code by searching for //binary added comment
After Downloading, unzip the files in your joomla root directory ...(By removing the vmdiscount_vx_x.zip from unzip path)
If you do it the correct way, The files listed below will replace the old files of virtuemart, Please take backup before unzipping.
If you dont have unzip feature and you have just FTP just unzip somewhere ( desktop) and upload the directories through FTP... Like upload the directory /administrator, it will prompt that administrator directory already exists do you want to replace it? , Just click yes , Your whole administrator directory will not be replaced, only the files listed below will be replaced, But a backup is must.Do the same with components directory.
Note: To unzip properly you must make sure that it do not create a separate folder in your root directory.
Note: The Changes and modifications can be traced by looking for the comment code: //binary added
List of files which will be modified
Step 4 (Running SQL queries Modifying Database)
You can skip this step if you are performing an upgrade
Now either import the provided sql "database.sql" file in phpmyadmin or open the file, copy the sql queries and run it from phpmyadmin (Backup is must)
Step 5 (Creating Functions)
Now you will be able to see The new pane with title Discount
Note: I am using Simple Layout
Now before we start using it we will need to register some functions
To create function please do as follows
Now click on the "Function list" of the Discount Module in the list.
and create a new fuctions
Function Name: addDiscount
Note: You should create the above functions exactly as mentioned.
We are almost done, now you can add, delete, update discounts which will apply Globally to all products
Step 7 (Modify Paypal payment method)
Now we have to modify the paypal payment extra info because if we do not it will not subtract from total shown on paypal
Go to Virtuemart administration then Store -> List Payment Methods -> Paypal
Click Configuration Tab
$discount_total = $db->f("coupon_discount") + $db->f("order_discount");
$discount_total = $db->f("coupon_discount") + $db->f("order_discount") + $db->f("quantity_discount");
See the screen shot below and add the highlighted code the same way it looks
Step 8 (Global Configuration)
Open virtuemart global configuration and Save or Apply it once to generate a new control for quantity discount shown below
After saving the configuration file once without any changes you should be able to see the above highlighted control to enable and disable quantity discounts.
Step 9 (Enjoy)
Go to site frond end and add something to your shopping cart
You will see a new Label below subtotal with quantity Discount as shown below
p.s. If you add any improvements to this module please send it to me i will upgrade it here and i will submit it to virtuemart as well Plus if you want to request any feature you can do so in the comments,
The up coming features are
written by bobII, July 05, 2009
Flexibility of module to calculate different discount amounts
written by Andrew Scott, October 02, 2009
Is it possible to give the discount to the cheapest product in range?
written by dhriendra rathod, July 16, 2010