Woocommerce Custom Add to Cart URL - php

I have a question with adding a product to the cart via a url. Right now I can use http://example.com/cart/?add-to-cart=49 and it will add the item to the cart. I'm using a plugin that adds a custom text input to each product. The plugin is WooCommerce Extra Product Options on codecanyon.
I need to add a parameter to my add to cart url where I can add an item to the cart but also pass a value to that custom input through the url as well. Ideally my url would look something like http://example.com/cart/?add-to-cart=49&textbox=myvalue. I'm really not sure the best way to approach this. I'm not against not using that plugin either if there is a better way to make this work. Thanks for your help.

Related

How to disable the ability to change shipping method on the checkout page in WooCommerce

I would like to disable the ability to change shipping method on the Checkout page in WooCommerce. The user selects the shipping method on the Cart page and I do not want to let them change it on the Checkout page.
I'm looking for some filter that can be used there. What I found is woocommerce_cart_ready_to_calc_shipping but it completely hides it.
Note: I would not like to overwrite the template file so I am looking for an way with a filter or action

WordPress WooCommerce - Custom Add-To-Cart URL with Add ons parameter

I want to use the add-to-cart URL to add Products into the cart.
The normal URL is like that: siteurl.com/?add-to-cart=123
Now I use the "Woocommerce Product Add-On" for Custom Parameter like "Size" as an example.
How I can add these parameters to the custom add to cart url?
Here things were originally complicated, but now it’s much easier! All you need is the variation ID. Here’s where you can find it:
href=”http://example.com/?add-to-cart=88"
Or you can use like this.
http://example.com/cart/?add-to-cart=PRODUCT_ID&variation_id=VARIATION_ID&attribute_pa_colour=black
http://example.com/cart/?add-to-cart=PRODUCT_ID&variation_id=VARIATION_ID&attribute_pa_size=32

Edit Product Meta Data after adding to cart, Woocommerce

I'm new to wordpress and woocommerce, I need to edit few Product Meta Data of a product after it has been added to cart. I've used "WooCommerce Product Gift Wrap". I need to add a option to allow users to remove gift wrap (If they had selected from product page) and update the product pricing as well.
I tried to change value with $values['gift_wrap'] = "0";, but when I print the meta array again, I cannot change the actual data which woocommerce takes from session (or something else). Kindly check the attached image link for better understanding.
Thank you.

How to customize cart item in magento

How can we customize cart items in magento. I have used custom options but it is not working as intended. All I need is to show some configurable data in cart page and in order page.
Can some one help how can I achieve it.
Edit: To elaborate, along with cart item, type and qty. I want to display supporting text for each item type. I got it working with custom options, but I had to include qty inside custom options which created an issue on cart page during cart update. Now I am looking for some other way by which I can acheive same thing.
Thanks
According to your question, you are trying to edit the product that are in the cart. Hope i am getting you right. For this you just need to have a look at the file default.phtml in
app/design/frontend/base/default/template/checkout/cart/item/default.phtml
This phtml file is responsible for displaying the item in the cart. Here you can get the custom options of the product as well. You can edit as per your requirement.
But remember before you edit copy this file to your theme because this is the best practice not to edit the magento's core files.
Hope this will help.

How to add an input filed to single product page in woocommerce to store extra user comments in the order?

I am using latest wp and wc and I am trying to add a form field in the frontend single product page where the user will be able to add comments which when the order is done the data will be available under woocommerce -> orders. Have anybody done that or it's not even possible because woocommerce is pretty limited for stuff like this?

Categories