Find Jobs
Hire Freelancers

Woocommerce order custom meta data from query vars

$10-30 USD

Completed
Posted about 3 years ago

$10-30 USD

Paid on delivery
Basically i need add to my Woocommerce order a custom meta (_device) and the value will be the result of the url loaded… Please please read the full explanation and all that i test. To test my dev server is needed change your local hosts. ——— Externally i load to my website a custom query variable on the URL. Example: [login to view URL]?origin=Android Varibles: source=webview and origin=Android or origin=IOS This variables let me know if the web is loaded from my webview app and what OS has the device (IOS or Android). I try a lots of ways to get this work. One of this ways is trying to use $_GET like this example: add_action('woocommerce_checkout_create_order', 'before_checkout_create_order3', 20, 2); function before_checkout_create_order3( $order, $data ) { $origen3 = $_GET['device']; $order->update_meta_data( '_origen3', $origen3 ); } But i can't save with php the Device and always have an empty value on my var. Y also try with get_query_var and here i have two problems. When i try to save the variable with get_query_var like this: $device = get_query_var( 'Device' ); I have an empty variable. If i declare the query_var i have a redirection error. This is my example: function test_query_vars( $qvars ) { $qvars[] = 'device'; return $qvars; } add_filter( 'query_vars', 'test_query_vars' ); Here i think is something missing because i get the device saved but when i try to go to the home the page redirect to another page. I try re-save the permalinks and the .htaccess file but nothing works.
Project ID: 29448450

About the project

4 proposals
Remote project
Active 3 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
$0 USD in 1 day
5.0 (11 reviews)
4.0
4.0
4 freelancers are bidding on average $40 USD for this job
User Avatar
Hello. Wordpress development expert ready to help you with custom meta functionality. I have more 400 good reviews and more 9 years of development experience behind, so all will be done with best quality and timeframe. Free bugfixing support. We can always make deal on price. Tnx, and hope to hear you soon.
$30 USD in 1 day
4.9 (600 reviews)
8.2
8.2
User Avatar
Hello. I can do this project right now. I am a professional Linux and developer in PHP, Wordpress, Laravel, Magento, Joomla, Prestashop, OpenCart, Yii, NodeJS, Angular, Vue.js, HTML5, CSS3 and jQuery. I can do this project. Please hire me. I think, You will contentment with my skills. I can fix your site issue successfully. I am looking forward to having further discussions with you and can start working immediately. Thank you
$30 USD in 1 day
5.0 (71 reviews)
6.0
6.0

About the client

Flag of GUATEMALA
Joyabaj, Guatemala
5.0
21
Payment method verified
Member since Sep 13, 2013

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759) & Freelancer Online India Private Limited (CIN U93000HR2011FTC043854)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.