19 if (!defined(
'NOTOKENRENEWAL')) {
20 define(
'NOTOKENRENEWAL',
'1');
22 if (!defined(
'NOREQUIREMENU')) {
23 define(
'NOREQUIREMENU',
'1');
25 if (!defined(
'NOREQUIREHTML')) {
26 define(
'NOREQUIREHTML',
'1');
28 if (!defined(
'NOREQUIREAJAX')) {
29 define(
'NOREQUIREAJAX',
'1');
31 if (!defined(
'NOREQUIRESOC')) {
32 define(
'NOREQUIRESOC',
'1');
35 require
'../../main.inc.php';
36 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductAttribute.class.php';
38 require_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductAttributeValue.class.php';
41 if (empty($conf->variants->enabled)) {
44 if ($user->socid > 0) {
59 print json_encode(array(
60 'error' =>
'ID not set'
67 if ($prodattr->fetch($id) < 0) {
68 print json_encode(array(
69 'error' =>
'Attribute not found'
76 $res = $prodattrval->fetchAllByProductAttribute($id);
79 print json_encode(array(
80 'error' =>
'Internal error'
85 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.
if(!defined('NOREQUIREMENU')) if(!function_exists("llxHeader")) top_httphead($contenttype= 'text/html', $forcenocache=0)
Show HTTP header.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.