Skip to main content
added 3 characters in body
Source Link

You might need to extend ProductInterface and add the getters and setters there for the full product link, then you need to extend the actual product model to implement that interface and prepare those methods.

namespace Company\Module\Api\Data;

interface ProductInterface extends \Magento\Catalog\Api\Data\ProductInterface{
    public function getFullProductLink();
    public function setFullProductLink($productLink);
}
namespace Company\Module\Model;

class Product extends \Magento\Sales\Model\Order\Invoice\Magento\Catalog\Model\Product implements \Company\Module\Api\Data\ProductInterface
{
    public function setStoreCredit($customerBalanceAmount)
    {
        // logic to set the full product link
    }

    public function getFullProductLink() {
        // logic to return the full product link
    }
}

Hope this helps :)

edit: Used the wrong model

You might need to extend ProductInterface and add the getters and setters there for the full product link, then you need to extend the actual product model to implement that interface and prepare those methods.

namespace Company\Module\Api\Data;

interface ProductInterface extends \Magento\Catalog\Api\Data\ProductInterface{
    public function getFullProductLink();
    public function setFullProductLink($productLink);
}
namespace Company\Module\Model;

class  extends \Magento\Sales\Model\Order\Invoice implements \Company\Module\Api\Data\ProductInterface
{
    public function setStoreCredit($customerBalanceAmount)
    {
        // logic to set the full product link
    }

    public function getFullProductLink() {
        // logic to return the full product link
    }
}

Hope this helps :)

You might need to extend ProductInterface and add the getters and setters there for the full product link, then you need to extend the actual product model to implement that interface and prepare those methods.

namespace Company\Module\Api\Data;

interface ProductInterface extends \Magento\Catalog\Api\Data\ProductInterface{
    public function getFullProductLink();
    public function setFullProductLink($productLink);
}
namespace Company\Module\Model;

class Product extends \Magento\Catalog\Model\Product implements \Company\Module\Api\Data\ProductInterface
{
    public function setStoreCredit($customerBalanceAmount)
    {
        // logic to set the full product link
    }

    public function getFullProductLink() {
        // logic to return the full product link
    }
}

Hope this helps :)

edit: Used the wrong model

Source Link

You might need to extend ProductInterface and add the getters and setters there for the full product link, then you need to extend the actual product model to implement that interface and prepare those methods.

namespace Company\Module\Api\Data;

interface ProductInterface extends \Magento\Catalog\Api\Data\ProductInterface{
    public function getFullProductLink();
    public function setFullProductLink($productLink);
}
namespace Company\Module\Model;

class  extends \Magento\Sales\Model\Order\Invoice implements \Company\Module\Api\Data\ProductInterface
{
    public function setStoreCredit($customerBalanceAmount)
    {
        // logic to set the full product link
    }

    public function getFullProductLink() {
        // logic to return the full product link
    }
}

Hope this helps :)