Displaying order ID as a UNIQUE string type in woocommerceHow do I get PHP errors to display?How do I check if a string contains a specific word?Reference - What does this error mean in PHP?WooCommerce - Add $order_total to place order buttonWooCommerce order details after checkout pagePassing custom data from cart items to Order meta in Woocommerce 3Show WooCommerce Pay page content on checkout in model box after Place orderRedirect after order created on Woocommerce checkout pageWoocommerce place order button script
Why does Windows store Wi-Fi passwords in a reversible format?
What happened to the HDEV ISS Experiment? Is it over?
Where does learning new skills fit into Agile?
Can you grapple/shove when affected by the Crown of Madness spell?
Did anybody find out it was Anakin who blew up the command center?
Are game port joystick button circuits more than plain switches? Is this one just faulty?
Does EU 261/2004 compensation apply if delayed by the border check?
How should i charge 3 lithium ion batteries?
"There were either twelve sexes or none."
Can I get a PhD for developing an educational software?
Gambler coin problem: fair coin and two-headed coin
Count the number of paths to n
Why can't I access the 'name' of an object when looping through the scene's objects?
What's special ammo?
Thought experiment and possible contradiction between electromagnetism and special relativity
How do you capitalize agile costs with less mature teams?
Changing JPEG to RAW to use on Lightroom?
Prevent use of CNAME record for untrusted domain
What do these commands specifically do?
How does the OS tell whether an "Address is already in use"?
Rent contract say that pets are not allowed. Possible repercussions if bringing the pet anyway?
Unlock your Lock
Redacting URLs as an email-phishing preventative?
Retroactively modifying humans for Earth?
Displaying order ID as a UNIQUE string type in woocommerce
How do I get PHP errors to display?How do I check if a string contains a specific word?Reference - What does this error mean in PHP?WooCommerce - Add $order_total to place order buttonWooCommerce order details after checkout pagePassing custom data from cart items to Order meta in Woocommerce 3Show WooCommerce Pay page content on checkout in model box after Place orderRedirect after order created on Woocommerce checkout pageWoocommerce place order button script
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Ok I want to display the latest Order id as a unique string without the #
I have used this code to attempt to display on checkout page but it displays nothing.
<?php print $order->get_id();?>
Also i would like a function that allows the place order button on the checkout page to run my custom gateway when its pressed currently I am doing this using html.
php woocommerce
add a comment |
Ok I want to display the latest Order id as a unique string without the #
I have used this code to attempt to display on checkout page but it displays nothing.
<?php print $order->get_id();?>
Also i would like a function that allows the place order button on the checkout page to run my custom gateway when its pressed currently I am doing this using html.
php woocommerce
In checkout page, the order ID doesn't exist yet… Only in "Order received" page (thankyou page).
– LoicTheAztec
Mar 27 at 21:26
add a comment |
Ok I want to display the latest Order id as a unique string without the #
I have used this code to attempt to display on checkout page but it displays nothing.
<?php print $order->get_id();?>
Also i would like a function that allows the place order button on the checkout page to run my custom gateway when its pressed currently I am doing this using html.
php woocommerce
Ok I want to display the latest Order id as a unique string without the #
I have used this code to attempt to display on checkout page but it displays nothing.
<?php print $order->get_id();?>
Also i would like a function that allows the place order button on the checkout page to run my custom gateway when its pressed currently I am doing this using html.
php woocommerce
php woocommerce
edited Mar 27 at 20:04
Barker Antony
asked Mar 27 at 19:51
Barker AntonyBarker Antony
284 bronze badges
284 bronze badges
In checkout page, the order ID doesn't exist yet… Only in "Order received" page (thankyou page).
– LoicTheAztec
Mar 27 at 21:26
add a comment |
In checkout page, the order ID doesn't exist yet… Only in "Order received" page (thankyou page).
– LoicTheAztec
Mar 27 at 21:26
In checkout page, the order ID doesn't exist yet… Only in "Order received" page (thankyou page).
– LoicTheAztec
Mar 27 at 21:26
In checkout page, the order ID doesn't exist yet… Only in "Order received" page (thankyou page).
– LoicTheAztec
Mar 27 at 21:26
add a comment |
1 Answer
1
active
oldest
votes
If i'm understanding correctly your function get_id() is returning something like "#1234";
In this case you could just do a str_replace(). For example:
$id = "#1234";
$id = (int) str_replace("#", "", $id);
If not, please edit your question.
ok how do i put that in php
– Barker Antony
Mar 27 at 20:06
@BarkerAntony May you can post some code of your get_id() function? It would help me a lot.
– Flo Faber
Mar 27 at 20:08
Or you just do <?php print(str_replace("#", "", $order->get_id()); ?>
– Flo Faber
Mar 27 at 20:10
public function get_order_id( $context = 'view' ) return $this->get_prop( 'order_id', $context );
– Barker Antony
Mar 27 at 21:54
giving a 500 http error
– Barker Antony
Mar 27 at 21:54
|
show 3 more comments
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55385411%2fdisplaying-order-id-as-a-unique-string-type-in-woocommerce%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If i'm understanding correctly your function get_id() is returning something like "#1234";
In this case you could just do a str_replace(). For example:
$id = "#1234";
$id = (int) str_replace("#", "", $id);
If not, please edit your question.
ok how do i put that in php
– Barker Antony
Mar 27 at 20:06
@BarkerAntony May you can post some code of your get_id() function? It would help me a lot.
– Flo Faber
Mar 27 at 20:08
Or you just do <?php print(str_replace("#", "", $order->get_id()); ?>
– Flo Faber
Mar 27 at 20:10
public function get_order_id( $context = 'view' ) return $this->get_prop( 'order_id', $context );
– Barker Antony
Mar 27 at 21:54
giving a 500 http error
– Barker Antony
Mar 27 at 21:54
|
show 3 more comments
If i'm understanding correctly your function get_id() is returning something like "#1234";
In this case you could just do a str_replace(). For example:
$id = "#1234";
$id = (int) str_replace("#", "", $id);
If not, please edit your question.
ok how do i put that in php
– Barker Antony
Mar 27 at 20:06
@BarkerAntony May you can post some code of your get_id() function? It would help me a lot.
– Flo Faber
Mar 27 at 20:08
Or you just do <?php print(str_replace("#", "", $order->get_id()); ?>
– Flo Faber
Mar 27 at 20:10
public function get_order_id( $context = 'view' ) return $this->get_prop( 'order_id', $context );
– Barker Antony
Mar 27 at 21:54
giving a 500 http error
– Barker Antony
Mar 27 at 21:54
|
show 3 more comments
If i'm understanding correctly your function get_id() is returning something like "#1234";
In this case you could just do a str_replace(). For example:
$id = "#1234";
$id = (int) str_replace("#", "", $id);
If not, please edit your question.
If i'm understanding correctly your function get_id() is returning something like "#1234";
In this case you could just do a str_replace(). For example:
$id = "#1234";
$id = (int) str_replace("#", "", $id);
If not, please edit your question.
answered Mar 27 at 19:59
Flo FaberFlo Faber
1
1
ok how do i put that in php
– Barker Antony
Mar 27 at 20:06
@BarkerAntony May you can post some code of your get_id() function? It would help me a lot.
– Flo Faber
Mar 27 at 20:08
Or you just do <?php print(str_replace("#", "", $order->get_id()); ?>
– Flo Faber
Mar 27 at 20:10
public function get_order_id( $context = 'view' ) return $this->get_prop( 'order_id', $context );
– Barker Antony
Mar 27 at 21:54
giving a 500 http error
– Barker Antony
Mar 27 at 21:54
|
show 3 more comments
ok how do i put that in php
– Barker Antony
Mar 27 at 20:06
@BarkerAntony May you can post some code of your get_id() function? It would help me a lot.
– Flo Faber
Mar 27 at 20:08
Or you just do <?php print(str_replace("#", "", $order->get_id()); ?>
– Flo Faber
Mar 27 at 20:10
public function get_order_id( $context = 'view' ) return $this->get_prop( 'order_id', $context );
– Barker Antony
Mar 27 at 21:54
giving a 500 http error
– Barker Antony
Mar 27 at 21:54
ok how do i put that in php
– Barker Antony
Mar 27 at 20:06
ok how do i put that in php
– Barker Antony
Mar 27 at 20:06
@BarkerAntony May you can post some code of your get_id() function? It would help me a lot.
– Flo Faber
Mar 27 at 20:08
@BarkerAntony May you can post some code of your get_id() function? It would help me a lot.
– Flo Faber
Mar 27 at 20:08
Or you just do <?php print(str_replace("#", "", $order->get_id()); ?>
– Flo Faber
Mar 27 at 20:10
Or you just do <?php print(str_replace("#", "", $order->get_id()); ?>
– Flo Faber
Mar 27 at 20:10
public function get_order_id( $context = 'view' ) return $this->get_prop( 'order_id', $context );
– Barker Antony
Mar 27 at 21:54
public function get_order_id( $context = 'view' ) return $this->get_prop( 'order_id', $context );
– Barker Antony
Mar 27 at 21:54
giving a 500 http error
– Barker Antony
Mar 27 at 21:54
giving a 500 http error
– Barker Antony
Mar 27 at 21:54
|
show 3 more comments
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55385411%2fdisplaying-order-id-as-a-unique-string-type-in-woocommerce%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
In checkout page, the order ID doesn't exist yet… Only in "Order received" page (thankyou page).
– LoicTheAztec
Mar 27 at 21:26