Help Needed: Is it possible to make a user-generated temporary product to be added to cart in WooCommerce? I'm trying to transfer a non-wordpress website to WordPress, but the site already has a sophisticated e-commerce system that the client doesn't want to change it. What basically happens is a visitor specifies the measurement of the product that the client is selling, add different variations to it, and then after submitting, the website generates the product's price based on the visitor's input. Adding products will be very tedious because they have too many products with thousands of variations. So our solution is this. I'm open to other plugin suggestions aside from WooCommerce. I already tried using Gravity Forms, but I got stuck in the end because our client's current website has to be an e-commerce site after it was added to the cart. Thank you in advance!
相关问题
- Display product ACF field value in Woocommerce tra
- Adding a custom button after add to cart button in
- How to add a “active” class to a carousel first el
- Setting custom order statuses as valid for payment
- change the font size in tag cloud
相关文章
- wordpress新增页面如何个性化设置
- select query in wordpress
- Get WooCommerce featured products in a WP_Query
- Woocommerce update shipping methods in checkout vi
- Change order status just after payment in WooComme
- Publishing or uploading failed. Error message: “Th
- Facebook Login With WP JWT Auth
- Wordpress development process
This is solved! Here is what I did just in case someone needs help with this in the future.
First I made a page with a form. Action is whichever the page will live in and method is post.
Then on the next page, I grabbed the values, created the product based on the values given, and then added a shortcode to display the cart button.
and then lastly, once an order is completed, delete the product by hooking an action to woocommerce_thankyou. I put it in the functions.
To Extend this topic and trash or delete products from a category when the order is successfully created.
First you need to create a custom category where all the products you'd like to trash or delete upon successful order creation will live. Then add the following code;
Code goes in function.php file of your active child theme (or active theme) or cutsom plugin. Tested and worked.