Closed ajlowndes closed 5 years ago
https://code.tutsplus.com/tutorials/writing-extensible-plugins-with-actions-and-filters--wp-26759 for a tutorial on adding hooks to custom plugins... maybe you've already done this though? i can't really tell....
Hi @ajlowndes,
I guess you just need to add a new variation, to a product of type registrations
, with the format {"type":"range","dates":["2018-03-10","2018-03-11"]}
. It's not good, but it's the way it's workin for now
Okay tackling this again after a long (long) hiatus. Struggling to add a new variation unless I somehow add the date attribute to the existing list first. Any idea how this is accomplished from the api end? Thx
I have been browsing the code quite a lot lately, trying to figure out what I need to add to the database to add a variation to an existing product, programatically. I have tutorials on how to do it with normal woocommerce products - but unsure how they apply to this custom product type... Am I correct in thinking that i would simply add, for example
{"type":"range","dates":["2018-03-10","2018-03-11"]}
to the "dates" database entry under a new variation id? OR, is there a ready-made hook reference already in the code? If not, where would it be put?