Adding new product type and limiting payment methods by product type
I am not entirely new to WP but I am completely new to any form of payment processing as well as WooCommerce. I am using WooCommerce on my site, though, and people I have spoken with say that WOO is super easy to mod so I figured I’d integrate what I need to do with WOO but when I looked at all the stuff that it exposes to me I was both excited and completely overwhelmed… I am thus asking for any assistance in making this ocean of new stuff make more sense, please…
So here is what I want to do: I want to have a store in which you can buy real world goods like t-shirts and baseball caps and those items can be bought with real world cash (i.e. PayPal etc). I also want to sell digital goods like 3D models and soundtracks etc which should also be purchasable via real world cash. So far so good.
then I also want to sell virtual items that they never ever download but which gets added to their inventory on my database. These items, though, should be made available for purchase using either real world cash or my own virtual currency hosted and managed exclusively by me.
So basically, what I am needing is a way to specify a new payment method ‘myMarketPlace’ that will only show up when viewing items under a certain category in the shop. If the items in their cart contain both virtual items and other items, the option should be gone also.
I have already found code to create a new payment gateway and, as expected, when you know what to do then extending WOO is super simple but for me who doesn’t know it… it would have taken me ages to figure that out! Anyway, now I need to make that payment option only show up in some cases and not others. I am assuming I should just hook into X, then scan through the item in the cart and if condition Y, remove my gateway from an array. Great. What is X and what what is the name of the array?
But most importantly! And this is the part I am desperate for you to help me with, please… How do I make WOO send the order to my own server instead of sending it off to paypal or whoever to do the processing of the order? I can wrote my own code to manage my own database and update their balances and update their inventories and what not but how do I make WOO send me the data and not send it elsewhere? And finally, how do I complete the transaction so WOO doesn’t leave the state as pending or something else?
I noticed there is a variety of item types already including virtual items but I am yet to find out what the differences are between the lot. Perhaps this can be used for what I want to do? If so, a link to that document would be most welcome indeed!!!
So, to summarise my requirements:
– Real world payment methods as well as a virtual currency payment method
– Virtual currency should only be available for purchases of virtual items
– The store can contain physical, digital and virtual goods
Any insights would be greatly appreciated!
Thanks in advance
- The topic ‘Adding new product type and limiting payment methods by product type’ is closed to new replies.