Is there a difference between these two pages that would cause certain items to show on the one, but not on the other.

I'm using a customized admin and invoice template and for some reason, even though they're pulling exactly the same information some things are left out on the invoice. I'm not sure I understand why.

Regards
Francois.

Comments

longwave’s picture

Status: Active » Postponed (maintainer needs more info)

The view order page is generated from the panes selected at /admin/store/settings/orders/edit/panes, the invoice is entirely controlled by your template (note that there are "invoice" checkboxes on the pane admin page, but these don't actually do anything...)

If you explain what you are seeing on the order and invoice pages, and what you expect to see instead, maybe we can help further.

FranCarstens’s picture

Okay, let me give some more detail. Probably should have done that to begin with.

I'm specifically referencing the following pages:

www.site.com/admin/store/orders/14396
www.site.com/admin/store/orders/14396/invoice

The following code is used to provide output for "attribute quantities" in both uc_order-admin.tpl.php and uc_order-customer.tpl.php

uc_order-customer.tpl.php:

<?php if (is_array($product->data['attributes']) && count($product->data['attributes']) > 0) {?>
<?php foreach ($product->data['attributes'] as $attribute => $option) {
echo '<li>'. t('@attribute: @options', array('@attribute' => $attribute, '@options' => implode(', ', (array)$option))) .uc_attribute_quantity_template($order,$attribute,$option) .'</li>';
} ?>
<?php } ?>

uc_order-admin.tpl.php:

<?php if (is_array($product->data['attributes']) && count($product->data['attributes']) > 0) {?>
<?php foreach ($product->data['attributes'] as $attribute => $option) {
echo '&nbsp;&nbsp;'. t('@attribute: @options', array('@attribute' => $attribute, '@options' => implode(', ', (array)$option))) .uc_attribute_quantity_template($order,$attribute,$option).'<br />';
} ?>
<?php } ?>

Yet it outputs as follows:

www.site.com/admin/store/orders/14396

Additional Spread: 10x10, x 20

www.site.com/admin/store/orders/14396/invoice

Additional Spread: 10x10

For some reason the ", x 20" is not showing up in the invoice - I'm stumped.

Thanks
Francois.

longwave’s picture

The "view order" page is generated by neither of those.

uc_order-customer.tpl.php is the invoice template that is emailed to customers on a successful checkout, and also the one displayed in "view invoice" by default.

uc_order-admin.tpl.php is the order summary that is emailed to administrators on a successful checkout.

I am not sure where the ", x 20" could be coming from, however your code suggests you are using uc_attribute_quantity to display these numbers, so this question should be asked in the issue queue for that module - I am not familiar with it.

longwave’s picture

Status: Postponed (maintainer needs more info) » Fixed

Assumed fixed by #3

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.