Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2008
    Posts
    5
    Plugin Contributions
    0

    Default Help finding price calculator files

    Hi,
    I am a PHP developer and I've been recently introduced to Zen Cart (due to work) at first it was very confusing and it still is but I am not as clueless as before. It's really complicated when there are +200 files and you don't know which is which. But I still love the amazing flexibility Zen Cart has.

    Anyways, I have a store that sells canvas, and the user uploads his picture, choses a frame and it asks for the printing width and height.

    The frames are priced per foot so to get the price of what the user wants I do

    Price = (((width*2)/12)*Frame_Price) + ((height*2)/12)*Frame_Price)) + Canvas_Type_Price

    And that gives me the price for the product.


    I have edited the function attributes_price($products_id) so it gives me the price based on the attributes (frame/height/width)

    Function found in /includes/classes/shopping_cart.php

    When I add the product to the cart, the product itself has the correct price, but the subtotal and the top bar have a different price


    TOP BAR:
    Total Items: 1 Weight: 1lbs Amount: $36.55

    and the cart looks something like this:

    Canvas One ($95.55)

    * Width - 12
    * Height - 12
    * Frame - Frame 1 ($20 per foot)


    Sub-Total: $36.55

    How would I make it so the price is constant everywhere? I've had no luck finding the other price calculating functions that give me that price.

    Could some one point me in the right direction?

    Thanks,
    - Grind

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Help finding price calculator files

    Really depends upon what line(s) you have hacked??
    As whatever you have done is apparently not being passed to the other functions
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Aug 2008
    Posts
    5
    Plugin Contributions
    0

    Default Re: Help finding price calculator files

    As far as I understand

    I hacked the function attributes_price() on line 827
    File: includes/class/shopping_cart.php



    PHP Code:
     /**
       * Method to calculate price of attributes for a given item
       *
       * @param mixed the product ID of the item to check
       * @return decimal the pice of the items attributes
       * @global object access to the db object
       */
      
    function attributes_price($products_id

  4. #4
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: Help finding price calculator files

    So did you add this to that file?
    Code:
    Price = (((width*2)/12)*Frame_Price) + ((height*2)/12)*Frame_Price)) + Canvas_Type_Price
    Or replace this with it?
    Code:
    function attributes_price($products_id)
    Is this available where one can see what you are describing? url?
    Zen-Venom Get Bitten

  5. #5
    Join Date
    Aug 2008
    Posts
    5
    Plugin Contributions
    0

    Default Re: Help finding price calculator files

    Yes and No, I disabled the code inside the function and I replaced it with my own.

    I thought modifying it would change all the prices since its a function.

    I want to find the other functions that calculate the price.

    Thanks

 

 

Similar Threads

  1. v139e Help finding css to change price font size!
    By Peace74 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 1
    Last Post: 5 Feb 2012, 04:22 PM
  2. finding files
    By JasonRocket in forum General Questions
    Replies: 1
    Last Post: 13 Jan 2009, 04:11 PM
  3. Help finding files...
    By nrg77 in forum General Questions
    Replies: 4
    Last Post: 16 Sep 2007, 06:17 AM
  4. Help finding my stylesheet.css files please
    By angelicdezigns in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 30 Jun 2006, 10:46 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