Results 1 to 10 of 25

Hybrid View

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

    Default Re: Multiple products with fixed quantity pricing

    Check the order class:
    /includes/classes/order.php

    Check the order total module for Total ot_total.php
    /includes/modules/order_total/ot_total.php

    for starters ...
    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!

  2. #2
    Join Date
    Nov 2008
    Posts
    46
    Plugin Contributions
    0

    Default Re: Multiple products with fixed quantity pricing

    Quote Originally Posted by Ajeh View Post
    Check the order class:
    /includes/classes/order.php

    Check the order total module for Total ot_total.php
    /includes/modules/order_total/ot_total.php

    for starters ...
    Well I don't pretend to be a PHP guru but I do have the system in svn and can roughly find my way round Eclipse.... I'll try and run it through the debuggerer and see if I can see anything obvious. Clearly neither of us can see quite what the problem is :-) However, there is one, so that's as good a place to start as any !

    If you want admin access to the site I can PM you a login. I think I can give you svn access - let me know if you want to try and and I will look further.

    Meanwhile, it's the weekend and I think it's beer o'clock :-) Will have a look if I get a chance. If not, Hasta Lunes......

    And thanks once again for all your efforts. It is greatly appreciated. It's why I picked ZenCart......

    B. Rgds
    John

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,873
    Plugin Contributions
    96

    Default Re: Multiple products with fixed quantity pricing

    What is your setting for your admin's Configuration->My Store->Display Prices with Tax? It looks like it might be set to true ...

  4. #4
    Join Date
    Nov 2008
    Posts
    46
    Plugin Contributions
    0

    Default Re: Multiple products with fixed quantity pricing

    Quote Originally Posted by lat9 View Post
    What is your setting for your admin's Configuration->My Store->Display Prices with Tax? It looks like it might be set to true ...
    Display Prices with Tax - false

    :-(

    Still wouldn't explain why it is not adding the tax to give a Total methinks ??

  5. #5
    Join Date
    Nov 2008
    Posts
    46
    Plugin Contributions
    0

    Default Re: Multiple products with fixed quantity pricing

    OK, got bored before bedtime. The calculation is done in order.php here

    Code:
        // Update the final total to include tax if not already tax-inc
        if (DISPLAY_PRICE_WITH_TAX == 'true') {
          $this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost'];
        } else {
          $this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost'];
    At this point I checked in Eclipse and the outputs were :

    $this->info['subtotal'] = 175
    $this->info['tax'] = (double) 0
    $this->info['shipping_cost'] = null

    info Array [16]
    order_status (string:1) 1
    currency (string:3) GBP
    currency_value (string:10) 1.00000000
    payment_method null
    payment_module_code null
    coupon_code null
    shipping_method null
    shipping_module_code null
    shipping_cost null
    subtotal (double) 175
    shipping_tax (int) 0
    tax (double) 0
    total (int) 0
    tax_groups Array [1]
    comments (string:0)
    ip_address (string:29) 192.168.100.24 - 192.168.100.24

    products Array [1]
    0 Array [16]
    qty (int) 100
    name (string:17) 38mm Button Badge
    model (string:6) 338253
    tax (int) 0
    tax_groups Array [1]
    tax_description (string:9) Sales Tax
    price (string:6) 1.7500
    final_price (double) 1.75
    onetime_charges (int) 0
    weight (int) 0
    products_priced_by_attribute (string:1) 0
    product_is_free (string:1) 0
    products_discount_type (string:1) 2
    products_discount_type_from (string:1) 0
    id (int) 222
    rowClass (string:7) rowEven

    Think the problem is earlier in the file but need some sleep now :-)

    B. Rgds
    John

  6. #6
    Join Date
    Nov 2008
    Posts
    46
    Plugin Contributions
    0

    Default Re: Multiple products with fixed quantity pricing

    Gawd this is so frustrating !!! I'm sure the answer is stupidly simple but I'm blowed if I can see it.

    What is most odd is that the correct Tax figure is shown on the payment method page and is set in the variable $order->info[tax_groups] - where it gets that from I cannot see at the minute. But when it tries to look for the tax for calculation of the Total it get a big fat zero.

    As an experiment I tryed to set Config My Store Display Prices with Tax. At first it would not show a price inc. Tax so I updated the Product whereupon it showed it which cured that problem. However I still got

    Sub Total : 250
    Tax : 50
    Total : 250

    That is completely wrong as well and I'm not sure exactly how this should be displayed, but I think it is symptomatic of the problem. If the product is displayed with Tax then this should be a different layout.

    e.g with 20% VAT :

    Goods : 240
    Goods : 120
    SubTotal : 360
    Shipping : 48
    Total : 408
    (Tax : 88)

    I have just put in a clean installation with the exiting database (i.e NO mods to the files whatsoeer apart from configure information) and the results are still the same.

    Guess the next thing to try a a completely clean install :-(

    Yours in desperation :-)

    John

  7. #7
    Join Date
    Nov 2008
    Posts
    46
    Plugin Contributions
    0

    Default Re: Multiple products with fixed quantity pricing

    OK,

    After a frustrating day I *think* there is something not quite right in the tax calculations in order.php :


    In includes/classes/order.php around line 503 +

    $shown_price = (zen_add_tax($this->products[$index]['final_price'] * $this->products[$index]['qty'], $this->products[$index]['tax']))
    + zen_add_tax($this->products[$index]['onetime_charges'], $this->products[$index]['tax']);
    = zen_add_tax (1.75 * 100, 0 + 0, 0)

    I think this is wrong as function zen_add_tax($price, $tax) only wants two parts.....

    Next, I can't describe this bit too well so bear with me ! I think that the variable ($this->products ['index'] ['tax_groups'] - how do you extract a sub/sub/sub array value ???) should be used somehow (in this instance UK VAT)

    This is the result of the $this array at this point :

    products Array [1]
    0 Array [16]
    qty (int) 100
    name (string:17) 38mm Button Badge
    model (string:6) 338253
    tax (int) 0
    tax_groups Array [1]
    ***** UK VAT (double) 20 ***** Here ??
    tax_description (string:6) UK VAT
    price (string:6) 1.7500
    final_price (double) 1.75
    onetime_charges (int) 0
    weight (int) 0
    products_priced_by_attribute (string:1) 0
    product_is_free (string:1) 0
    products_discount_type (string:1) 2
    products_discount_type_from (string:1) 0
    id (int) 222
    rowClass (string:7) rowEven

    Or possibly $taxRates

    $taxRates Array [1]
    UK VAT (double) 20

    Not quite sure how - I put a couple of test lines as follows :

    $my_rate_name = $this->products[$index]['tax_description'];
    $my_rate = $taxRates[$my_rate_name];

    $my_rate becomes outputs : (double) 20

    But at least it's the right number.....

    Not sure where to go from here. Any suggestions please ???

    B. Rgds
    John

 

 

Similar Threads

  1. Quantity discount with multiple products 1.3.9h
    By scotto9 in forum General Questions
    Replies: 2
    Last Post: 27 Dec 2010, 11:24 PM
  2. products-multiple downloads, with individual attribute pricing
    By pushpull in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 17 Aug 2008, 03:06 AM
  3. FIXED Muliple Quantities at FIXED Prices per Multiple Quantity???
    By awarrior in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 4 Apr 2007, 09:42 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