I am trying to find a Magento frontend observer event that will trigger on the 'onepage checkout' page when the user has entered their 'Billing' details and clicked the submit button.
I am using Magento 1.7 and have come across this site which has a list of events, however I am unsure which this would be?
http://www.nicksays.co.uk/magento-events-cheat-sheet-1-7/
Can anyone suggest anything or point me in the right direction?
The data from the billing address is sent to Mage_Checkout_OnepageController::saveBillingAction so you can use controller_action_predispatch_checkout_onepage_savebilling
Then you can access in your observer the data sent through post like this
$post = Mage::app()->getRequest()->getPost();
But this may not fit your needs. If it doesn't then please explain what you want to do ehn you captrure the data.
The following worked observer worked:
checkout_controller_onepage_save_shipping_method
Related
On a page managed by each customer of my Wordpress website, I have a form with multiple fields, not only Wordpress core fields, but also WooCommerce fields, JetEngine fields, etc.
I need to update the user data on another app, via API. I can't find a hook where I can plug my own function, hook fired when all other hook are processed. Because if I hook profile_update, for example, the updated_user_meta calls have not been made, and all the data are not updated yet.
So my thought led me to find a hook which is fired when the form is submit. This way I will be able to get the form fields in my function (called with add_action) and then launch my API calls.
The problem is I can't find a hook which is fired on form submit. Do you have any idea of how I can manage that?
Thanks for your help!
PS: this question is not helping, because it's about admin form, and I'm not on admin side but on customer side, on his profile form.
I'm developing a website for a courier service, that has service quotation filling at the front end.
I did all form things working, a quotation will output variable with the cost of service in PHP.
After filling the form there will be checkout button, with that checkout button i need to save the details of the user, and that price to the woo commerce page to check-out/or fill further details. I searched throughout the google and got 1 solution to create a product with these values in front end. But its became very difficult to figuring out signing in, saving values, keep details in specific formate etc... for me as a beginner in PHP.
Can anyone help me with this?.
i just need woo commerce to make checkout with user entered details in the form.... .
EDIT & Updated :
Thanks for reply LoicTheAztec, I have gone through quick toure now
About code : I'm sending the values calculated in form to the page called buy-now using URL using javascript window.location.href=.
like http://example.com/buy-now?price=120&weight=80&location=000001
And also I'm able to fetch the value using
if (isset($wp_query->query_vars['pricef'])) in page template. (with StackOverflow help) and I'm checking user is logged in? using if(!is_user_logged_in()) and showing login form, After login also i can get the variables.
Now I need to create a transaction using this.
Saving data like a product or post and proceed for payment, I don't need to use woocommerce to do this but need some sort of idea to make it work.
Thank you.
So I am trying to set up a site on my localhost. I have selected 2 payment gateways from admin end
Online Payment (Free Shipping)
Cash On Delivery(Free Shipping/Flat COD Charge INR 50 )
Now I have customized all the rules for them. I only need one more rule.
I wish to have a functionality wherein I can enter some pincode/postcode values (through admin panel or maybe in some array in a javascript file or directly into the database, does not matter) of locations where second method is available)
Whenever someone presses continue before confirming order, the checkout form is validated so as to check from the form data if the value entered in post code matches the data (from any of the above methods) and if yes, only then they can continue or I wish to show an error message that
Following payment gateway is not available in your location
If you give me a hint on how to proceed with this, perhaps, I might be able to take it further. I am a bit or a starter in opencart so not much idea about how to proceed. I have sound knowledge of PHP, JQuery and Javascript although. So any and all help will be appreciated.
There are a few different extensions that already exist to do what you want - allow you to restrict shipping methods by various criteria. This one is my personal favorite: http://www.opencart.com/index.php?route=extension/extension/info&extension_id=1614
I managed it with JQuery for the time being. Edited the submit function in the cart.tpl file in catalog->view->theme->ancart (theme name) ->cart folder.
Used a plugin called "Zipcode COD" to enter zipcodes. Edited the response JQuery to hide and show payment options.
Lots of hard coding but does the trick. I will post the code if someone needs.
I've taken over an old project from a developer that just left and I could use some help just getting this done.
What I'm trying to do:
Magento (1.4.1.1) with one page checkout, I need to add a newsletter subscribe checkbox that if it is checked will subscribe the customer guest, registered or otherwise to the newsletter.
What I've done:
I've got a checkbox in the billing stage and I have got got a module that works by observing the event checkout_type_onepage_save_order and from that I subscribe the customer like so:
public function list_subscribe(Varien_Event_Observer $observer)
{
$quote = $observer->getEvent()->getQuote();
$customer = $quote->getCustomer();
if (($customer instanceof Mage_Customer_Model_Customer))
{
Mage::getModel('newsletter/subscriber')->subscribeCustomer($customer);
}
else
{
Mage::getModel('newsletter/subscriber')->subscribe($email);
}
}
That works fine but it subscribes everybody that visits the checkout and I need to somehow check that the checkbox is ticked in the checkout process. This is the part that has got me confused. I'm very new to Magento and just need to get this done so hoping a nice person out there can help me lean how would I go about doing this apparently simple check for a ticked checkbox?
Many thanks in advance for any contributions.
This extension work for your requirement, if you want to add module, here is the link http://www.emthemes.com/em-newsletter-optin.html
there are many extension for doing this and its free of cost
i'm trying to understand how checkout register method work, what i need is to now when the customer is created, because i add an alias attribute to the customer and i want set this attribute equal to the name when the user register in the checkout, untill now i can't found how to do this, need some help
thanks
If Im understand your question correctly, you're going to want to look mostly at the class Mage_Checkout_Model_Type_Onepage
Another option I believe would be writing your module to be triggered on a checkout event.
http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/customizing_magento_using_event-observer_method
1.4.1.x hook list, you can get the same list with a simple grep also...
http://watson-net.com/blog/magento-1-4-1-0-event-hooks/