-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 'crypto' custom route issue #154 #156
base: master
Are you sure you want to change the base?
Changes from all commits
122a360
10b6b04
7611c39
9e7493a
c257013
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,7 +139,8 @@ public function process_payment($order_id) | |
update_option('blockonomics_orders', $blockonomics_orders); | ||
$order_url = WC()->api_request_url('WC_Gateway_Blockonomics'); | ||
$order_url = add_query_arg('show_order', $address, $order_url); | ||
|
||
$order_url = str_replace('wc-api/WC_Gateway_Blockonomics', 'crypto', $order_url); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is no need to first add WC()->api_request_url and then replace it. We should directly use show_order There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not have any way to directly access show_order as we are not creating any page or post type. We still have to use |
||
|
||
update_post_meta($order_id, 'blockonomics_address', $address); | ||
|
||
return array( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us show_order . Also don't hardcode
wc-api=WC_Gateway_Blockonomics
let us useWC()->api_request_url
else it won't work for WC < 3.0There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cannot use
WC()->api_request_url
because add_rewrite_rule requires the url to start withindex.php
. All wordpress urls can be accessed in this manner.In later versions of woocommerce, they added their own rewrite rules to change the url, however, we still need to access the original page with the form
index.php?wc-api=WC_Gateway_Blockonomics