Author Topic: Named Product Discounts  (Read 2722 times)

willowtree

  • Full Member
  • ***
  • Posts: 542
    • Willow Tree Crafts
Named Product Discounts
« on: August 04, 2008, 12:39:34 pm »
I find it can be tricky for me to know which discounts are which in the product form, so I've hacked in discount names, for example christmas sale, weekly offer etc.

It allows you to name discounts, and makes those names visible in the product edit form.

You will need to add the discount_name column to the jos_vm_product_discount table

CREATE TABLE `jos_vm_product_discount` (
  `discount_id` int(11) NOT NULL auto_increment,
  `amount` decimal(12,2) NOT NULL default '0.00',
  `is_percent` tinyint(1) NOT NULL default '0',
  `start_date` int(11) NOT NULL default '0',
  `end_date` int(11) NOT NULL default '0',
  `discount_name` varchar(32) NOT NULL default '',
  PRIMARY KEY  (`discount_id`)
) ENGINE=MyISAM AUTO_INCREMENT=356 DEFAULT CHARSET=latin1 COMMENT='Discounts that can be assigned to products'

Language is hardcoded in so change it if necessary, or swap it for variables,

I did this on vm 1.1 an the files are attached.

Hope it helps anyone,

[attachment cleanup by admin]
Please add your VM and Joomla Version to your signature to make it easier to help you:

Most of my code posted in the forum is for VirtueMart 1.0  -  not for 1.1

Motifman

  • Beginner
  • *
  • Posts: 14
Re: Named Product Discounts
« Reply #1 on: October 16, 2008, 00:40:38 am »
Hello!

I´ve now uploaded those 3 fils to /HTML, and added this tabel (see attachment).
But when I try to save a discount name in admin, it won´t save it. No mather what I type, it doesn´t save it!

Any suggestions?



[attachment cleanup by admin]