How can I store my data in a woocommerce session and use it anywhere on woocommerce pages (for example, a thank you page, processing a mail page). Second, I just have to send a unique code in the email of woocommerce (both administrator and user). How to do it? thanks in advance
To use a session you can do
// Test if your are on Back Office, WC()->session isn't set if( !is_admin() ){ $data = 'test'; WC()->session->set( 'name_for_your_data' , $data ); $retrive_data = WC()->session->get( 'name_for_your_data' ); }
Source: https://habr.com/ru/post/1207923/More articles:Haskell - Functors - functorWhat type is used to store byte strings in SQLAlchemy? - pythonUI elements for selecting date and time (and not just dates) in brilliant - rggplot2: merge shapefiles from two different geodata - rAndroid ADB - cannot be recognized LG G Pad (VK810) - androidcurl command output has incorrect encoding - linuxhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1207925/how-to-add-elements-to-domnodelist-in-php&usg=ALkJrhgCVuEuBUWbvzSgaDbB-lPZWBjy0gThe basic flavor of Android without error duplicate class - androidHow can you easily format mercury log "hg log" as JSON parsing? - mercurialhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1207928/mime4j-defaultmessagebuilder-fails-to-parse-mbox-content&usg=ALkJrhggO_l4xX51_xsI7LHRArs4-DzFcgAll Articles