I'm unsure if this is a default function of WooCommerce, but I imagine it should be. As of now, it doesn't work.
I add products to the basket and am shown the correct shipping options. I select one, but the total price on the page doesn't change.
If I click through to the checkout, the shipping method resets to the default option (ignoring the one I selected on the basket page). Selecting the correct one again still doesn't update the total price shown on the page.
Checking out and completing the transaction proves that the option chosen does get passed to the checkout process and is used for the total cost - but I can't figure out why this isn't updated on the previous pages and shown to the user, or why it resets on the checkout page.
Related
I'm working on a WooCommerce website. For some reason, when a customer is on the cart page and fills out the Calculate Shipping fields of city, state, and zip code, then goes to checkout, the state selected in the Calculate Shipping field doesn't stay selected in the checkout page's billing form. The user has to reselect it. Too many users are getting frustrated with this. How do I get the Calculate Shipping's "State" field value to carry over to the checkout page?
For the record, this is using the default WooCommerce templates for everything. Nothing has been forked. There are no filters or actions in functions.php in play for cart or checkout. So the code has no modifications to show here in this post. It's just the default WooCommerce code. Somehow it's just not remembering the user's "State" selection from cart to checkout.
I asked WooCommerce support about this and their answer was
This is intentional functionality. The shipping calculator on the cart page is not meant to be the customer's actual address, necessarily, but just a quick calculation of what the shipping costs would be if the customer did decide to use that address. It is not necessary to fill these fields out before moving onto the checkout page, either.
I'm developing a module that appears in the product page. This module consist of a checkbox which when is checked, shows a few inputs to be filled by the client and add an extra amount of, for example, 50.
How can I add this amount to the product cart? I'm using the hook hookActionCartSave to retrieve the cart but I can't update it adding the amount of 50.
The ideal is to reflex this concept like shipping costs but I'm stuck on how to change the product price or add a new concept when the checkbox is checked and client click "Add to cart" button.
Thank you!
I want to make implement Cart funcionality in Laravel. I chose this plugin. But here and in many others cart packages I see that cart row stores not a product id but full information (product name, options, price). But what if the product title or product price was changed? Then the user still sees the old title (price) and it will cause some inconvienences to him. What I do not understand, why most cart packages store full information in cart row.
So what is the right way to store cart data: full info or by keys (product_id, option_id, ...)?
There is a preferred way to store cart information, and its the latter that you mentioned.
The reason for this is to not only increase the security of your shopping cart, but to also ensure that, as you rightly pointed out, customers are getting the right price, even after a change.
Typically what you want to do is store the product ID, any customisation options as well as a cart ID. Depending on the amount of products and the traffic you're receiving it may be unnecessary to work out the basket price each time a new page is loaded, and so typically you only work out a new price when a new product is added, taken away or modified; in addition to when the customer gets to the checkout area.
This serves several purposes,
the first is that is ensure that when the cart is directly changed by
a customer action, you can show an updated price.
The second is that you cut down the amount of calculations you have to do by a large amount by only changing the prices in the basket when something acts upon it.
You can ensure that customers cannot cheat the system by modifying the price, then going on to pay a different amount because you stored the price in the session.
I can't give you a more concrete answer because you've been fairly light on the specifics, but I hope this indicates the direction you should be heading in.
i have been working trying to create an edit order system where when an order is bellow a given state the customer can edit the order
now i have everything working by adding a reorder like link which does the exact same as reorder but creates a session which identifies that your editing an order, in order to do this for out of stock products i had to turn backorders on
however i have found a glitch, if a customer was to add 5 hats to the cart and logs off, if when they come back the item's stock qty is now 0 they can still go into the cart, naturally this is because of the backorders being enabled.
i have made a CartController to pick up adding/updates to the shopping cart and manually check if the stock is less than what's in the cart, however if the customer had the item when there was ample stock, leave and returns when it's now out of stock, they bypass these checks
one suggestion that was made by a college was that we shorten the lifetime of the cart session for registered customers, while we could do this, there is more of a problem during a sale
originally, before backorders was turned on, if this same situation occurred the "Proceed to checkout" button would be missing and you would get an error message
now i've tried fixing up a new IndexController and using $this->_getSession()->addError('Some products in your cart have gone out of stock'); but i'm not getting the same results
so how do i create an error message that will prevent the customer from going into the checkout until they have fixed up their cart
I would suggest you to make a dedicated page let's call it edit_cart. When you are redirecting to checkout, check all products and validate their qty in magento. Push them to edit_cart and let them delete out of stock products from cart. After this redirect them to checkout.
I am currently working on an eCommerce website, but i need some advice regarding the stock management.
I want the shopping cart to work as follow:
CostumerA add a productO to cart with a quantity of '1'.
CostumerB tries to add the same product to their cart but with no success.
CostumerA logs out or their session expires.
CostumerB tries to add productO again and is allowed to do so since the product hasn't been added to CustomerA's cart ...
i came up with 2 solutions but neither is reliable from my point of view:
add a field 'champ' to Table product that initially have value of product.quantity but change with cart movements.
add table Cart and update it with cart movements.
as u can see both solution require lot of work.Is there a better way to implement my shopping cart.
I think a better way might be to only update if the user checks out and check stock on the product listing pages.
The downside being the following scenario:
user A adds an item to their cart
user B adds the same item to their cart
user A checks out and the item is now out of stock
user B checks out, but item is out of stock
You'll need to check stock at every point in this process and inform your users what's going on.
Tying up inventory by having a user placing it in their cart is a bad idea. If user A adds all of the available stock of one item to their cart, no one else can buy it until they either log out, or you log them out with some sort of timeout.