1. Is it possible to save custom invoice template to /files directory or any other safer place so that when an update (personally, I delete and replace old version completely with new one) is made to Ubercart it doesn't get deleted mistakenly.
2. How to set custom invoice as default invoice?
3. Is there a token for a customer's country only?
4. Is there a way to add dynamic "S.No."?
All that's been written on the topic can be found here: http://www.ubercart.org/docs/developer/246/invoice_system
Once you create your custom invoice, simply change the setting in the order and notification settings to your file.
I would like to print customer's delivery country in invoice template.
I did something like this
<?php echo $order->country; ?>but it didn't worked. Does anyone know how to do this?
You need a combination of something like this...
<?php
$country = uc_get_country_data(array('country_id' => $order->country));
echo $country['country_name'];
?>thanks Ryan but it didn't worked out...
Ryan,
You are doing a wonderful job in this forum. Thanks.
Is it possible to have function that can create a licence key for a digital product?
Where would I include such a function, inside the template, module or .inc file?
You advice would apprecaited
thanks in advance
smcochin
There really should be a way to select an invoice template that's not in the module itself, but in the theme directory. Drupal best practice is to never put anything custom into Drupal core, or a module's core directory. This current system requires that site maintainers backup and replace custom invoices every time UC is updated.
At the very least, the core templates should not have element level CSS embedded in them. I would assume that 90% of invoice customization is just making it match the site's color palette, and it would be a breeze to override some CSS attributes if the invoice elements were classed.
There really should be a way to select an invoice template that's not in the module itself, but in the theme directory. Drupal best practice is to never put anything custom into Drupal core, or a module's core directory. This current system requires that site maintainers backup and replace custom invoices every time UC is updated.
Please participate in the discussion about this at http://drupal.org/node/295423 if this issue is important to you.
At the very least, the core templates should not have element level CSS embedded in them. I would assume that 90% of invoice customization is just making it match the site's color palette, and it would be a breeze to override some CSS attributes if the invoice elements were classed.
If you have a suggestion for how to modify the templates so they will be more useful, please post your suggested code (preferably in the form of a patch) in the Ubercart issue queue at http://drupal.org/project/issues/ubercart
Can you comment on the first question? Personally I would like to move the files to my theme directory
"Is it possible to save custom invoice template to /files directory or any other safer place so that when an update (personally, I delete and replace old version completely with new one) is made to Ubercart it doesn't get deleted mistakenly."
I do that in customer.itpl.php for the delivery country :
<?php
$delivery_country = uc_get_country_data(array('country_id' => $order->delivery_country));
echo $delivery_country[0] ['country_name'];
?>and for the billing country :
<?php
$billing_country = uc_get_country_data(array('country_id' => $order->billing_country));
echo $billing_country[0] ['country_name'];
?>It seems working...
Yes point #1 is very important. The invoice templates folder does not follow drupal standards, and instead ubercart should look for those templates in the users theme folder. This is especially important if you are creating a theme for a client, for example.
Ubercart Multi Install - 2 languages, is it possible to use 2 templates ? How to select the right language template ?
Hi,
I have a multi-install Drupal 6 Ubercart, and everything is OK but:
When customers orders they will receive a confirmation / summary Email that you can find in this file: uc_order-customer.tpl.php
It is possible to add a second uc_order-customer.tpl.php for the second website of the multi install (different language) ?
And how to select which template to use depending on which website customers ordered ?
Thanks for help.
Hello,
Is it possible to print out the last 4 digit number of credit card on the invoice? I couldn't find a proper token for it.
Thanks,
I am with UC -2.4.
My default order template is in this way:
<?php
if ($order->payment_method=='bank_transfer') {
?>
<?php
echo t('To:');
?>
[order-payment-bank-details]
<?php
}
?>so you have no tokens here, when I try to include a token it doesnt work in my template and I dont know how to show some fields like bank details or others and how to discover.
I tip here is very welcome, How can I know vars and fields present in ubercart to show in my custom template?
Thanks.
hi, i'm using the customer invoice in place of the admin invoice as it has more useful info, however it does not include the comments, have tried to add this using the info on this thread but not having much luck, any surgestions? also is there a way to make items added to the cart come up in the order they are added as they seem to come up in a random order, hope someone can help


