Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Receipt Or Invoice - Checkout Option Rate Topic   - - - - -

 

Posted 11 September 2016 - 02:23 PM #1

Hello,

 

some months ago, someone someone wrote me a code (obviously not an expert) at checkout of my eshop, to choose between receipt or invoice with radio code. This never worked.

Can someone help me to find the mistakes and correct it? Im not an expert so please explain with details.

 

Here is the code:

 

$(document).ready(function() {

              if ( $('#elm_1_2').is(':checked')) {

                             $(".billing-company").show();

                             $(".billing-job").show();

                             $(".billing-afm").show();

                             $(".billing-doy").show();

              } else {

                             $(".billing-company").hide();

                             $(".billing-job").hide();

                             $(".billing-afm").hide();

                             $(".billing-doy").hide();

              }

 

              $("input[name='user_data[fields][1]']").click(function(){

                             var test = $(this).val();

                             if (test=='1') {

                                           $(".billing-company").hide();

                                           $(".billing-job").hide();

                                           $(".billing-afm").hide();

                                           $(".billing-doy").hide();

                             } else {

                                           $(".billing-company").show();

                                           $(".billing-job").show();

                                           $(".billing-afm").show();

                                           $(".billing-doy").show();

                             }

              });

});

 

and that is the website pc-evolution.gr



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20055 posts

Posted 12 September 2016 - 08:05 AM #2

Try this one:

$(document).ready(function() {
              if ( $('#elm_80_2').is(':checked')) {
                             $(".billing-company").show();
                             $(".billing-job").show();
                             $(".billing-afm").show();
                             $(".billing-doy").show();
              } else {
                             $(".billing-company").hide();
                             $(".billing-job").hide();
                             $(".billing-afm").hide();
                             $(".billing-doy").hide();
              }
 
              $("input[name='user_data[fields][80]']").click(function(){
                             var test = $(this).val();
                             if (test=='1') {
                                           $(".billing-company").hide();
                                           $(".billing-job").hide();
                                           $(".billing-afm").hide();
                                           $(".billing-doy").hide();
                             } else {
                                           $(".billing-company").show();
                                           $(".billing-job").show();
                                           $(".billing-afm").show();
                                           $(".billing-doy").show();
                             }
              });
});

GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 

Posted 12 September 2016 - 11:59 AM #3

After some editing/deleting it now works.

 

Some last question, what edit i must do, to be default the other option (receipt) than this now (invoice)?

More specific i want to be choosen the receipt and only when they choose invoice the fields to be appear.

 

Thank you for your time and effort eCom..



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20055 posts

Posted 12 September 2016 - 02:17 PM #4

After some editing/deleting it now works.

 

Some last question, what edit i must do, to be default the other option (receipt) than this now (invoice)?

More specific i want to be choosen the receipt and only when they choose invoice the fields to be appear.

 

Thank you for your time and effort eCom..

 

What do you mean by "receipt than invoice"? Please clarify


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 

Posted 12 September 2016 - 04:45 PM #5

The code above by default has checked the "invoice" option. I want to modify this and by default to have the "receipt" option checked instead.

 

Also, for a strange reason, it stopped working. It might be a bug or need more modification to work properly..



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20055 posts

Posted 13 September 2016 - 08:53 AM #6

The code above by default has checked the "invoice" option. I want to modify this and by default to have the "receipt" option checked instead.

 

Just change variant position of the corresponding field in the admin panel

 

 

 

Also, for a strange reason, it stopped working. It might be a bug or need more modification to work properly..

 

If you use script tag to add the code, add class="cm-ajax-force" to it


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 

Posted 30 September 2016 - 06:32 PM #7

I dont know what you mean by that, i searched the internet but no help.

The only sure i can tell you, is that if i sign in and go as a registered customer to basket/check out it works.

But if i go as a guest to check out, it doesnt work. 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 20055 posts

Posted 03 October 2016 - 07:30 AM #8

I dont know what you mean by that, i searched the internet but no help.

The only sure i can tell you, is that if i sign in and go as a registered customer to basket/check out it works.

But if i go as a guest to check out, it doesnt work. 

 

How the code is inserted to your store? Do you see the <script> HTML tag before the first line of code?


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)