Remove the empty dispenser bottle from its usual spot if it is designed to lift out. Measure the usable depth from the neck to the bottom.
Bring the old pump or a clear photo of its collar. A tube long enough for the bottle is only useful if the pump also screws on securely.
Ask, “Can this tube be trimmed for my bottle, and does the collar match?” Test with a small amount of soap before filling the bottle.