How to change OnTriggerEnter to Ui Button click

Hello, Im trying to make shop system with inventory (using Invector). Invvector has a code wich adds items into your inventory, but that code is based on OnTriggerEnter(). I want to make that code to work, when i press Buy button in my shop. I tried to do OnMouseDown(), but that didnt worked. Please, can you help me?

using UnityEngine;
using System.Collections;
using Invector.ItemManager;

public class vAddItemByID : MonoBehaviour
public int id, amount;
public bool autoEquip;
public bool destroyAfter;

    void OnTriggerEnter(Collider other)
        if (other.gameObject.CompareTag("Player"))
            var itemManager = other.gameObject.GetComponent<vItemManager>();
            if (itemManager)
                var reference = new ItemReference(id);
                reference.amount = amount;
                reference.autoEquip = autoEquip;
            if (destroyAfter) Destroy(gameObject);


Create a public function in the same script that calls OnTriggerEnter. In your UI Button reference the script in the OnClick event and choose the new public function