18 if (!defined(
'NOTOKENRENEWAL')) define(
'NOTOKENRENEWAL',
'1');
19 if (!defined(
'NOREQUIREMENU')) define(
'NOREQUIREMENU',
'1');
20 if (!defined(
'NOREQUIREHTML')) define(
'NOREQUIREHTML',
'1');
21 if (!defined(
'NOREQUIREAJAX')) define(
'NOREQUIREAJAX',
'1');
22 if (!defined(
'NOREQUIRESOC')) define(
'NOREQUIRESOC',
'1');
24 require
'../../main.inc.php';
25 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
26 require_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductAttribute.class.php';
27 require_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductAttributeValue.class.php';
29 header(
'Content-Type: application/json');
34 print json_encode(array(
35 'error' =>
'ID not set'
42 if ($prodattr->fetch($id) < 0) {
43 print json_encode(array(
44 'error' =>
'Attribute not found'
51 $res = $prodattrval->fetchAllByProductAttribute($id);
54 print json_encode(array(
55 'error' =>
'Internal error'
60 print json_encode($res);
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class ProductAttributeValue Used to represent a product attribute value.
Class ProductAttribute Used to represent a product attribute.
print
Draft customers invoices.