I want to override js function on shipping method sectionoverride USPS shipping method namePayment Javascript Class - Override nextStep methodExclude a specific categoryAutomatically select shipping method in Admin OrderVarien's product.js method override is not workinghow to override available.phtml file of shipping methodCustom Payment Method Error - Call to a member function getMethodInstance() on a non-objectCheckout/Onepage Redirect to Cart PageWhich event to observe for building Magento Extension for fraud detection ?Trigger function on close in window.js Magento 1.9
Exception propagation: When to catch exceptions?
When quoting someone, is it proper to change "gotta" to "got to" without modifying the rest of the quote?
How to make a language evolve quickly?
No such column 'DeveloperName' on entity 'RecordType' after Summer '19 release on sandbox
How to select certain lines (n, n+4, n+8, n+12...) from the file?
spatiotemporal regression
is it permitted to swallow spit on a fast day?
What's the "magic similar to the Knock spell" referenced in the Dungeon of the Mad Mage adventure?
Intersecting with the x-axis / intersecting the x-axis
Translation of the latin word 'sit' in Thomas Aquinas' works
Renting a house to a graduate student in my department
What food production methods would allow a metropolis like New York to become self sufficient
How are one-time password generators like Google Authenticator different from having two passwords?
Is it nonsense to say B -> [A -> B]?
Was Mohammed the most popular first name for boys born in Berlin in 2018?
What is the name of meteoroids which hit Moon, Mars, or pretty much anything that isn’t the Earth?
date -d 'previous Monday" to display the preceding Monday
What is wrong with my code? RGB potentiometer
Why should password hash verification be time constant?
How can I avoid subordinates and coworkers leaving work until the last minute, then having no time for revisions?
Can 'sudo apt-get remove [write]' destroy my Ubuntu?
Why use steam instead of just hot air?
How to evaluate sum with one million summands?
Which other programming languages apart from Python and predecessor are out there using indentation to define code blocks?
I want to override js function on shipping method section
override USPS shipping method namePayment Javascript Class - Override nextStep methodExclude a specific categoryAutomatically select shipping method in Admin OrderVarien's product.js method override is not workinghow to override available.phtml file of shipping methodCustom Payment Method Error - Call to a member function getMethodInstance() on a non-objectCheckout/Onepage Redirect to Cart PageWhich event to observe for building Magento Extension for fraud detection ?Trigger function on close in window.js Magento 1.9
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I want to override js function on shipping method section :
i checked on inspect Element below is the function is calling on click on continue
button Can you please help me to find out where i can get that function
onclick="shippingMethod.save()
<checkout_onepage_index>
<reference name="head">
<action method="addItem"><type>skin_js</type><name>js/custom.js</name></action>
</reference>
</checkout_onepage_index>
path : skinfrontendpackagethemejscustom.js
// shipping method
var ShippingMethod = Class.create();
ShippingMethod.prototype =
initialize: function(form, saveUrl)
this.form = form;
if ($(this.form))
$(this.form).observe('submit', function(event)this.save();Event.stop(event);.bind(this));
this.saveUrl = saveUrl;
this.validator = new Validation(this.form);
this.onSave = this.nextStep.bindAsEventListener(this);
this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);
,
validate: function()
var methods = document.getElementsByName('shipping_method');
if (methods.length==0)
alert(Translator.translate('Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.').stripTags());
return false;
if(!this.validator.validate())
return false;
for (var i=0; i<methods.length; i++)
if (methods[i].checked)
return true;
alert(Translator.translate('Please specify shipping method.').stripTags());
return false;
,
save: function()
alert('tttttttttttttttttttt');
if (checkout.loadWaiting!=false) return;
if (this.validate())
checkout.setLoadWaiting('shipping-method');
var request = new Ajax.Request(
this.saveUrl,
method:'post',
onComplete: this.onComplete,
onSuccess: this.onSave,
onFailure: checkout.ajaxFailure.bind(checkout),
parameters: Form.serialize(this.form)
);
,
resetLoadWaiting: function(transport)
checkout.setLoadWaiting(false);
,
nextStep: function(transport)
if (transport && transport.responseText)
try
response = eval('(' + transport.responseText + ')');
catch (e)
response = ;
if (response.error)
alert(response.message);
return false;
if (response.update_section)
$('checkout-'+response.update_section.name+'-load').update(response.update_section.html);
payment.initWhatIsCvvListeners();
if (response.goto_section)
checkout.gotoSection(response.goto_section, true);
checkout.reloadProgressBlock();
return;
if (response.payment_methods_html)
$('checkout-payment-method-load').update(response.payment_methods_html);
checkout.setShippingMethod();
Can you please help me to find out the exact location & file name
magento-1.9 prototype-js
add a comment |
I want to override js function on shipping method section :
i checked on inspect Element below is the function is calling on click on continue
button Can you please help me to find out where i can get that function
onclick="shippingMethod.save()
<checkout_onepage_index>
<reference name="head">
<action method="addItem"><type>skin_js</type><name>js/custom.js</name></action>
</reference>
</checkout_onepage_index>
path : skinfrontendpackagethemejscustom.js
// shipping method
var ShippingMethod = Class.create();
ShippingMethod.prototype =
initialize: function(form, saveUrl)
this.form = form;
if ($(this.form))
$(this.form).observe('submit', function(event)this.save();Event.stop(event);.bind(this));
this.saveUrl = saveUrl;
this.validator = new Validation(this.form);
this.onSave = this.nextStep.bindAsEventListener(this);
this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);
,
validate: function()
var methods = document.getElementsByName('shipping_method');
if (methods.length==0)
alert(Translator.translate('Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.').stripTags());
return false;
if(!this.validator.validate())
return false;
for (var i=0; i<methods.length; i++)
if (methods[i].checked)
return true;
alert(Translator.translate('Please specify shipping method.').stripTags());
return false;
,
save: function()
alert('tttttttttttttttttttt');
if (checkout.loadWaiting!=false) return;
if (this.validate())
checkout.setLoadWaiting('shipping-method');
var request = new Ajax.Request(
this.saveUrl,
method:'post',
onComplete: this.onComplete,
onSuccess: this.onSave,
onFailure: checkout.ajaxFailure.bind(checkout),
parameters: Form.serialize(this.form)
);
,
resetLoadWaiting: function(transport)
checkout.setLoadWaiting(false);
,
nextStep: function(transport)
if (transport && transport.responseText)
try
response = eval('(' + transport.responseText + ')');
catch (e)
response = ;
if (response.error)
alert(response.message);
return false;
if (response.update_section)
$('checkout-'+response.update_section.name+'-load').update(response.update_section.html);
payment.initWhatIsCvvListeners();
if (response.goto_section)
checkout.gotoSection(response.goto_section, true);
checkout.reloadProgressBlock();
return;
if (response.payment_methods_html)
$('checkout-payment-method-load').update(response.payment_methods_html);
checkout.setShippingMethod();
Can you please help me to find out the exact location & file name
magento-1.9 prototype-js
The function is defined at skinfrontendbasedefaultjsopcheckout.js around line 624. HereshippingMethod
is class andsave()
is the function.
– Jaimin Sutariya
Jul 24 '17 at 8:00
can you please paste the code here of what you are referring line no 624
– magento12345
Jul 24 '17 at 8:04
I have added the code which you want to change in the answer below. Please check.
– Jaimin Sutariya
Jul 24 '17 at 8:13
add a comment |
I want to override js function on shipping method section :
i checked on inspect Element below is the function is calling on click on continue
button Can you please help me to find out where i can get that function
onclick="shippingMethod.save()
<checkout_onepage_index>
<reference name="head">
<action method="addItem"><type>skin_js</type><name>js/custom.js</name></action>
</reference>
</checkout_onepage_index>
path : skinfrontendpackagethemejscustom.js
// shipping method
var ShippingMethod = Class.create();
ShippingMethod.prototype =
initialize: function(form, saveUrl)
this.form = form;
if ($(this.form))
$(this.form).observe('submit', function(event)this.save();Event.stop(event);.bind(this));
this.saveUrl = saveUrl;
this.validator = new Validation(this.form);
this.onSave = this.nextStep.bindAsEventListener(this);
this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);
,
validate: function()
var methods = document.getElementsByName('shipping_method');
if (methods.length==0)
alert(Translator.translate('Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.').stripTags());
return false;
if(!this.validator.validate())
return false;
for (var i=0; i<methods.length; i++)
if (methods[i].checked)
return true;
alert(Translator.translate('Please specify shipping method.').stripTags());
return false;
,
save: function()
alert('tttttttttttttttttttt');
if (checkout.loadWaiting!=false) return;
if (this.validate())
checkout.setLoadWaiting('shipping-method');
var request = new Ajax.Request(
this.saveUrl,
method:'post',
onComplete: this.onComplete,
onSuccess: this.onSave,
onFailure: checkout.ajaxFailure.bind(checkout),
parameters: Form.serialize(this.form)
);
,
resetLoadWaiting: function(transport)
checkout.setLoadWaiting(false);
,
nextStep: function(transport)
if (transport && transport.responseText)
try
response = eval('(' + transport.responseText + ')');
catch (e)
response = ;
if (response.error)
alert(response.message);
return false;
if (response.update_section)
$('checkout-'+response.update_section.name+'-load').update(response.update_section.html);
payment.initWhatIsCvvListeners();
if (response.goto_section)
checkout.gotoSection(response.goto_section, true);
checkout.reloadProgressBlock();
return;
if (response.payment_methods_html)
$('checkout-payment-method-load').update(response.payment_methods_html);
checkout.setShippingMethod();
Can you please help me to find out the exact location & file name
magento-1.9 prototype-js
I want to override js function on shipping method section :
i checked on inspect Element below is the function is calling on click on continue
button Can you please help me to find out where i can get that function
onclick="shippingMethod.save()
<checkout_onepage_index>
<reference name="head">
<action method="addItem"><type>skin_js</type><name>js/custom.js</name></action>
</reference>
</checkout_onepage_index>
path : skinfrontendpackagethemejscustom.js
// shipping method
var ShippingMethod = Class.create();
ShippingMethod.prototype =
initialize: function(form, saveUrl)
this.form = form;
if ($(this.form))
$(this.form).observe('submit', function(event)this.save();Event.stop(event);.bind(this));
this.saveUrl = saveUrl;
this.validator = new Validation(this.form);
this.onSave = this.nextStep.bindAsEventListener(this);
this.onComplete = this.resetLoadWaiting.bindAsEventListener(this);
,
validate: function()
var methods = document.getElementsByName('shipping_method');
if (methods.length==0)
alert(Translator.translate('Your order cannot be completed at this time as there is no shipping methods available for it. Please make necessary changes in your shipping address.').stripTags());
return false;
if(!this.validator.validate())
return false;
for (var i=0; i<methods.length; i++)
if (methods[i].checked)
return true;
alert(Translator.translate('Please specify shipping method.').stripTags());
return false;
,
save: function()
alert('tttttttttttttttttttt');
if (checkout.loadWaiting!=false) return;
if (this.validate())
checkout.setLoadWaiting('shipping-method');
var request = new Ajax.Request(
this.saveUrl,
method:'post',
onComplete: this.onComplete,
onSuccess: this.onSave,
onFailure: checkout.ajaxFailure.bind(checkout),
parameters: Form.serialize(this.form)
);
,
resetLoadWaiting: function(transport)
checkout.setLoadWaiting(false);
,
nextStep: function(transport)
if (transport && transport.responseText)
try
response = eval('(' + transport.responseText + ')');
catch (e)
response = ;
if (response.error)
alert(response.message);
return false;
if (response.update_section)
$('checkout-'+response.update_section.name+'-load').update(response.update_section.html);
payment.initWhatIsCvvListeners();
if (response.goto_section)
checkout.gotoSection(response.goto_section, true);
checkout.reloadProgressBlock();
return;
if (response.payment_methods_html)
$('checkout-payment-method-load').update(response.payment_methods_html);
checkout.setShippingMethod();
Can you please help me to find out the exact location & file name
magento-1.9 prototype-js
magento-1.9 prototype-js
edited Jul 24 '17 at 8:47
magento12345
asked Jul 24 '17 at 7:53
magento12345magento12345
171217
171217
The function is defined at skinfrontendbasedefaultjsopcheckout.js around line 624. HereshippingMethod
is class andsave()
is the function.
– Jaimin Sutariya
Jul 24 '17 at 8:00
can you please paste the code here of what you are referring line no 624
– magento12345
Jul 24 '17 at 8:04
I have added the code which you want to change in the answer below. Please check.
– Jaimin Sutariya
Jul 24 '17 at 8:13
add a comment |
The function is defined at skinfrontendbasedefaultjsopcheckout.js around line 624. HereshippingMethod
is class andsave()
is the function.
– Jaimin Sutariya
Jul 24 '17 at 8:00
can you please paste the code here of what you are referring line no 624
– magento12345
Jul 24 '17 at 8:04
I have added the code which you want to change in the answer below. Please check.
– Jaimin Sutariya
Jul 24 '17 at 8:13
The function is defined at skinfrontendbasedefaultjsopcheckout.js around line 624. Here
shippingMethod
is class and save()
is the function.– Jaimin Sutariya
Jul 24 '17 at 8:00
The function is defined at skinfrontendbasedefaultjsopcheckout.js around line 624. Here
shippingMethod
is class and save()
is the function.– Jaimin Sutariya
Jul 24 '17 at 8:00
can you please paste the code here of what you are referring line no 624
– magento12345
Jul 24 '17 at 8:04
can you please paste the code here of what you are referring line no 624
– magento12345
Jul 24 '17 at 8:04
I have added the code which you want to change in the answer below. Please check.
– Jaimin Sutariya
Jul 24 '17 at 8:13
I have added the code which you want to change in the answer below. Please check.
– Jaimin Sutariya
Jul 24 '17 at 8:13
add a comment |
2 Answers
2
active
oldest
votes
shippingMethod is created in app/design/frontend/base/default/template/checkout/onepage/shipping_method.phtml
class ShippingMethid is in skin/frontend/base/default/js/opcheckout.js
somewhere at 591 line.
And this is how you can override JS methods:
https://stackoverflow.com/questions/13379034/how-to-override-product-js-file-in-magento
This also works: https://stackoverflow.com/questions/11941257/overriding-extending-the-magento-core-javascript-files
can you please paste the code here of what you are referring line no 591
– magento12345
Jul 24 '17 at 8:04
i followed the above steps but its not override the function in my custom .js
– magento12345
Jul 24 '17 at 9:12
how you have done that?
– Konrad Siamro
Jul 25 '17 at 10:30
add a comment |
skin/frontend/package/theme/js/opcheckout.js //shipping method
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f186100%2fi-want-to-override-js-function-on-shipping-method-section%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
shippingMethod is created in app/design/frontend/base/default/template/checkout/onepage/shipping_method.phtml
class ShippingMethid is in skin/frontend/base/default/js/opcheckout.js
somewhere at 591 line.
And this is how you can override JS methods:
https://stackoverflow.com/questions/13379034/how-to-override-product-js-file-in-magento
This also works: https://stackoverflow.com/questions/11941257/overriding-extending-the-magento-core-javascript-files
can you please paste the code here of what you are referring line no 591
– magento12345
Jul 24 '17 at 8:04
i followed the above steps but its not override the function in my custom .js
– magento12345
Jul 24 '17 at 9:12
how you have done that?
– Konrad Siamro
Jul 25 '17 at 10:30
add a comment |
shippingMethod is created in app/design/frontend/base/default/template/checkout/onepage/shipping_method.phtml
class ShippingMethid is in skin/frontend/base/default/js/opcheckout.js
somewhere at 591 line.
And this is how you can override JS methods:
https://stackoverflow.com/questions/13379034/how-to-override-product-js-file-in-magento
This also works: https://stackoverflow.com/questions/11941257/overriding-extending-the-magento-core-javascript-files
can you please paste the code here of what you are referring line no 591
– magento12345
Jul 24 '17 at 8:04
i followed the above steps but its not override the function in my custom .js
– magento12345
Jul 24 '17 at 9:12
how you have done that?
– Konrad Siamro
Jul 25 '17 at 10:30
add a comment |
shippingMethod is created in app/design/frontend/base/default/template/checkout/onepage/shipping_method.phtml
class ShippingMethid is in skin/frontend/base/default/js/opcheckout.js
somewhere at 591 line.
And this is how you can override JS methods:
https://stackoverflow.com/questions/13379034/how-to-override-product-js-file-in-magento
This also works: https://stackoverflow.com/questions/11941257/overriding-extending-the-magento-core-javascript-files
shippingMethod is created in app/design/frontend/base/default/template/checkout/onepage/shipping_method.phtml
class ShippingMethid is in skin/frontend/base/default/js/opcheckout.js
somewhere at 591 line.
And this is how you can override JS methods:
https://stackoverflow.com/questions/13379034/how-to-override-product-js-file-in-magento
This also works: https://stackoverflow.com/questions/11941257/overriding-extending-the-magento-core-javascript-files
answered Jul 24 '17 at 8:00
Konrad SiamroKonrad Siamro
946624
946624
can you please paste the code here of what you are referring line no 591
– magento12345
Jul 24 '17 at 8:04
i followed the above steps but its not override the function in my custom .js
– magento12345
Jul 24 '17 at 9:12
how you have done that?
– Konrad Siamro
Jul 25 '17 at 10:30
add a comment |
can you please paste the code here of what you are referring line no 591
– magento12345
Jul 24 '17 at 8:04
i followed the above steps but its not override the function in my custom .js
– magento12345
Jul 24 '17 at 9:12
how you have done that?
– Konrad Siamro
Jul 25 '17 at 10:30
can you please paste the code here of what you are referring line no 591
– magento12345
Jul 24 '17 at 8:04
can you please paste the code here of what you are referring line no 591
– magento12345
Jul 24 '17 at 8:04
i followed the above steps but its not override the function in my custom .js
– magento12345
Jul 24 '17 at 9:12
i followed the above steps but its not override the function in my custom .js
– magento12345
Jul 24 '17 at 9:12
how you have done that?
– Konrad Siamro
Jul 25 '17 at 10:30
how you have done that?
– Konrad Siamro
Jul 25 '17 at 10:30
add a comment |
skin/frontend/package/theme/js/opcheckout.js //shipping method
add a comment |
skin/frontend/package/theme/js/opcheckout.js //shipping method
add a comment |
skin/frontend/package/theme/js/opcheckout.js //shipping method
skin/frontend/package/theme/js/opcheckout.js //shipping method
answered Jul 24 '17 at 8:02
PЯINCƏPЯINCƏ
8,55431147
8,55431147
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f186100%2fi-want-to-override-js-function-on-shipping-method-section%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The function is defined at skinfrontendbasedefaultjsopcheckout.js around line 624. Here
shippingMethod
is class andsave()
is the function.– Jaimin Sutariya
Jul 24 '17 at 8:00
can you please paste the code here of what you are referring line no 624
– magento12345
Jul 24 '17 at 8:04
I have added the code which you want to change in the answer below. Please check.
– Jaimin Sutariya
Jul 24 '17 at 8:13