Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Mod works perfectly for me, OC v.1.5.5.1. It's exactly what I was looking for.
And there is one more thing I'd like know. Is it possible to add some custom field such as a bank account to this invoice?
Now I 've added a bank account stright into my order_invoice template. But it's not exactly right solution if you have a multilingual store.
Thanks in advance.
It is technically possible to add a custom field to the invoice, yes.Is it possible to add some custom field
That would be inadvisable to add a bank account / credit card information to an invoice without PCI compliant methodology to protect customers and consumers since not all OpenCart merchants can provide orders under SSL.such as a bank account
Not a good idea.Now I 've added a bank account stright into my order_invoice template.
In this case, it wouldn't be the right solution either for multilingual or refunds from websites reasons. Adding a custom field that does not involve coding under PCI compliance would be more ideal.But it's not exactly right solution if you have a multilingual store.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
That's good news.straightlight wrote:It is technically possible to add a custom field to the invoice, yes.
Yeah, you are absolutely right. But it's not exactly what i meant. Perhaps I did not quite correctly formulated my question.straightlight wrote:That would be inadvisable to add a bank account / credit card information to an invoice without PCI compliant methodology to protect customers and consumers since not all OpenCart merchants can provide orders under SSL.
I 'd like to add my bank account and some additional information to the header of an invoice right below my address and telephone.
I'm from Ukraine and according to our legislation I as a merchant have to specify my bank details in an invoice. But for foreign customers it's not necessary. And I'm intrested how do I to specify my bank details in an invoice for local customers and not for foreign customers.
Thanks in advance.
If this information is true regarding Ukraine legislation, then your payment gateway party would process this methodology and involve the bank number on the actual invoice upon completed orders status. That being said, if your payment gateway party does not provide the customer's payment account information details on the invoice at this time, then there's a reason for that.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Thanks a lot for your answer.You helped me to understand some of the important things to me. I new to OpenCart and I've got much to learn about it.straightlight wrote:OpenCart does not store payment account information details into the database by default. The storage would need to be done from your payment module accordingly before actually completing the order which would still be highly unrecommended method to protect customers and consumers. Third party gateways exists for these reasons so that the customer can receive his payment information details on an email confirmation order built on a created template from your party.
Best regards, George.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I tried installing it but i'm getting this error:
Code: Select all
syntax error, unexpected T_PUBLIC in C:\xampp\htdocs\Mystore\vqmod\vqcache\vq2-catalog_controller_checkout_success.php on line 69
More guidance needed. Thanks.
Code: Select all
<a onclick="window.open('<b>Notice</b>: Undefined variable: invoice in <b>LINKTO\www\store\vqmod\vqcache\vq2-LINKTO_www_store_catalog_view_theme_farbrorskylt_template_common_success.tpl</b> on line <b>15</b>');" class="button"><span><b>Notice</b>: Undefined variable: button_invoice in <b>LINKTO\www\store\vqmod\vqcache\vq2-LINKTO_www_store_catalog_view_theme_farbrorskylt_template_common_success.tpl</b> on line <b>15</b></span></a>
Anyone run into this problem?
Also, on 1.5.6 invoice numbers are not automatically generated, could this factor into this?
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Hi straightlight,straightlight wrote:The OC version is not what matters here. You're using a custom tenplate file that line 15 misses the invoice variable from its related controller.
Thank you very much and good job for the extension.
But after I followed the instructions above, I do not see the effect on the success page.
I am using OpenCart version 1.5.6 and default template
Is there any update for this version?
Thanks.
I just know, that the invoice details are not visible on the success page but it appears on this page :stonehinged wrote:Thanks straightlight, but the order details do NOT display on the success page itself, correct? One must clickthrough to the invoice page to see these details if I understand correctly.
I would have to agree with qphoria that the order recap on the success page itself is a much needed addition to opencart. On most websites I'm used to seeing this recap when my order is finished. And of course having a convenient option for a print-friendly version of the details is an added bonus.
I'm using 1.5.2.1... by chance have you done any retooling of your mod to ensure working compatibility with 1.5.2.1? I'm seeing some error messages with this version.
Looks like a great deal of work, so thanks for your efforts!
Code: Select all
http://www.yoursite.com/index.php?route=checkout/success/invoice
Code: Select all
http://www.yoursite.com/index.php?route=checkout/success/
This is what I didthejonandonly wrote:Sorry mate, how do I do that?
Modify the xml like this between Line 281-289
Original:
Code: Select all
<file name="catalog/view/theme/*/template/common/success.tpl">
<operation>
<search position="replace"><![CDATA[<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>]]></search>
<add><![CDATA[
<div class="right"><a onclick="window.open('<?php echo $invoice; ?>');" class="button"><span><?php echo $button_invoice; ?></span></a> <a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
]]>
</add>
</operation>
</file>
Code: Select all
<file name="catalog/view/theme/*/template/common/success.tpl">
<operation>
<search position="replace"><![CDATA[<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>]]></search>
<add><![CDATA[
<?php if (!isset($this->session->data['invoice_order_id'])) { ?>
<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
<?php }else{?>
<div class="right"><a onclick="window.open('<?php echo $invoice; ?>');" class="button"><span><?php echo $button_invoice; ?></span></a> <a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
<?php } ?>
]]>
</add>
</operation>
</file>
First of all stop looking into vq2 files as these are cache files and any changes in these won't solve your problem. These are auto-generated and doesnt affect OC. If you want to solve any issues you have to look in original files.toocoded wrote:I looked up the error and learned that the "public" in "public function invoice() {" should be removed. When I removed it from "vq2-catalog_controller_checkout_success.php" and refreshed the page I get the normal success page with no invoice.
More guidance needed. Thanks.
Now coming to your problem.
Problem: You are getting this error because public function invoice(){....} is being inserted inside the public function index(){....} or any other function that you would have made in controller/checkout/success.php file. If you see your cache file "vq2-catalog_controller_checkout_success.php" you can find it that invoice function is inside some other public function. Actually it should be outside of any other public function thats why it's not accepting "public" keyword.
Reason: Reason why this is happening is because you would have made any changes in original controller/checkout/success.php file. And would have included some codes which would be having "}" in them.
Solution: If you see the xml file (catalog_order_invoice.xml) at line 26 you will find that public function invoice(){....} is being inserted after 6th "}" . which means it is searching all the "}" and after it crosses 6th "}" it adds the invoice function. Normally if success.php is not modified this position (i.e after 6th "}") is the end of index function. But possibly you would have modified the original file hence this count of 6 for index's } would be wrong for your file. Hence you should look at your success.php carefully and count the number of "}" from starting till the index function is ending. Then use that number in place of 6 in xml file. I had this same issue as I had added a custom function inside index which increased the count of } from 6 to 7.
Note:
- Even if you have extra "}" in comments you should count it.
- Dont count the last "}" of class ControllerCheckoutSuccess extends Controller { } as this class should be parent of all the public classes.
Load the invoice.tpl in an invisible iframe and then modify the onclick of "Print Invoice" to print thaat frame instead of opening the invoice.tpl
So here is the modification in xml that is necessary
Line 281-289
Original :
Code: Select all
<file name="catalog/view/theme/*/template/common/success.tpl">
<operation>
<search position="replace"><![CDATA[<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>]]></search>
<add><![CDATA[
<div class="right"><a onclick="window.open('<?php echo $invoice; ?>');" class="button"><span><?php echo $button_invoice; ?></span></a> <a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
]]>
</add>
</operation>
</file>
Code: Select all
<file name="catalog/view/theme/*/template/common/success.tpl">
<operation>
<search position="replace"><![CDATA[<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>]]></search>
<add><![CDATA[
<iframe src="<?php echo $invoice; ?>" name="invoiceFrame" style="display:none; visibility:hidden;"></iframe>
<div class="right"><a onclick="frames['invoiceFrame'].print();" class="button"><span><?php echo $button_invoice; ?></span></a> <a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
]]>
</add>
</operation>
</file>
Final Modification
Code: Select all
<file name="catalog/view/theme/*/template/common/success.tpl">
<operation>
<search position="replace"><![CDATA[<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>]]></search>
<add><![CDATA[
<?php if (!isset($this->session->data['invoice_order_id'])) { ?>
<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
<?php }else{?>
<iframe src="<?php echo $invoice; ?>" name="invoiceFrame" style="display:none; visibility:hidden;"></iframe>
<div class="right"><a onclick="frames['invoiceFrame'].print();" class="button"><span><?php echo $button_invoice; ?></span></a> <a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
<?php } ?>
]]>
</add>
</operation>
</file>
- This modification has some more advantages like user gets the option to directly print or save the invoice.
- The invoice will appear in a print popup.
- Even if the popup is closed by mistake the invoice can be printed again on clicking the same button as iframe still has the invoice in it till 15 min. (I havnt tested after 15 min but I guess after that print button will start printing the home page as iframe's content would have redirected. I will look into it and find a solution to redirect user if he clicks the print button after 15 min instead of showing the print popup)
bfreemanfl wrote:Ok....so I installed VQMod last night...and I just uploaded the XML file into the VQMod/XML folder.
And still nothing is being displayed after order success (As far as being able to view the invoice / print button). Just normal.
I'm REALLY new at this sort of stuff so please bare with me.
Do I need to run or add anything else besides just placing the xml inside the vqmod/xml folder (and other changes I haev already done and listed above)???
I looked in the vqmod/vqcache folder, and I do see
- vq-catalog_controller_checkout_success.php
- vq-catalog_language_english_checkout_success.php
- vq-catalog_model_checkout_order.php
as well as a few other files, so it looks like it's doing something.
I just don't see anything other than the usually successful message after checkout.
I'm testing it with a fresh install (you can click through an order as I have guest enabled and COD for payment).
http://steinermilitaryscopes.com/
Another note: I installed VQMod 1.2.3 (if it matters).
Did anyone manage to overcome this problem yet because I am actually facing the same problem. I did every step but nothing appears. I just get led to the same checkout page.
Thanks a lot, man!alok wrote:Basically checking whether invoice_order_id is still there in session or not. This will prevent print invoice button from appearing in any success page except successfull checkout. So no more trouble of finding this button in success page after contact form is submitted or when user logs out successfully. This also solves the problem of button appearing if somebody reloads the successfull checkout page (?route=checkout/success).
I followed every step you described & bingo! I got the invoice after success page, thanks to you for the great mod.
But I need to modify some feature. Please help me with that.
1. When I click Print Invoice button it shows the invoice but after closing the tab and re-clicking the Print Invoice button it redirect me to my home page. That means the Print Invoice button is void for only 1 time. I want to let my customer do that at least 2/3 times.
2. How to add fields on this invoice, like: shipping method, payment method, voucher, coupon etc. Please give me instruction how to add custom fields.
3. The invoice.css file is not working, I mean I changed the CSS file to my default one so that I could get as same as the default Invoice. But it's not working.
4. I tried some modification to add some fields and got this error: Undefined index: shipping_method in ...../order_invoice.tpl That's mean I didn't defined the shipping_method string, how to define them.
Please help me with these solution.
Regards,
duranto2009
http://www.marketplacebd.com
Users browsing this forum: Ahrefs [Bot] and 17 guests