Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2006
    Posts
    10
    Plugin Contributions
    0

    Default Price X percentage

    I've set up a field in the products table as percentage

    here's what I'm trying to achieve

    i.e. (price - £10.00) x (percentage - 1.25) = price - £12.50

    Is the a way to hard code this into currencies.php instead of having to go through every file & having to change to products_price*percentage?

    Thanks in advance

    Dave

  2. #2
    Join Date
    Jun 2003
    Posts
    33,825
    Plugin Contributions
    0

    Default Re: Price X percentage

    Can you explain a bit more about why you are pricing this way?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Oct 2006
    Posts
    10
    Plugin Contributions
    0

    Default Re: Price X percentage

    Quote Originally Posted by Kim View Post
    Can you explain a bit more about why you are pricing this way?
    Yes certainly ....

    We have over 5000 products of which prices change hourly
    We have different files that are imported into our DB via XML & CSV using navicat (www.navicat.com)
    Every hour these files updates the cost price into products_price linked via the suppliers SKU
    We set a margin for each product as a percentage so that we don't have to update the price for each product manually

  4. #4
    Join Date
    Oct 2006
    Posts
    10
    Plugin Contributions
    0

    Default Re: Price X percentage

    Ok ...

    Getting closer ... if I add a * 1.25 like below prices work fine

    return $this->format(tep_add_tax($products_price*1.25, $products_tax) * $quantity);

    Which query does the $products_price get called from? then I simply need to add percentage to the query so that I can change the 1.25 to $percentage

  5. #5
    Join Date
    Oct 2006
    Posts
    10
    Plugin Contributions
    0

    Default Re: Price X percentage

    Quote Originally Posted by dave71 View Post
    Ok ...
    return $this->format(tep_add_tax($products_price*1.25, $products_tax) * $quantity);
    Sorry I'm in the process of converting an old OScommerce version to zen cart

    the above should be:-

    return $this->format(zen_add_tax($products_price*1.25, $products_tax) * $quantity);

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,886
    Plugin Contributions
    6

    Default Re: Price X percentage

    You will run into a lot of issues attempting that ...

    You are better off having a field like products_price_cost and products_price_percentage ...

    Then load the new products_price_cost and then update the products_price = products_price_cost*products_price_percentage ... then run the Tools ... Store Manager ... Update Products Price Sorter ...
    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: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  7. #7
    Join Date
    Oct 2006
    Posts
    10
    Plugin Contributions
    0

    Default Re: Price X percentage

    Quote Originally Posted by Ajeh View Post
    You will run into a lot of issues attempting that ...

    You are better off having a field like products_price_cost and products_price_percentage ...

    Then load the new products_price_cost and then update the products_price = products_price_cost*products_price_percentage ... then run the Tools ... Store Manager ... Update Products Price Sorter ...
    Hi

    Thanks for your reply

    So your saying to rewrite the whole of the zen files to add the products_price_cost*products_price_percentage queries?

    Seams it's going to involve a lot of changes to achieve this unless i'm wrong ?

  8. #8
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,886
    Plugin Contributions
    6

    Default Re: Price X percentage

    If I understand you correctly, you have a zillion products and need to increase the prices by individual percentages based on multiple changes per day ...

    The only thing "fixed" is the percentage on a given product ...

    So the simplest thing to do is use 2 fields unrealated to Zen Cart ... that hold your product cost and the percentage ...

    When the product cost gets changed every few hours ... you can just quick update the products_price ... the field Zen Cart uses ... based on your new product cost * the fixed percentage for the given product ...

    Then run the products price sorter update and all prices are updated quickly and painlessly ...

    Your new prices do not break Zen Cart ... and Zen Cart reflects the new products_price as that products price cost * that products percentage ...
    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: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  9. #9
    Join Date
    Oct 2006
    Posts
    10
    Plugin Contributions
    0

    Default Re: Price X percentage

    Linda,

    Thanks
    So what your saying is ....

    Make 2 fields (eg on a different table prices for this example)
    products_price_cost
    products_price_percentage
    Import the new price into each field

    Then export with a select statement - (select prices.products_price_cost*prices.products_price_percentage from prices)

    as a .csv for example
    Then import the combined prices into products_price?

 

 

Bookmarks

Posting Permissions

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