-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish_product.php
58 lines (52 loc) · 1.64 KB
/
publish_product.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* MercadoLibre hackaton index page
* @author mezalejandro
* @copyright 2013
*/
require_once 'includes/header.inc.php';
echo '<pre>';
print_r($_POST);
echo '</pre>';
echo '<br/><br/><br/>';
if(isset($_POST['publicar']))
{
/*$item = array(
'title' => $_POST['title'],
'subtitle' => $_POST['title'],
'description' => $_POST['description'],
'category_id' => $_POST['category'],
'price' => $_POST['price'],
'condition' => $_POST['conditions'],
'listing_type_id' => 'bronze',
'currency_id' => 'ARS'
);*/
$item = array(
"title" => $_POST['title'],
"subtitle" => "",
"category_id" => $_POST['category'],
"price" => $_POST['price'],
"currency_id" => "ARS",
"available_quantity" => 1,
"buying_mode" => "buy_it_now",
"listing_type_id" => "bronze",
"condition" => "new",
"description" => "Item:, <strong> Ray-Ban WAYFARER Gloss Black RB2140 901 </strong> Model: RB2140. Size: 50mm. Name: WAYFARER. Color: Gloss Black. Includes Ray-Ban Carrying Case and Cleaning Cloth. New in Box",
"video_id" => "YOUTUBE_ID_HERE",
"warranty" => "12 month by Ray Ban",
"pictures" => array(
array(
"source" => "http://upload.wikimedia.org/wikipedia/commons/f/fd/Ray_Ban_Original_Wayfarer.jpg"
),
array(
"source" => "http://en.wikipedia.org/wiki/File:Teashades.gif"
)
)
);
$item = $meli->postWithAccessToken("/items", $item);
// $item = $meli->postWithAccessToken("/items", $item);
echo '<pre>';
print_r($item);
echo '</pre>';
}
?>