Any ecommerce script with referral codes and payouts?

Can you please recommend an ecommerce PHP script that has all basic ecommerce features along with the facility to track referral codes and ability to set referral commission and weekly payouts?

This sounds more like SASS or some other combination of tools rather than just a PHP script.