-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adding subscription option to products (Incomplete) #23
- Loading branch information
1 parent
d5b835d
commit d627fec
Showing
6 changed files
with
218 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,13 @@ | ||
document.querySelector("subscriptionTab_options.subscriptionTab_tab").style.display = "none" | ||
showTab() | ||
document.querySelector("#_lkn-wcip-subscription-product").onchange = ()=>{showTab()} | ||
|
||
function showTab(){ | ||
let subscriptionCheckbox = document.querySelector("#_lkn-wcip-subscription-product") | ||
let subscriptionTab = document.querySelector(".subscriptionTab_options.subscriptionTab_tab") | ||
|
||
if(subscriptionCheckbox.checked){ | ||
subscriptionTab.style.display = "" | ||
}else{ | ||
subscriptionTab.style.display = "none" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
use WP_Error; | ||
use WP_REST_Response; | ||
|
||
class Wc_Payment_Invoice_Endpoint { | ||
public function createInvoiceEndpoint(): void { | ||
register_rest_route('invoice_payments', '/create_invoice', array( | ||
'methods' => 'POST', | ||
'callback' => array($this, 'createInvoice'), | ||
)); | ||
} | ||
|
||
public function createInvoice($request) { | ||
$parameters = $request->get_params(); | ||
|
||
return new WP_REST_Response(json_encode($parameters), 200); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters