1

I want to create a woocommerce dependent plugin. The function of the plugin is to let visitor configure a product based on some complex field then they will click a "OK" button and the product will be added to the cart. That means I want to use woocommerce as a tool for handling payments and taking orders. When the customer finish checkout I will process the order manually.

I know there is an add-on for configurable product "product bundles". But it does not serve my purpose. I need complete control. My plugin has special visual requirements. I found a plugin that do a bit same way, it is "Paid Membership Pro", it makes some predefined product. But I need to make product on the fly.

Please, help me, Thanks in advance.

  • be more specific about your problem. You want to create new product dynamically using code ? – Pushpak Patel Jun 19 '14 at 17:54
  • Thanks for getting involved Pushpak Patel. Yes, I want to created new product dynamically. I will have form with various input types such as Hard Disk capacity, RAM, monitor size, monitor brand, power watt etc. Visitor will set value of these fields like configuring his product. Then he will click ok or "add to cart" button. At this point I need this product with description and generated price to be added in cart to go for check out. Let me know your thoughts, you may formulate a better solution. The form I need to be created as a separate plugin, not as a part of woocommerce. – Taher Uddin Jun 24 '14 at 05:51
  • 1
    This is kinda easy stuff. You can either add this to theme or plugin whichever you prefer. Add a page on site with the form having required fields. on submission get the form fields values and make an entry in post table with post_type as product and set appropriate metas. Save the extra information provided by the user into the post_meta table. After product is created, add that product to cart and show the user a link to checkout or cart. You can do this through ajax calls. Place your ajax call handlers in your plugin – Pushpak Patel Jun 24 '14 at 07:15
  • Thanks for the help. Can you please formulate a way to bypass the steps of creating product and adding them to cart? Is it possible to directly make payment? I want to do everything with my custom code just when I need user to make the the payment I will call woocommerce with a parameter (product info), after finishing payment I will get back to my code and do further processing like changing status to "Paid in full". – Taher Uddin Jun 24 '14 at 18:46
  • 1
    Adding product each time user make a order will insert a lots of product into the database and will show up as lots of products in admin products page. This will be a problem. Thereby it is better if I can bypass creating product. – Taher Uddin Jun 24 '14 at 18:50
  • I dont know whether that is possible or not. Cause if you are using woocommerce, what a user buys is product. So in order for woocommerce to carryout its task, the user needs a product which he can buy. – Pushpak Patel Jun 25 '14 at 06:38
  • Thanks for the reply. I am thinking about a trick. If I delete the product after payment then I can get rid of the products inserted. But can I get the details of the product when I will process the order manually? Is there any field in database associated with checkout entry that store database details? or any way to do this trick? – Taher Uddin Jun 26 '14 at 09:27
  • Long time! still did you find any solution to it @TaherUddin? – Yatix May 31 '15 at 14:21
  • really interested if you found a solution – Develope Cruz Dec 03 '19 at 11:25
  • someone referred to - https://wordpress.stackexchange.com/questions/137501/how-to-add-product-in-woocommerce-with-php-code – T.Todua Apr 04 '20 at 09:03

0 Answers0