Woocommerce checkout on the home page - ajax

I have WP 3.9.1 and WC 2.1.12 installed.
There are 2 pages: home page and checkout page for redirect from PayPal and place order.
I have checkout in the modal window on the home page. So user choose
attributes for product variation, product adds to the cart with Ajax.
So if i open checkout, everything looks fine, but countries selection,
shipping and tax options don't work, in the same time on the checkout
page I don't have such problems. I've noticed that I should add
wc-checkout scripts to the front page, so I load them with this
function
wp_enqueue_script('wc-checkout', plugins_url() . '/woocommerce/assets/js/frontend/checkout.min.js', array('jquery', 'woocommerce', 'wc-country-select', 'wc-address-i18n', ), null, true);
and it works, but only after reloading the page. Thanks for any advise.

Related

Woocommerce Cart AJAX not working when cart is loaded with shortcode

I am using [woocommerce_cart] shortcode to load Cart in hidden absolute full-overlay div which can be opened on any page (it's located in header).
The problem: Cart AJAX is not working on any other page except mywebsite.com/cart page.
For example, when I am on my home page, I open my absolute full-overlay div which contains Shopping Cart called by shortcode, and I click on Update Cart button, it does update the cart, but instead of doing it with AJAX, it redirects me to mywebsite.com/cart page.
I figured out how to prevent redirection to /cart page by following this instructions: WooCommerce: updating cart from checkout page redirects to cart page , but it still reloads the current page instead of using AJAX.
So, the main thing I would like to achieve is to force Cart AJAX on all pages. However, it would also be helpful if someone knows how to prevent redirections after click on Update Cart, Remove Item... BUT only redirections, and let the processes of updating cart, removing items etc. to be completed (so preventDefault() is not an option.)
Thanks.

Ajax Cart empty Prestashop 1.6

In prestashop 1.6
Using Ajax-cart
If i log-in as a Customer and add products to the cart and checkout the order all work.
Then the ajax cart stop working.
If I add a product to the cart and refresh the page the cart return
empty.
If i add a product to the cart and click "go to cart" the cart return empty.
If i log out and log in again, the cart return working for an order, then if i checkout the new order the problem return.
seem to be a problem whith Cookie the is overwritter in some ajax call in ajax-cart.js
I've look this but is not my case :Cart products dissapear on refresh page Prestashop
If i disable ajax cart all work fine.
EDIT
On Google i've found something and seem to be an ajax problem but all the solution suggested don't work.
I was also facing the same issue. You should try the following module and try last two options from the module's configuration and this issue will be gone:
https://github.com/PrestaShop/pscleaner
IMPORTANT: If you are trying it on live site make sure you do not enable first options in this module i.e. Clean up Customers, Clean up Catalog & Orders.
Reply back if you still face the issue.
Cheers!!

Customize Magento checkout process

I have products with individual landing pages. I want the landing pages to contain everything needed to checkout with that product. This includes a dropdown to select the quantity of the product desired, shipping information and billing information. Is this possible? In default Magento, you can't get to the checkout process without first having an item in the cart.
Default Magento allows you to choose where to redirect after a product is added to cart: to the cart overview or back to the page where the "Add to Cart" button was clicked. Using a similar approach you can create an extension that overrides the 'addAction' method of the cart controller to redirect to the checkout page immediately after a product is added to cart.
You can't go to checkout with an empty shopping cart, but redirecting after the add to cart action allows customers to skip the cart page, if that is what you intend to achieve.
It is also possible to use the billing and shipping information the customer submits in the landing page for the checkout - your extension will have to validate it and save into the quote object as if it was submitted in the respective checkout steps.
Developing such an extension would not be a simple task - checkout is a very sensitive matter.

Magento checkout redirect to cart turns me back to product page

I have an issue when i go to my cart an then to proceed to checkout it on https does not redirecting me to the same page instead of that it gos bck on product page. Anone have some solution for this issue? Thanks

Magento Checkout Redirecting to Cart page

When i try to do purchase by clicking place order button in magento,it redirects from checkout page to cart page.This happens only when I select paypal website payments pro as payment method.Paypal express checkout works fine.Magento does not show error in system.log or in exception.log
Magento version - 1.5.1.0.
Could anyone help?

Resources