Post by reynierpm » Wed Oct 31, 2012 10:35 pm

Hi every, I'll like to add a percent to every price in my products in this way:

Code: Select all

$price = ($price * 1.10) + (($weight + 1) * 39.20) 
Is that possible? How?

User avatar
Active Member

Posts

Joined
Tue Jan 12, 2010 9:51 pm

Post by JAY6390 » Wed Oct 31, 2012 11:36 pm

You mean a permanent change to the prices directly?

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by reynierpm » Wed Oct 31, 2012 11:55 pm

Yes, at least for this store because I'll use in the whole site. Maybe this could happen at model level when I save/update a new product but not so sure about that

User avatar
Active Member

Posts

Joined
Tue Jan 12, 2010 9:51 pm

Post by JAY6390 » Thu Nov 01, 2012 12:00 am

Well if you wanted to do it once quickly, you could run SQL to do it for you

Code: Select all

UPDATE `product` SET `price` = (`price` * 1.1) + ((weight) + 1) * 39.2)
BE SURE TO BACK UP YOUR TABLE BEFORE HAND TO AVOID ANY PROBLEMS

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by reynierpm » Thu Nov 01, 2012 12:12 am

Yes it's a solution but I don't want that because it must works permanently for existent and new products ;) so any other advice?

User avatar
Active Member

Posts

Joined
Tue Jan 12, 2010 9:51 pm
Who is online

Users browsing this forum: No registered users and 71 guests