Question

When i add/Edit downloadable Product, I Can't get Link and Sample-Title and Links can be purchased separately checkbox value.

I need details in which table it get saved/stored ? And how it is store ?enter image description here

Was it helpful?

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.

  1. url link stored in downloadable_link table with reference to product_id
  2. And its price stored in downloadable_link_price table
  3. its title stored in downloadable_link_title table
  4. 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
scroll top