WemXPro / tracker

This repository is made to track bugs and suggestions in WemX
8 stars 4 forks source link

[Future Request] Coupons Accepting Affiliate Codes in the same box. #433

Open VanillaChan6571 opened 2 months ago

VanillaChan6571 commented 2 months ago

Describe the solution you'd like

Coupons "textbox" to accept Affiliate Codes as well.

Describe alternatives you've considered

Modifying the following to allow the coupon text box allow affiliate codes:

Payment.php -> /var/www/wemx/app/Models/Payment.php

StoreController.php -> /var/www/wemx/app/Http/Controllers/Client/StoreController.php

TebexGateway.php -> /var/www/wemx/app/Models/Gateways/TebexGateway.php

TebexSubscriptionGateway.php -> /var/www/wemx/app/Models/Gateways/TebexSubscriptionGateway.php

PayPalGateway.php -> /var/www/wemx/app/Models/Gateways/PayPalGateway.php

PayPalCheckoutGateway.php -> /var/www/wemx/app/Models/Gateways/PayPalCheckoutGateway.php

Maybe this could be adjusted later or maybe a simpler fix. This only supports and tested Tebex + PayPal, I have not modify the Other Gateways maybe later or maybe find a new method.

Prototype_Affiliate+Coupon_Support.zip

Additional context

Lines 204 in /var/www/wemx/resources/themes/client/"tailwind"(or some custom client theme)/store/packages/view.blade.php you can replace the placeholder text with this: placeholder="Enter a Coupon OR Affiliate Code here." name="coupon" value="{{ session('coupon_code') }}"

This changes the default "coupon" text in the box when at the checkout.

Some notes this changes. This has only tested on Default Balance, TebexGatewaySubscription and TebexGateway and have seemed to work for me.

The affiliate commission doesn't and never has worked for me. However this does seem to ACTUALLY give the affiliate the "commission" but does not add it to the "Purchase" nor there was ANY CODE to add a "Purchase" the only code in the affiliates are stuff like Clicks and Impressions but no "Purchases". This could be the fault of Affiliate Dashboard or the code being actually broken since the very beginning.

XceptDev commented 2 months ago

That would be super useful, people wonder how to use affiliate code. The same with addtional input box when registering a new account, and an option to change this later in account settings.