Zen Cart Logo
Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Adding discount coupons when processing order in admin section

Adding discount coupons when processing order in admin section

Views: 1,958

Results 1 to 10 of 10
17 Jan 2012, 00:28
#1
balambi avatar

balambi

New Zenner

Join Date:
Jan 2012
Posts:
6
Plugin Contributions:
0

Adding discount coupons when processing order in admin section

I've spent the last few days trying to figure this out short of writing the code myself.
How do I add a discount coupon code when creating an order in the admin section. For example I have a customer that calls up and wants me to create the order for them rather than they doing it from the website (front-end) however there isn't any option that allows for that discount code to be entered in the admin section.
e.g when logged in to admin --> customers -->create/edit oders--> there is no option to the enter the discount code...

Any suggestions / fix?

17 Jan 2012, 00:40
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Adding discount coupons when processing order in admin section

The easiest option would be to use Admin Login As Customer (from the Free Software Add Ons at the top left), and just run the order on the front end.

17 Jan 2012, 21:38
#3
balambi avatar

balambi

New Zenner

Join Date:
Jan 2012
Posts:
6
Plugin Contributions:
0

Re: Adding discount coupons when processing order in admin section

I got this error when trying to install the pass.sql patch

1064 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 7
in:
[CREATE TABLE zen_zen_upgrade_exceptions ( upgrade_exception_id smallint(5) NOT NULL auto_increment, sql_file varchar(50) default NULL, reason varchar(200) default NULL, errordate datetime default '0001-01-01 00:00:00', sqlstatement text, PRIMARY KEY (upgrade_exception_id) ) TYPE=MyISAM ]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

any suggestions would be helpful
thanks in advance

17 Jan 2012, 21:54
#4
balambi avatar

balambi

New Zenner

Join Date:
Jan 2012
Posts:
6
Plugin Contributions:
0

Re: Adding discount coupons when processing order in admin section

got rid of that error by replacing TYPE='MyISAM' with ENGINE=MyISAM
in the sqlpatch.php file

17 Jan 2012, 22:02
#5
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Adding discount coupons when processing order in admin section

Thank you for describing this error, and its resolution, which other people are sure to come across.

(adding a restatement to help searchers.)
Newer versions of MySQL require the syntax

ENGINE=MyISAM

instead of

TYPE=MyISAM

just change the SQL and run it again.

17 Jan 2012, 23:28
#6
balambi avatar

balambi

New Zenner

Join Date:
Jan 2012
Posts:
6
Plugin Contributions:
0

Re: Adding discount coupons when processing order in admin section

after running the pass.sql
I now get this error
ERROR: Cannot insert configuration_key "MASTER_PASS" because it already exists

not 100% sure what to make of it.. since I didn't set that password..
should the script be written to update rather than insert?

current script..

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description,

configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('Master

Password', 'MASTER_PASS', 'v2cigs99@', 'This password will allow you to login to any customer's account.', 1, 23,

now(), now(), NULL, NULL);

17 Jan 2012, 23:30
#7
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Adding discount coupons when processing order in admin section

That part of the original script succeeded; just the create table failed and you fixed that by making the change you posted.
You're good to go now - set the password in admin->configuration->my store.

18 Jan 2012, 00:04
#8
balambi avatar

balambi

New Zenner

Join Date:
Jan 2012
Posts:
6
Plugin Contributions:
0

Re: Adding discount coupons when processing order in admin section

GREAT IT WORKS >>>>>THANKS A MIL FOR YOU HELP.. . saved me from having to write code for this :)

18 Jan 2012, 00:22
#9
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,682
Plugin Contributions:
56

Re: Adding discount coupons when processing order in admin section

Glad to help. You can show your appreciation by supporting the Zen Cart project using the Donate link at the top right hand side of this page.

21 Jan 2012, 00:37
#10
balambi avatar

balambi

New Zenner

Join Date:
Jan 2012
Posts:
6
Plugin Contributions:
0

Re: Adding discount coupons when processing order in admin section

quick follow up.... how do I modify the code such that every time that someone wants to sign in as a customer the master password will be required. ?
currently >> once placeorder is clicked then one is automatically signed in as the customer. I want it to be restricted such that only individual/s with that master password can sign as a customer. ..
so once place order is clicked the email address shows up and the password field is blank and then the master password will be input.