19if (!defined(
'NOTOKENRENEWAL')) {
20 define(
'NOTOKENRENEWAL',
'1');
22if (!defined(
'NOREQUIREMENU')) {
23 define(
'NOREQUIREMENU',
'1');
25if (!defined(
'NOREQUIREHTML')) {
26 define(
'NOREQUIREHTML',
'1');
28if (!defined(
'NOREQUIREAJAX')) {
29 define(
'NOREQUIREAJAX',
'1');
31if (!defined(
'NOREQUIRESOC')) {
32 define(
'NOREQUIRESOC',
'1');
36require
'../../main.inc.php';
37require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductAttribute.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/variants/class/ProductAttributeValue.class.php';
42if (!isModEnabled(
'variants')) {
45if ($user->socid > 0) {
60 print json_encode(array(
61 'error' =>
'ID not set'
68if ($prodattr->fetch($id) < 0) {
69 print json_encode(array(
70 'error' =>
'Attribute not found'
77$res = $prodattrval->fetchAllByProductAttribute($id,
false, 1);
80 print json_encode(array(
81 'error' =>
'Internal error'
86print json_encode($res, JSON_PARTIAL_OUTPUT_ON_ERROR);
Class ProductAttribute Used to represent a product attribute.
Class ProductAttributeValue Used to represent a product attribute value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!defined( 'NOREQUIREMENU')) if(!empty(GETPOST('seteventmessages', 'alpha'))) if(!function_exists("llxHeader")) top_httphead($contenttype='text/html', $forcenocache=0)
Show HTTP header.
restrictedArea(User $user, $features, $object=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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.