I want to set one string value to sizes attribute in drop-down ?
//get sage dimension value
$dimension = $value->Dimensions;
//set value
$product->setStoreIds(array(0,1));
$product->setWebsiteIds(array(1));
$inStock = 1;
$product->setSku($product_sku);
$product->setName($finalpname);
$product->setAttributeSetId(4);
$product->setTypeId('simple');
$product->setStockData(
array(
'use_config_manage_stock' => 0,
'manage_stock' => 1,
'is_in_stock' => $inStock,
'qty' => $minqty
)
);
//set dimension value to sizes dropdown attribute
$product->setSizes($dimension);
$product->save();
Below attribute not set in drop-down.
$product->setSizes($dimension);
Any idea, how can I set dimension value in sizes attribute?
output:-
Actual Output:-
$dimension
value. Please add the array