Where The Core.js Library Is Included

i perform my own validations(for address) in checkout page step_two.tpl,but they are performed when i click on the continue button after that the cscart default validations are performed…

i want my validations are performed after the cscart default validations. the default validations are came from core.js but where that core.js library is included

please help me

Hello anilkumar,



The core.js file included in common/scripts.tpl file. But if you wish to add your validations after the core, just use the following construction (at any place even in step_two.tpl):


$(document).ready(function () {
HERE IS YOUR VALIDATIONS
});




Hope it will be helpful.

thanks for your reply



i am trying like as you mentioned above but its not working first it checks my validation then only it goes to defalut validations…core.js is included when my validation returns true





note:my validations work when i click on continue button in step_two .tpl page



jquery:

-------

[color=#000000]$[/color]color=#666600.[/color][color=#000000]ready[/color][color=#666600]([/color][color=#000088]function[/color][color=#000000] [/color]color=#666600[/color][color=#000000] [/color][color=#666600]{[/color]

[color=#000000]$('#button_id').click(function(e)

{

});

[/color][color=#666600]});[/color]

@[color=#282828][font=arial, verdana, tahoma, sans-serif]anilkumar,[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]Do you want to add your [/font][/color]validation after form was submitted? In this case you should use the following construction:



(executing during checking the form, before AJAX)


$.ceEvent('on', 'ce.formpost_step_two_billing_address', function(frm, elm) {
YOUR VALIDATION
});




or (executing after ajax)


$.ceEvent('on', 'ce.formajaxpost_step_two_billing_address', function(response) {
YOUR VALIDATION
});




On $(document).ready of course.



Thanks

thanks for your reply



the cscart validations are working before my validaitons but it genartes the following error “[color=#9C3535][font=Arial, Helvetica, sans-serif][size=4]Error[/size][/font][/color]

[color=#9C3535][font=Arial, Helvetica, sans-serif][size=3]Oops, something went wrong (parsererror). Please try again.[/size][/font][/color]”

in my validations agian i run ajax cal…for getting the address from usps

that ajax cal is created through manual not using the cscart ajax cals

@anilkumar,



Usually such error occurs when PHP part of code returns an error (Fatal error, etc.). For testing it just find the complete URL of your AJAX request and perform it in separate tab.



Hope it will be helpful.

thanks for you reply sir

iam new to this cscart…please explain this…when i click on “continue” button in step_two.tpl it goes to dispatch[checkout.update_steps$_action] in that which function it calls the ajax cal to verify all the mandatory fields are filled properly or not…i dont no where this core.js file is called,in that this.check = function() contains one variable 'check_fields_result' .if that value is true means all mandatory fields are filled properly…if that value is false means fields not filled properly…how can i get that 'check_fields_result' value in step_two.tpl…if possible please help me

@anilkumar,



Let me explain. The core.js file is a core of all JS functionality of CS-Cart. It contains the 'dispatchEvent' function which process all events. So, in your case the process looks like this:



'click' (event) => 'submit' (event) => check form fields (function) => submit form (function) => ajax request => retrieve the results



So, in order to prevent submitting the form (in case some field filled incorrectly) you should use the '[color=#008800]ce.formpost_step_two_billing_address[/color]' function as a hook. There you can make your validation and return the result (true or false). It will be placed to the form_result variable.and will prevent further submitting of form if your validation fails.



Thanks.

thank you i will try this…



one more doubt



[color=#282828][font=arial, verdana, tahoma, sans-serif]in admin panel i created a new order by clicking the “add order button” in view orders page…that new order contains four steps 1)products 2)customer deatils 3)totals 4)summary.[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]in customer detials page i created a hidden variable.i want to pass hidden variable value from[/font][/color]customer_info.tpl[color=#282828][font=arial, verdana, tahoma, sans-serif] to[/font][/color] totals.tpl[color=#282828][font=arial, verdana, tahoma, sans-serif]…in my customer_info.tpl that hidden value is assigned through jquery. i want to pass that value to totals.tpl,from[/font][/color] totals.tpl[color=#282828][font=arial, verdana, tahoma, sans-serif] to [/font][/color]summary.tpl[color=#282828][font=arial, verdana, tahoma, sans-serif]…[/font][/color]





[color=#282828]font=arial, verdana, tahoma, sans-serif directly passing that hidden value form[/font][/color] customers_info.tpl[color=#282828][font=arial, verdana, tahoma, sans-serif] to [/font][/color]summary.tpl

[color=#282828][font=arial, verdana, tahoma, sans-serif]iam using cscart version 3.0.please help me [/font][/color]

@anilkumar,



Let me explain. If you pass this variable to the PHP session, it will be available on any page in order management system. For example, please try to save it like this:







so, you will be able to access it by this:


{$cart.user_data.YOUR_VARIABLE_NAME}




Hope it will be helpful.

[quote name='eComLabs' timestamp='1398348665' post='182277']

@anilkumar,



Let me explain. If you pass this variable to the PHP session, it will be available on any page in order management system. For example, please try to save it like this:







so, you will be able to access it by this:


{$cart.user_data.YOUR_VARIABLE_NAME}




Hope it will be helpful.

[/quote]



sir i place this code in customer_info.tpl









the value for this hidden variable is came from jquery value.the query code is



skip_verify = “Customer has skipped address verification”;

$('#skipped_address').val(skip_verify);





i placed this code in summary.tpl



{$cart.user_data.address_skipped}



but its not displaying any thing in summary.tpl

please help me

ecomlabs please help to slove this issue

[quote name='anilkumar' timestamp='1398765938' post='182607']

ecomlabs please help to slove this issue

[/quote]



Please check our e-mail from HelpDesk. Thank you.

[quote name='eComLabs' timestamp='1398767137' post='182610']

Please check our e-mail from HelpDesk. Thank you.

[/quote]

how many ways we can transfer the variable value from one tpl to another tpl. Is good to use cookies to slove the problem…please give suggested solution