Assign DIV ID a value.
-
Hello all,
New to this forum and also new to coding, so please bear with me since it’S probably a simple answer to my question!
I have the below code which pops up a window for user ratings at order confirmation. The pop up window comes up fine but the values are not being populated.
The values I need are: email, order number and date the order was placed (no time needed, just the date format in YYYY-MM-DD.
When I echo the values they are correct. Only the date for some reason is not being populated, that is my first issue.
If I hard code the values when assigning the Div Id values it works fine but it does not pull the data correctly on it’s own. i.e. <div id=”rating_ordermail”>[email protected]()</div>
Any help would be appreciated.
Here is the code I found on the internet and have tried various combinations but failed!
add_action( ‘woocommerce_order_details_after_order_table’, ‘trusted_shops_thankyou’, 15, 1 );
function trusted_shops_thankyou( $order ) {echo $order->get_billing_email();
echo $order->get_order_number();
echo $order->get_date_completed();// I need to fill the following DIVs
echo ‘
<div id=”ratingvalues” style=”display: none;”>
<div id=”rating_ordermail”>echo $order->get_billing_email()</div>
<div id=”rating_ordernumber”>echo $order->get_order_number()</div>
<div id=”rating_orderdate”>echo $order->get_date_completed()</div>
</div>
‘;
}
- The topic ‘Assign DIV ID a value.’ is closed to new replies.