Jump to content
Sign in to follow this  
elari

CONTRIBUTION - Customer Status update v1.1

Recommended Posts

We need to use the order_total modules and the ot_members_discount and with staffelpreise.

 

Come on!!!

You are better than me...

 

:)

Share this post


Link to post
Share on other sites

i have got some time yesterday to test the modules with the new checkout and they seems to work without problems.

it seems order total modules are not affected by the new checkout so it would be not too difficult to make change for the new chekout

until i finished the to update my shop to the new chekout i would not have enough time to update also customers status

Share this post


Link to post
Share on other sites

Still trying to implement the customers status

i get this error when trying to add a status:

1110 - Column 'customers_status_ot_discount_flag' specified twice



insert into customers_status (customers_status_name, customers_status_image, customers_status_discount, customers_status_ot_discount_flag , customers_status_ot_discount, customers_status_staffelpreis, customers_status_id, language_id, customers_status_ot_discount_flag) values ('sdf', '', '', '0', '', '0', '1', '1', '0')



[TEP STOP]

 

any clues on that?


"If we don't succeed, we run the risk of failure." George W. Bush, Jr

Share this post


Link to post
Share on other sites

it was a mistake i made in an old file of customers_status.php

check it is something like

'customers_status_ot_discount_flag ' instead of

'customers_status_ot_discount_flag' and it occurs in 2/3 variable

 

however cstatus is now working for new checkout in version 2 and this mistake does not occur

Share this post


Link to post
Share on other sites

elari, i'm using your file's wich you have put in you zipfile.

I used this sql statement to get customer status to work:

ALTER TABLE `customers` ADD `customers_status` INT( 5 ) DEFAULT '0' NOT NULL;



ALTER TABLE `customers` ADD `member_flag` CHAR(1) DEFAULT '0' NOT NULL;



CREATE TABLE customers_status (

 customers_status_id int(11) NOT NULL default '0',

 language_id int(11) NOT NULL default '1',

 customers_status_name varchar(32) NOT NULL default '',

 customers_status_image varchar(64) default NULL,

 customers_status_discount decimal(4,2) default '0',

 customers_status_ot_discount_flag char(1) NOT NULL default '0',

 customers_status_ot_discount decimal(4,2) default '0',

 PRIMARY KEY  (customers_status_id,language_id),

 KEY idx_orders_status_name (customers_status_name)

) TYPE=MyISAM;





CREATE TABLE customers_status_history (

 customers_status_history_id int(11) NOT NULL auto_increment,

 customers_id int(11) NOT NULL default '0',

 new_value int(5) NOT NULL default '0',

 old_value int(5) default NULL,

 date_added datetime NOT NULL default '0000-00-00 00:00:00',

 customer_notified int(1) default '0',

 PRIMARY KEY  (customers_status_history_id)

) TYPE=MyISAM;



ALTER TABLE `customers_status` ADD `customers_status_staffelpreis` VARCHAR( 1 ) NOT 



NULL;





INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , 



`configuration_key` , `configuration_value` , `configuration_description` , 



`configuration_group_id` , `sort_order` , `last_modified` , `date_added` , 



`use_function` , `set_function` )

 VALUES (

 '', 'Default Order Status For New Customers', 'DEFAULT_CUSTOMERS_STATUS_ID', '0', 



'When a new customer is created, this customer status will be assigned to it.', '6', 



NULL , '2002-09-04 10:56:21', '2002-09-04 10:56:21', NULL , NULL

 );





CREATE TABLE newsletters_history (

 news_hist_id int(11) NOT NULL default '0',

 news_hist_cs int(11) NOT NULL default '0',

 news_hist_cs_date_sent date default NULL,

 PRIMARY KEY  (news_hist_id)

) TYPE=MyISAM;



ALTER TABLE `orders` ADD `customers_status` DECIMAL( 4,2 ) DEFAULT 'x' NOT NULL AFTER 



`currency_value`;



ALTER TABLE `products` ADD `products_discount_allowed` DECIMAL( 4,2 ) DEFAULT 'x' NOT 



NULL AFTER `products_price`;



INSERT INTO `configuration` (`configuration_id`, `configuration_title`, 



`configuration_key`, `configuration_value`, `configuration_description`, 



`configuration_group_id`, `sort_order`, `last_modified`, `date_added`, 



`use_function`, `set_function`) VALUES ('', 'Default max products discount allowed', 



'MAX_PRODUCTS_DISCOUNT_ALLOWED', '5', 'Set to 0 to disable discount, any other to 



allow.', '3', '2', '', '', NULL, NULL);











ALTER TABLE `orders_products` ADD `products_customers_status_discount` DECIMAL( 4, 2 



) AFTER `products_price`;



ALTER TABLE `orders_products` CHANGE `products_customers_status_discount` 



`products_discount_made` DECIMAL( 4, 2 ) DEFAULT NULL;







CREATE TABLE products_staffelpreis (

 products_id int(11) NOT NULL default '0',

 quantity int(11) NOT NULL default '0',

 unitprice decimal(15,4) NOT NULL default '0.0000',

 KEY products_id (products_id)

) TYPE=MyISAM;











ALTER TABLE `customers_basket` ADD `customers_basket_discount_made` DECIMAL( 4, 2 ) 



DEFAULT '0';











DROP TABLE IF EXISTS helpdesk;

CREATE TABLE helpdesk (

 id int(255) UNSIGNED NOT NULL AUTO_INCREMENT,

 name VARCHAR(255) NOT NULL,

 email TEXT NOT NULL,

 problem TEXT NOT NULL,

 solution TEXT NOT NULL,

 status TEXT NOT NULL,

 date TEXT NOT NULL,

 priority TEXT NOT NULL,

 PRIMARY KEY (id)

);



DROP TABLE IF EXISTS helpdesk_members;

CREATE TABLE helpdesk_members (

 username VARCHAR(255) NOT NULL,

 password TEXT NOT NULL,

 email TEXT NOT NULL,

 signature TEXT NOT NULL,

 PRIMARY KEY (username)

);

INSERT INTO helpdesk_members VALUES 



('admin','password','yourname@yourstore.com','Your Name<BR>Technical 



Support<BR>http://www.yourstore.com');



INSERT INTO configuration VALUES ('', 'Support Email Address', 



'SUPPORT_EMAIL_ADDRESS', 'support@yourstore.com', 'Support email address', 1, '99', 



'', '', NULL, NULL); 



ALTER TABLE `products` ADD `products_quantity_display_allowed` INT( 1 ) DEFAULT '0' 



NOT NULL AFTER `products_quantity`;

## To update all products to 0 use this query

## UPDATE products set products_quantity_display_allowed ='0' where 



products_quantity_display_allowed='1';

## To update all products to 1 use this query

## UPDATE products set products_quantity_display_allowed ='1' where 



products_quantity_display_allowed='0';



INSERT INTO `configuration` (`configuration_id`, `configuration_title`, 



`configuration_key`, `configuration_value`, `configuration_description`, 



`configuration_group_id`, `sort_order`, `last_modified`, `date_added`, 



`use_function`, `set_function`) VALUES ('', 'Quantity breakout display', 



'PRODUCTS_QUANTITY_BREAKOUT', '3', 'Value to allow or not display. (default =3).', 



'8', '6', '', '', NULL, NULL);

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, 



`configuration_key`, `configuration_value`, `configuration_description`, 



`configuration_group_id`, `sort_order`, `last_modified`, `date_added`, 



`use_function`, `set_function`) VALUES ('', 'Quantity breakout display operator', 



'PRODUCTS_QUANTITY_BREAKOUT_OPERATOR', '>', 'Operator string (<, <=, == , !=, >=, >) 



to allow or not display breakout. (default >).', '8', '6', '', '', NULL, NULL);



DROP TABLE IF EXISTS accounting;

CREATE TABLE accounting (

 acc_id int(11) NOT NULL auto_increment,

 acc_order_id int(11) default NULL,

 acc_customer_id int(11) default NULL,

 acc_customer_first_name varchar(32) NOT NULL default '',

 acc_customer_last_name varchar(32) NOT NULL default '',

 acc_dc int(1) NOT NULL default '0',

 acc_amount decimal(15,4) default NULL,

 acc_date date default NULL,

 acc_currency char(3) NOT NULL default '',

 acc_currency_value decimal(14,6) NOT NULL default '0.000000',

 acc_payement_method varchar(32) NOT NULL default '',

 PRIMARY KEY  (acc_id),

 UNIQUE KEY acc_id (acc_id)

) TYPE=MyISAM;



#Add an Accounting group in configuration_group table value 14

INSERT INTO configuration_group (configuration_group_id, configuration_group_title, 



configuration_group_description, sort_order, visible) VALUES (14, 'Accounting', 



'Accounting options', 14, 1);

#Add default values in configuratin table

#Status Order needed to allow order to be added in accounting table

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, 



`configuration_key`, `configuration_value`, `configuration_description`, 



`configuration_group_id`, `sort_order`, `last_modified`, `date_added`, 



`use_function`, `set_function`) VALUES ('', 'Order status required', 



'ACC_ORDER_STATUS_REQUIRED', '3', 'Usually will be when order is shipped. (Osc 



default shipped status = 3).', '14', '1', '', '', NULL, NULL);

#Max default allowed credit for customer

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, 



`configuration_key`, `configuration_value`, `configuration_description`, 



`configuration_group_id`, `sort_order`, `last_modified`, `date_added`, 



`use_function`, `set_function`) VALUES ('', 'Max Allowed default credit', 



'ACC_MAX_ALLOWED_CREDIT', '500', 'Maximum credit allowed by default to customers.).', 



'14', '2', '', '', NULL, NULL);

#String for Debit

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, 



`configuration_key`, `configuration_value`, `configuration_description`, 



`configuration_group_id`, `sort_order`, `last_modified`, `date_added`, 



`use_function`, `set_function`) VALUES ('', 'Default sign for account debit 



(invoice)', 'ACC_DEBIT', 'D', 'Usual is set to display D before amount but you can 



select - .', '14', '3', '', '', NULL, NULL);

#String for Credit

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, 



`configuration_key`, `configuration_value`, `configuration_description`, 



`configuration_group_id`, `sort_order`, `last_modified`, `date_added`, 



`use_function`, `set_function`) VALUES ('', 'Default sign for account credit 



(payement)', 'ACC_CREDIT', 'C', 'Usual is set to display C before amount but you can 



select + or nothing .', '14', '4', '', '', NULL, NULL);

wich does the trick

But:

- When i give a person a discount of say 50 % in the store no where does the price change! not even at checkout

- when i make a new account it give an error about the mail:

is say's the headers are already sent

 

any clues?

Do i need to make changes to my php files?

By the way, the sollution you gave for the displayed twice error worked!


"If we don't succeed, we run the risk of failure." George W. Bush, Jr

Share this post


Link to post
Share on other sites

ALTER TABLE `products` ADD `products_discount_allowed` DECIMAL( 4,2 ) DEFAULT 'x' NOT

 

NULL AFTER `products_price` ;

 

read again the install about this query...

and replace x by default max value discount for a product

 

# Use this query to update all products table to the max allowed discount you want to set

# change 10 by discount you want to apply by default & x by the actual value in your products table

# update products set products_discount_allowed='10' where products_discount_allowed = 'x';

 

 

 

in your case 50% is higner than x so no discount is applied

 

 

----------------------------------------------------------------------------

- when i make a new account it give an error about the mail:

is say's the headers are already sent

 

check your file, there is a missing ' or something like....

 

-----------------------------------------------------------------------------

 

thanks for the full sql query, i had no time to write it for making all my mod working in one time :)

 

if you updated to new checkout customers status v2 is working.

Share this post


Link to post
Share on other sites

thnx dude, i took me a while, but i'm getting the hang of this!


"If we don't succeed, we run the risk of failure." George W. Bush, Jr

Share this post


Link to post
Share on other sites

but now begin work on new checkout i will no more update cstatus for old checkout

Share this post


Link to post
Share on other sites

Elari

 

Question, is there a way to download all those files from your cvs from customer v.2? i mean all those php-files you posted there??

I want to test with those, but i think it would be wasted time to copy and then past it, if you are willing to post it in a zip, or tell me if there is a faster way tot get it from your cvs.

 

By the way.. thnx for all your help so far, this GPL thing is new to me but it rocks!


"If we don't succeed, we run the risk of failure." George W. Bush, Jr

Share this post


Link to post
Share on other sites

use search function :)

 

all zip are here

www.unlockgsm.com/dload-osc/

Share this post


Link to post
Share on other sites

Elari,

 

Great work!

 

I am trying to implement 'customer status v.2', so far so good.

Had to add the following columns in table 'orders'(for purchasing a product, it displayed an error 'column not found'):

custumers_company

delivery_company

billing_name

billing_company

billing_street_address

billing_suburb

billing_city

billing_postcode

billing_state

billing_country

billing_address_format_id

 

But the real problem: when adding a status for, let's say, a new customer, and assign him/her to a discount of 10%, this discount is nowhere to be found! And when buying a product it does not give any discount!

However, total-order-discount works excellent.


'Time is a social construction to make the transitoriness manageable'

Share this post


Link to post
Share on other sites

1/ please refer to thread for cstatus v2 that is updated to new checkout. it includes link to download lastest files or go to cvs....

v1.x is only for checkout before nov

 

 

2/ yes table must be updated but this is new chekout job to do... not cstatus

 

2/ i have lost some change in v2, discount is not reported in tables order but discount is made and calculated no problem for that.

Share this post


Link to post
Share on other sites

Hi Elari,

 

Can customer_status add on make a discount for all products without introduce it product by product?

 

And, what prices are displayed? Normal or with the discount? (I'm interested in normal prices that, al last, in check out, are replaced by discount ones (but cusatomers can see old prices, for taking advice that the discount is running...).

 

Thanks a lot,

 

Joan


joan@delaterra.net

www.delaterra.net

organic food in Catalonia

Share this post


Link to post
Share on other sites

discount is set by customer group of status

member 5%

reseller 15%

wholesaler 60% :)

 

for each product you MUST set a max discount allowed in the tables, you can set them by one query to 100% for all products but it let you to preserve margin on some low benefits products

 

price are displayed with discount and final price according to customer when he log in

 

demo shop http://www.unlockgsm.com/test_checkout/cat...log/default.php

if i make no mistake when you create account you will have discount + order total discount.

Share this post


Link to post
Share on other sites

Elari,

This is the english part of my shop. It is the way i want it:

true.jpg

This is the dutch part of the shop, wich file do i have to adjust to have calculate the discount just like the english one?

false.jpg


"If we don't succeed, we run the risk of failure." George W. Bush, Jr

Share this post


Link to post
Share on other sites

i don't understand why but if i remember there is nothing that is language dependant to display discount... should miss some "%" or "Discount" or translation files but not the calculation themselves....

however try to check all translated files included in my package.

i will also try to check what i had made for that :)

Share this post


Link to post
Share on other sites

look also at my demo page for customers status and if you want send me your dutch translation files i will upload them to test

Share this post


Link to post
Share on other sites

:) i'm not here to make all job

take time yourself to compare all languages files and updated them to necessary string

after if still not work i should take a look

Share this post


Link to post
Share on other sites

sure! bu you asked for my dutch files, so i gave you the link, don;t think i;m sitting on my ass waiting for you to do the work!!

I'm trying my ass of here!

 

Thnx for your help so far!!


"If we don't succeed, we run the risk of failure." George W. Bush, Jr

Share this post


Link to post
Share on other sites
discount is set by customer group of status

member 5%

reseller 15%

wholesaler 60% :)

 

for each product you MUST set a max discount allowed in the tables, you can set them by one query to 100% for all products but it let you to preserve margin on some low benefits products

 

price are displayed with discount and final price according to customer when he log in

 

demo shop http://www.unlockgsm.com/test_checkout/cat...log/default.php

if i make no mistake when you create account you will have discount + order total discount.

 

Hi Elari,

 

Tell me if thet is true:

"If I set a 50% max disacount for all my products, then a customer with a 10% of discount can see ALL products with this discount?"

 

---

 

Can I access to the Admin part? Or is there any file with abilities of your addon?

 

By the way, is specials discount added to your discounts?

 

Thanks a lot,

 

Joan


joan@delaterra.net

www.delaterra.net

organic food in Catalonia

Share this post


Link to post
Share on other sites

yes !

if you set max discount to 50% all customer with discount lower than 50% will get the discount you put in customer status like 10% !

 

did you checked my demo page :)))))

 

give me email / name and i will update a status for you

Share this post


Link to post
Share on other sites
yes !

if you set max discount to 50% all customer with discount lower than 50% will get the discount you put in customer status like 10% !

 

did you checked my demo page :)))))

 

give me email / name and i will update a status for you

 

 

Yes, I've check it. Last step in checkout http://www.unlockgsm.com/test_checkout/cat...out_process.php has failed (white screen in the browser)

 

I think it will be good for my needs (not product discounts, only global discounts). I'm fear of update all files your addon need, but there is no option!

 

By the way, my adress is joan@delaterra.net and my name is Joan Cervan

 

Thanks a lot Elari,

 

Joan


joan@delaterra.net

www.delaterra.net

organic food in Catalonia

Share this post


Link to post
Share on other sites

yes it hanged because a change made with lastest update in checkout_process and put back oldest version so can test now ....

i will rework on this file

 

however the lastest files in use in demo at this time are not published and the last published one are ok :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×