Please refer to TemplateMonster Support for any issues surrounding TemplateMonster/TemplateTuning Themes – thanks, Jigoshop Team

Print invoices plugin not working, reducing unit price when adding more than 1 in quantity field.

trehopkins

17 Jun, 2013 07:35 PM

If I create an order manually, and I add more than 1 in the quantities column the unit price simply reduces to reflect a percentage of the extended price and final price is not increased at all. For instance if I put 2 for the quantity of an item that cost $16 each, it puts $8 in the Unit Price and it puts $16 in the extended price. It should remain as $16 in the unit column and calculate the price to be $32 in the extended price column. Is there a fix for this problem?

  1. 2 Posted by Thorworx on 16 Aug, 2013 05:29 PM

    Same issue here. This is a serious bug which needs to be fixed.
    It seems to be a problem with the math in the "class-sod-jigoshop-invoices-packingslips.php" file around lines 204-206... but I'm not sure how to fix it.

    It's dividing the actual unit price (item_cost) by the quantity before it figures the tax for the item, then outputting this as "Unit price". Then it outputs the actual unit price (item_cost) without multiplying it by the quantity.

    I tried a couple of things by editing the file, but my php skills aren't the greatest so I didn't have much luck.

  2. Support Staff 3 Posted by Jeff on 17 Aug, 2013 10:26 AM

    Jeff's Avatar

    Ivica has pointed me to this ... and it's not the math so much in invoices and packing slips as it is a deficiency in Jigoshop itself and manual order creation ... something not originally intended and has been 'bolted on' after the fact.

    @Thorworx -- are you manually entering orders as well, or is it editing existing orders that have come from the Checkout?

    There is no UNIT cost in a Jigoshop Order. It is an 'Extended' Cost that is already unit cost and quantity multiplied from the front end.

    But there are different things at work when manually adding an order. Certainly when a product is added to the order in the Admin (http://d.pr/i/XcHW), it is initially a quantity of one AND a Unit cost. This is the only time it will show as a Unit Cost ... manually creating an Order. Change the quantity to 2 and 'recalculate' (using this unit cost) ... we get proper totals (http://d.pr/i/EPPu)

    Before saving the manual order ... the last thing to do (no more recalculate totals) ... is to MIMIC the expectation of the order coming from the Checkout ... and convert that 'Cost' field to an Extended price. You have to do this, Jigoshop doesn't.

    http://d.pr/i/3bsp

    So, a quantity of 2 with unit of price of 10.00 and the 'Cost' field is now showing 20.00 ... and you have manually calculated this out. Save this with the already calculated totals as a 'pending' order initially, and then change it's status to what you want and save it again.

    If you do this ... pdf invoices and packing slips will NOW divide that Extended Cost and provide a correct Unit cost ... because Jigoshop doesn't have a Unit cost in it's Orders.

    And no, this probably isn't documented anywhere, or very well, so let me know if that's not all clear.

  3. 4 Posted by trehopkins on 18 Sep, 2013 10:42 PM

    Is there any plan for Jigoshop or sixtyonedesigns to fix this issue? I have a pretty upset client at the moment : (

  4. 5 Posted by trehopkins on 19 Sep, 2013 11:28 PM

    I followed these instructions and it is still giving me the wrong totals in the pdf version.

    Here are both screens.

    I manually entered all product and hit calculate.

    then I manually entered the correct price for the quantity in the cost column and choose SAVE

    then I tried to print the pdf and it still is wrong.

    Can anyone help with this?

    Below are both the backend and the pdf

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.