Zen Cart Logo
Forums / Managing Customers and Orders / Attribute Pricing Issue with Invoice

Attribute Pricing Issue with Invoice

Views: 1,893

Results 1 to 15 of 15
26 Feb 2012, 12:31 AM
#1
top_hatt avatar

top_hatt

Zen Follower

Join Date:
Feb 2010
Posts:
237
Plugin Contributions:
0

Attribute Pricing Issue with Invoice

I don't know if this is the right area to post this, so if it isn't let me know where it should go.

I seem to have an unusual problem with attributes. I am using 1.3.9f.

I sell pool cues. On the product description page I have attributes that allows the customer to purchase addons and accessories for the cue. The addons are priced with the same discount as the cue itself.

If the customer purchases an addon and goes to the shopping cart page the addon is noted (without a price) and the price is included in the price calculation correctly.

When the customer goes through the checkout the pricing is correct. Everything is fine until the invoice is printed.

When the invoice is printed the line that shows the purchased addon has the list price of the attribute beside it. Not the discounted price. The total price of the purchase is correct, but if you add up the pricing using the attributes pricing on the invoice it doesn't add up right.

Has anyone ever experienced this type of thing before? I have not had a customer complain about it and frankly I never knew about it until the accountant looked at an invoice and tried to work the numbers backward.

If anyone could help I would appreciate it.

The site is http://poolcuesexpress.com

Dave

26 Feb 2012, 12:39 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attribute Pricing Issue with Invoice

Do you have a specific Product that this happens with?

What prices are setup on the Product and Attributes before the discount?

Are your discounts by Salemaker or by Specials?

What do you see when you go to the shopping_cart page?

What do you see when you go to the checkout_payment page?

What do you see on the Order?

What do you see on the Invoice?

26 Feb 2012, 4:26 AM
#3
top_hatt avatar

top_hatt

Zen Follower

Join Date:
Feb 2010
Posts:
237
Plugin Contributions:
0

Re: Attribute Pricing Issue with Invoice

Ajeh:

I went back through the previous sales and it seems to have happened on all the orders that have an addon attribute.

I am using Salemaker not Special or Featured.

The Attribute pricing is set in the Attribute controller page and the Discount Same as Product is set to ON.

I checked one invoice where there was no Discount Same as Product and the invoice was correct, but it should be following the way the other invoices were.

On the Product Description page the dropdown menu for the attributes show the correct discounted price.

The Shopping Cart page lists the attributes with no individual prices and shows the correct subtotal for the product with the selected attributes.

Again, the Check Out page shows the same thing. The attribute pricing is combined with the product price and calculated correctly.

In the invoice each individual attribute is shown on a separate line with the list price of the attribute in brackets, but no discounted pricing across the page on the right hand side. There it just gives you the correct subtotal with the discounted attribute pricing (no breakdown).

I'm sorry if I'm not explaining it very well. I don't know how to get screenshots and paste them into this editor.

Dave

26 Feb 2012, 1:12 PM
#4
top_hatt avatar

top_hatt

Zen Follower

Join Date:
Feb 2010
Posts:
237
Plugin Contributions:
0

Re: Attribute Pricing Issue with Invoice

Ajeh:

I don't know why I didn't think of this last night but you could check out on the testsite side of my site and see the invoice.

The testsite side is http://poolcuesexpress.com/testsite.

The username is dave
The password is dave123

A typical product that this happens on is:

Predator Cues - Ikon2-5 and purchase a Shaft upgrade or a 2nd shaft or a set of joint protectors.

Go through the checkout using a money order and your invoice should show you what I am talking about.

Dave

26 Feb 2012, 2:11 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attribute Pricing Issue with Invoice

Is it the prices on the Attributes that are not showing the discount or the price on the Product and order total that is not showing the discount?

26 Feb 2012, 3:18 PM
#6
top_hatt avatar

top_hatt

Zen Follower

Join Date:
Feb 2010
Posts:
237
Plugin Contributions:
0

Re: Attribute Pricing Issue with Invoice

The price of the attributes on the product description page show the correct discounted price in the dropdown menu.

The product price uses the correct discounted price during the calculations on the shopping cart page and all during the check out pages.

When the invoice is printed after checkout the attributes are listed with the non discounted price although the correct discounted price is used for the price calculation.

I will see if I can edit an invoice to not show the customers name and upload it as an image.

Dave

26 Feb 2012, 3:22 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attribute Pricing Issue with Invoice

In the Admin, looking at the Order or Invoice the Attributes display their full price ...

The discounted Price is bundled into the Price of the Product ...

In the Invoice, the file:
/admin/invoice.php

you will see the attributes output in the section of code:

      if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) {
        for ($j = 0; $j < $k; $j++) {
          echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
          if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
          if ($order->products[$i]['attributes'][$j]['product_attribute_is_free'] == '1' and $order->products[$i]['product_is_free'] == '1') echo TEXT_INFO_ATTRIBUTE_FREE;
          echo '</i></small></nobr>';
        }
      }

In the Orders, in the file:
/admin/orders.php

you will see the Attributes output in the code:

      if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
        for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
          echo '<br /><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
          if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
          if ($order->products[$i]['attributes'][$j]['product_attribute_is_free'] == '1' and $order->products[$i]['product_is_free'] == '1') echo TEXT_INFO_ATTRIBUTE_FREE;
          echo '</i></small></nobr>';
        }
      }
26 Feb 2012, 3:23 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attribute Pricing Issue with Invoice

NOTE: if you use onetime charges, also look at the code just below the code that I posted ...

26 Feb 2012, 4:04 PM
#9
top_hatt avatar

top_hatt

Zen Follower

Join Date:
Feb 2010
Posts:
237
Plugin Contributions:
0

Re: Attribute Pricing Issue with Invoice

The price of the attributes on the product description page show the correct discounted price in the dropdown menu.

The product price uses the correct discounted price during the calculations on the shopping cart page and all during the check out pages.

When the invoice is printed after checkout the attributes are listed with the non discounted price although the correct discounted price is used for the price calculation.

I will see if I can edit an invoice to not show the customers name and upload it as an image.

Dave

26 Feb 2012, 4:58 PM
#10
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: Attribute Pricing Issue with Invoice

Ajeh:

In the Invoice, the file:
/admin/invoice.php

you will see the attributes output in the section of code:

  if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) {
    for ($j = 0; $j < $k; $j++) {
      echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
      if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
      if ($order->products[$i]['attributes'][$j]['product_attribute_is_free'] == '1' and $order->products[$i]['product_is_free'] == '1') echo TEXT_INFO_ATTRIBUTE_FREE;
      echo '</i></small></nobr>';
    }
  }

Shouldn't be first line of the code be

if (isset($order->products[$i]['attributes']) && (($k == sizeof($order->products[$i]['attributes'])) > 0)) {
26 Feb 2012, 5:03 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attribute Pricing Issue with Invoice

No the single = is correct ...

26 Feb 2012, 6:13 PM
#12
top_hatt avatar

top_hatt

Zen Follower

Join Date:
Feb 2010
Posts:
237
Plugin Contributions:
0

Re: Attribute Pricing Issue with Invoice

Ajeh:

I'm sorry, but you are going to have to explain this in much simpler terms for me to understand.

What exactly do I need to change?

Dave

26 Feb 2012, 6:36 PM
#13
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attribute Pricing Issue with Invoice

On the orders.php if you comment out the Attribute Price you will not see it:

      if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
        for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
          echo '<br /><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
//          if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
//          if ($order->products[$i]['attributes'][$j]['product_attribute_is_free'] == '1' and $order->products[$i]['product_is_free'] == '1') echo TEXT_INFO_ATTRIBUTE_FREE;
          echo '</i></small></nobr>';
        }
      }

On the invoice.php if you comment out the Attribute Price you will not see it:

      if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) {
        for ($j = 0; $j < $k; $j++) {
          echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
//          if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
//          if ($order->products[$i]['attributes'][$j]['product_attribute_is_free'] == '1' and $order->products[$i]['product_is_free'] == '1') echo TEXT_INFO_ATTRIBUTE_FREE;
          echo '</i></small></nobr>';
        }
      }
26 Feb 2012, 9:51 PM
#14
top_hatt avatar

top_hatt

Zen Follower

Join Date:
Feb 2010
Posts:
237
Plugin Contributions:
0

Re: Attribute Pricing Issue with Invoice

Ajeh:

That worked great. Now the attributes do not show any price which is fine.

Thanks for your time and patience.

Dave

26 Feb 2012, 11:09 PM
#15
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attribute Pricing Issue with Invoice

You are most welcome ... thanks for the update that this worked for you ... :smile: