which table save Downloadable-Product link and sample-title
-
14-04-2021 - |
Solution
This three are Set as an Attributes
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
$this->_productCollectionFactory = $productCollectionFactory;
public function getlinktitle($productId)
{
$collection = $this->_productCollectionFactory->create();
$collection->addAttributeToSelect('*');
$collection->addAttributeToFilter('entity_id',$productId);
foreach($collection as $product)
{
$attributes = $product->getAttributes();
foreach ($attributes as $attribute) {
if($attribute->getAttributeCode()=='links_title')
{
$attribute_title['link']=$attribute->getFrontend()->getValue($product);
}
if($attribute->getAttributeCode()=='samples_title')
{
$attribute_title['sample']=$attribute->getFrontend()->getValue($product);
}
if($attribute->getAttributeCode()=='links_purchased_separately')
{
$attribute_title['seprate']=$attribute->getFrontend()->getValue($product);
}
}
}
return $attribute_title;
}
OTHER TIPS
Basically product stores in catalog_product_entity table and its type_id = downloadable
Its follow the eav structure so below is the details where url and other details stored.
- url link stored in downloadable_link table with reference to product_id
- And its price stored in downloadable_link_price table
- its title stored in downloadable_link_title table
- its sample stored in downloadable_sample table.
Value is stored in table catalog_product_entity_int with attribute ID 125. You can check attribute ID from table eav_attribute`
SELECT * FROM catalog_product_entity_int
WHERE attribute_id
='125'
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange