Find Jobs
Hire Freelancers

Modifiy PHP to use variables sent by get request from my website

€8-30 EUR

Abgeschlossen
Veröffentlicht vor mehr als 5 Jahren

€8-30 EUR

Bezahlt bei Lieferung
I have this script on my website that makes a get request to a php file with some information that works prefect : var vendor = 'Asiduo'; var product_type = 'comida_configurada'; var price = $('.subtotal').data('total'); var featured_image = $('.[login to view URL]').data('image'); // [login to view URL](body_html); var data = { "action" : "add_product" , "title" : "Custom Box Item", "body_html" : body_html, "vendor" : vendor, "product_type" : product_type, "price" : price, "featured_image" : featured_image }; data = $(this).serialize() + "&" + $.param(data); $.ajax({ url: 'http:/h/[login to view URL]', method: 'GET', data: data, dataType: 'jsonp', crossDomain: true, jsonpCallback: 'myCallback', success: function(data) { }, error: function(XMLHttpRequest, textStatus, errorThrown) { [login to view URL]("Status: " + textStatus); [login to view URL]("Error: " + errorThrown); [login to view URL]("request: " + XMLHttpRequest); } }); And have a php file on my server that creates a "general predefined" products on Shopify ( an e-commerce solution ). And works perfect too. BUT I want you to modify this generic php to accept the data from the get request and create a product with the real variables. The work only implies modifying the php to retrieve the variables from the request, and store them in the product arrray. The php does the rest by itself. <? session_start(); require __DIR__.'/vendor/[login to view URL]'; use phpish\shopify; require __DIR__.'/[login to view URL]'; $shopify = shopify\client(SHOPIFY_SHOP, SHOPIFY_APP_API_KEY, SHOPIFY_APP_PASSWORD, true); try { # Making an API request can throw an exception $product = $shopify('POST /admin/[login to view URL]', array(), array ( 'product' => array ( "title" => "Roberto Prueba", "body_html" => "<strong>Good snowboard!</strong>", "vendor" => "Penis", "product_type" => "Snowboard", "variants" => array ( array ( "option1" => "First", "price" => "10.00", "sku" => 123, ), array ( "option1" => "Second", "price" => "20.00", "sku" => "123" ) ) ) )); print_r($product); } catch (shopify\ApiException $e) { # HTTP status code was >= 400 or response contained the key 'errors' echo $e; print_R($e->getRequest()); print_R($e->getResponse()); } catch (shopify\CurlException $e) { # cURL error echo $e; print_R($e->getRequest()); print_R($e->getResponse()); } ?>
Projekt-ID: 18219259

Über das Projekt

6 Vorschläge
Remote Projekt
Aktiv vor 5 Jahren

Möchten Sie etwas Geld verdienen?

Vorteile einer Ausschreibung auf Freelancer

Legen Sie Ihr Budget und Ihren Zeitrahmen fest
Für Ihre Arbeit bezahlt werden
Skizzieren Sie Ihren Vorschlag
Sie können sich kostenlos anmelden und auf Aufträge bieten
Vergeben an:
Avatar des Nutzers
hi I am a software developer working since 2007. With my skills, i develop competitive advantages and create technological solutions through the adoption of emerging engineering’s. Focusing on the development of web applications and solutions with professionalism and commitment, I make products and good ideas happen. i am looking forward to alter your code. Thanks
€15 EUR in 1 Tag
5,0 (112 Bewertungen)
6,3
6,3
6 Freelancer bieten im Durchschnitt €37 EUR für diesen Auftrag
Avatar des Nutzers
I’d really like to work with you on this one if possible! I will develop a website in your budget and with modern design. I do have a couple of questions, but first I’d like to make you an offer and some background so you can check my work out. I have 4 years of experience in web application development. I have worked with PHP, Wordpress, Code Ignitor, Big Commerce,AJAX, JSON, HTML, HTML5, CSS, CSS3. I will develop a website using WordPress so you can modify on your own. Also, It will be with a responsive layout to best fit in any resolutions. You’ll get all the expected stuff like a great professional service and a fast turn around, at a bit less, and I get a bit more exposure. If the above offer sounds like something you would be interested in, I’d love to hear from you. Regards, Bhavesh V.
€23 EUR in 5 Tagen
4,8 (11 Bewertungen)
5,6
5,6
Avatar des Nutzers
- 2 years of PHP experience, Laravel, MVC - 1 year Front-end - Developing marketing tools - facebook API
€23 EUR in 1 Tag
0,0 (0 Bewertungen)
0,0
0,0

Über den Kunden

Flagge von SPAIN
Madrid, Spain
5,0
32
Zahlungsmethode verifiziert
Mitglied seit Jan. 3, 2012

Kundenüberprüfung

Danke! Wir haben Ihnen per E-Mail einen Link geschickt, über den Sie Ihr kostenloses Guthaben anfordern können.
Beim Senden Ihrer E-Mail ist ein Fehler aufgetreten. Bitte versuchen Sie es erneut.
Registrierte Benutzer Veröffentlichte Jobs
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Vorschau wird geladen
Erlaubnis zur Geolokalisierung erteilt.
Ihre Anmeldesitzung ist abgelaufen und Sie wurden abgemeldet. Bitte melden Sie sich erneut an.