Post by straightlight » Thu May 24, 2012 7:08 am

Either that or you can track the session data that hasn't been eliminated under the same name being used on both page.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by thejonandonly » Fri May 25, 2012 7:20 am

Sorry mate, how do I do that?

Newbie

Posts

Joined
Sun May 20, 2012 6:07 am

Post by jorgas » Thu Mar 07, 2013 1:20 am

Thank you very much, straightlight.
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.

Newbie

Posts

Joined
Thu Mar 07, 2013 12:29 am

Post by straightlight » Sun Mar 10, 2013 5:36 am

Is it possible to add some custom field
It is technically possible to add a custom field to the invoice, yes.
such as a bank account
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.
Now I 've added a bank account stright into my order_invoice template.
Not a good idea.
But it's not exactly right solution if you have a multilingual store.
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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by jorgas » Tue Mar 12, 2013 2:56 am

Thank you for your answer.
straightlight wrote:It is technically possible to add a custom field to the invoice, yes.
That's good news.
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.
Yeah, you are absolutely right. But it's not exactly what i meant. Perhaps I did not quite correctly formulated my question.
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.

Newbie

Posts

Joined
Thu Mar 07, 2013 12:29 am

Post by straightlight » Wed Mar 13, 2013 12:12 am

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.

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


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by jorgas » Thu Mar 14, 2013 12:22 am

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.
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.

Best regards, George.

Newbie

Posts

Joined
Thu Mar 07, 2013 12:29 am

Post by straightlight » Thu Mar 14, 2013 12:28 am

The order tax, it should but it does not return the order shipping rate.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by toocoded » Thu Apr 04, 2013 12:58 am

Great Mod... It makes perfect sense for the customer.

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
I am pretty new to this so some help in clearing this up would be greatly appreciated. Thanks.

Newbie

Posts

Joined
Tue Mar 05, 2013 2:47 am

Post by toocoded » Thu Apr 04, 2013 1:40 am

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.

Newbie

Posts

Joined
Tue Mar 05, 2013 2:47 am

Post by neocreo » Mon Oct 07, 2013 4:11 pm

Hi, this is a great mod... however, I am running OC 1.5.6 and I have an issue with the invoice not loading at all...

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>
I have adjusted the XML file to add the correct variables to the languages I use and also double checked the search-terms. Yet, I cannot get anything.

Anyone run into this problem?

Also, on 1.5.6 invoice numbers are not automatically generated, could this factor into this?

Newbie

Posts

Joined
Fri Oct 04, 2013 2:58 pm

Post by straightlight » Tue Oct 08, 2013 2:18 am

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.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ajie.kurniyawan » Mon Oct 21, 2013 1:12 pm

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.
Hi straightlight,
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.


Posts

Joined
Wed Oct 16, 2013 2:20 am

Post by ajie.kurniyawan » Wed Oct 23, 2013 12:16 am

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!
I just know, that the invoice details are not visible on the success page but it appears on this page :

Code: Select all

http://www.yoursite.com/index.php?route=checkout/success/invoice
I think the invoice details will appear on the success page.

Code: Select all

http://www.yoursite.com/index.php?route=checkout/success/
My head going to explode to understand this.. LOL ;D


Posts

Joined
Wed Oct 16, 2013 2:20 am

Post by alok » Wed Nov 06, 2013 11:16 pm

thejonandonly wrote:Sorry mate, how do I do that?
This is what I did
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>&nbsp;&nbsp;<a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
			]]>
			</add>
		</operation>
	</file>
Modified:

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>&nbsp;&nbsp;<a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
                        <?php } ?>
			]]>
			</add>
		</operation>
	</file>
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).

Newbie

Posts

Joined
Mon Jul 29, 2013 3:34 pm

Post by alok » Wed Nov 06, 2013 11:54 pm

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.
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.

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.

Newbie

Posts

Joined
Mon Jul 29, 2013 3:34 pm

Post by alok » Thu Nov 07, 2013 12:27 am

Regarding printing invoice from success page itself without navigating to invoice.tpl here is what I did.

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>&nbsp;&nbsp;<a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
			]]>
			</add>
		</operation>
	</file>
Modified:

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>&nbsp;&nbsp;<a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
			]]>
			</add>
		</operation>
	</file>
Now if you wish to prevent "Print Invoice" button from appearing on other success page (like contact form submission and logout) then this is the final code (I talked about this in earlier comment)

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>&nbsp;&nbsp;<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)

Newbie

Posts

Joined
Mon Jul 29, 2013 3:34 pm

Post by mike_chu » Wed Dec 11, 2013 12:13 pm

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.

Newbie

Posts

Joined
Tue Dec 03, 2013 5:26 pm

Post by jorgas » Tue Dec 17, 2013 7:41 pm

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).
Thanks a lot, man!

Newbie

Posts

Joined
Thu Mar 07, 2013 12:29 am

Post by duranto2009 » Tue Feb 10, 2015 5:04 pm

Hi, Straightlight.
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


Newbie

Posts

Joined
Sun Feb 08, 2015 10:46 pm
Location - Dhaka, Bangladesh
Who is online

Users browsing this forum: Ahrefs [Bot] and 17 guests