Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Feb 2011
    Posts
    39
    Plugin Contributions
    0

    Default Price-Range Percentage Profit Markup [SEMI-WORKING] Need Help!

    Hi there,

    I searched high and low for a way to set a profit margin based on the product price.

    For example if you are importing from a distributors stock list then you may need to calculate how much profit you make from the "cost price" in the stock list.

    ie:
    £0 - £20 = 20%
    £21 - £40 = 15%
    £41 - £60 = 10%

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

    Having not found a solution I decided to try and edit the values in the database.

    Here is what ive got so far:

    Code:
    UPDATE `products` SET `products_price` = (`products_price` * 1.20) WHERE `products_price` >= 0 AND `products_price` <= 20 ;
    UPDATE `products` SET `products_price` = (`products_price` * 1.15) WHERE `products_price` >= 21 AND `products_price` <= 40 ;
    UPDATE `products` SET `products_price` = (`products_price` * 1.10) WHERE `products_price` >= 41 AND `products_price` <= 60 ;
    It does appear to be working for some of the handle values ive tried, like products between 41-60 seem to work correctly and have the new price but others like the 0-20 and 21-40 dont seem to have changed.

    Am I doing this correctly? or is there a better way to add a cost based markup on products.

    I would really appreciate some assistance on this, im no expert in mysql but I do have a little knowledge but hopefully someone can point me in the right direction.

    Im sure many others would benefit from this mod too :)

    Thanks in advance.

    Andy

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Price-Range Percentage Profit Markup [SEMI-WORKING] Need Help!

    One problem I see is aren't you updating the prices for the 0 - 20 and that puts it in the range for the next update 21 - 40 ...

    Perhaps you should run that backwards and do the higher priced first and work your way backwards in the price ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Feb 2011
    Posts
    39
    Plugin Contributions
    0

    Default Re: Price-Range Percentage Profit Markup [SEMI-WORKING] Need Help!

    Ah yes that did the trick!

    Thankyou 1000 times Ajeh :)

    The final SQL commands I made were :

    Code:
    UPDATE `products` SET `products_price` = (`products_price` * 1.05) WHERE `products_price` >= 201 AND `products_price` <= 500 ;
    UPDATE `products` SET `products_price` = (`products_price` * 1.07) WHERE `products_price` >= 81 AND `products_price` <= 200 ;
    UPDATE `products` SET `products_price` = (`products_price` * 1.10) WHERE `products_price` >= 61 AND `products_price` <= 80 ;
    UPDATE `products` SET `products_price` = (`products_price` * 1.13) WHERE `products_price` >= 41 AND `products_price` <= 60 ;
    UPDATE `products` SET `products_price` = (`products_price` * 1.15) WHERE `products_price` >= 21 AND `products_price` <= 40 ;
    UPDATE `products` SET `products_price` = (`products_price` * 1.18) WHERE `products_price` >= 0 AND `products_price` <= 20 ;
    All seems to be in order and calculated correctly :)

    I will probably expand on this and make it into a addon, or at least a php or sql file and cronjob instructions or something publicly available.

    Thanks again :)

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Price-Range Percentage Profit Markup [SEMI-WORKING] Need Help!

    You are most welcome ... thanks for the update that this worked for you and for posting what you used ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. Profit Markup/Margin Calculator
    By Farrukh in forum All Other Contributions/Addons
    Replies: 156
    Last Post: 17 Sep 2013, 10:43 AM
  2. Replies: 0
    Last Post: 26 Apr 2010, 05:36 AM
  3. Profit Markup Calculator for 1.38?
    By mrcastle in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 15 Mar 2010, 08:41 AM
  4. Profit Markup/Margin Calculator - Product Type
    By simon-m in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 5 Jul 2006, 06:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg