Upgrade Coupons by Waindigo [Deleted]

Hi @Waindigo

Ok, I am a bit lost and dont seem to be able to get this to work - or perhaps dont understand what you have said above.

Here is what I want to do. We have 2 user upgrades on our site. 3 Month Premium for $5 and 12 Month Membership for $15. Members want to be able to gift these to friends. When the gift is received, the person receiving the gift agrees to the TOS and has the upgrade.

Here is what I tried to set up:

Coup 2.webp

Coupon 1.webp

However, no matter what combination of Allow Coupons or Gifts I cannot get the add-on to only allow these special gift order to only be purchased as gifts. You can purchase them as yourself as well which is a problem. See below:

Gift Error.webp

Am I doing something wrong? Should I be hiding the upgrade? Please let me know.

Thanks!
 
Last edited:
Hi @Waindigo

Ok, I am a bit lost and dont seem to be able to get this to work - or perhaps dont understand what you have said above.

Here is what I want to do. We have 2 user upgrades on our site. 3 Month Premium for $5 and 12 Month Membership for $15. Members want to be able to gift these to friends. When the gift is received, the person receiving the gift agrees to the TOS and has the upgrade.

Am I doing something wrong? Should I be hiding the upgrade? Please let me know.

Thanks!
I've added this for you now! Everything should work properly if you make your upgrades hidden. You can edit the template waindigo_account_upgrades_gift_upgradecoupons to show more information concerning these hidden upgrades on the confirmation screen.
 
Awesome work! Thats a brilliant update. Thanks!

Found a bug. Someone can go in and select the Gift Coupon for a upgrade, and it generates the coupon even if they didn't follow through with the purchase.

I did this twice, and both times it created a coupon:

upload_2014-5-8_19-43-31.webp

Also I am getting tons of these in the logs now - its a user adding to their current active subscription to lengthen it.

Zend_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Duplicate entry '7865-26' for key 'user_id_upgrade_id' - library/Zend/Db/Statement/Mysqli.php:214
Generated By: Unknown Account, A moment ago
Stack Trace
#0 /hackersadvantage/forums/library/Zend/Db/Statement.php(297): Zend_Db_Statement_Mysqli->_execute(Array)
#1 /hackersadvantage/forums/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#2 /hackersadvantage/forums/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
#3 /hackersadvantage/forums/library/XenForo/Model/UserUpgrade.php(493): Zend_Db_Adapter_Abstract->insert('xf_user_upgrade...', Array)
#4 /hackersadvantage/forums/library/Waindigo/UserUpgrades/Extend/XenForo/Model/UserUpgrade.php(289): XenForo_Model_UserUpgrade->upgradeUser(7865, Array, false, NULL)
#5 /hackersadvantage/forums/library/Waindigo/UpgradeCoupons/Extend/XenForo/Model/UserUpgrade.php(236): Waindigo_UserUpgrades_Extend_XenForo_Model_UserUpgrade->upgradeUser(7865, Array, false, NULL)
#6 /hackersadvantage/forums/library/XenForo/UserUpgradeProcessor/PayPal.php(297): Waindigo_UpgradeCoupons_Extend_XenForo_Model_UserUpgrade->upgradeUser(7865, Array, false)
#7 /hackersadvantage/forums/payment_callback.php(37): XenForo_UserUpgradeProcessor_PayPal->processTransaction()
#8 {main}
Request State
array(3) {
["url"] => string(59) "http://www.hackersadvantage.net/forums/payment_callback.php"
["_GET"] => array(0) {
}
["_POST"] => array(32) {
["transaction_subject"] => string(70) "7865,26,token,7865,1399641696,8e51e10fd812b3992e44e33735562e2e4e3328a8"
["payment_date"] => string(25) "06:21:52 May 09, 2014 PDT"
["txn_type"] => string(10) "web_accept"
["last_name"] => string(5) "Mills"
["residence_country"] => string(2) "AU"
["item_name"] => string(24) "Battlefield 4 Simple Aim"
["payment_gross"] => string(5) "12.00"
["mc_currency"] => string(3) "USD"
["business"] => string(18) "rac@rentacheat.com"
["payment_type"] => string(7) "instant"
["protection_eligibility"] => string(10) "Ineligible"
["verify_sign"] => string(56) "AdIsxhauFIpwsCaa9QXKV7cNjGxgAV0tSE.5.kiUFrjXm5.Y9O-fZscG"
["payer_status"] => string(8) "verified"
["tax"] => string(4) "0.00"
["payer_email"] => string(21) "blahblah@ozemail.com.au"
["txn_id"] => string(17) "83Y5555321253070M"
["quantity"] => string(1) "1"
["receiver_email"] => string(18) "rac@rentacheat.com"
["first_name"] => string(6) "Robert"
["payer_id"] => string(13) "9Q4TCMY5ASTSQ"
["receiver_id"] => string(13) "XVNYDR4M5UEGC"
["item_number"] => string(0) ""
["handling_amount"] => string(4) "0.00"
["payment_status"] => string(9) "Completed"
["payment_fee"] => string(4) "0.77"
["mc_fee"] => string(4) "0.77"
["shipping"] => string(4) "0.00"
["mc_gross"] => string(5) "12.00"
["custom"] => string(70) "7865,26,token,7865,1399641696,8e51e10fd812b3992e44e33735562e2e4e3328a8"
["charset"] => string(12) "windows-1252"
["notify_version"] => string(3) "3.8"
["ipn_track_id"] => string(13) "2927d0fe39ece"
}
}



Somewhere in the future can you include a "Generate Coupon Key" button on the create coupon form - I am having to go to a external site generate a key, and copy and paste it :) I know it seems trivial but when you generate 10 of them at a time.

Thanks,

Koz
 
Last edited:
Awesome work! Thats a brilliant update. Thanks!

Found a bug. Someone can go in and select the Gift Coupon for a upgrade, and it generates the coupon even if they didn't follow through with the purchase.

I did this twice, and both times it created a coupon:
This is just part of the design and is the main reason for why there is a delete button in the ACP log section. This also means that if a user creates the coupon, doesn't purchase the gift upgrade and goes back and purchases the regular upgrade they will end up with the gift coupon. This is funny because they then have to use the coupon to get the upgrade. :) I am looking into ways to get around this but for the minute I am happy that it works.
Somewhere in the future can you include a "Generate Coupon Key" button on the create coupon form - I am having to go to a external site generate a key, and copy and paste it :) I know it seems trivial but when you generate 10 of them at a time.
This would be a nice feature to add, if anyone donates to further develop this add-on I will add it ;) For the minute I just hit random keys on the keyboard, takes a second and is random enough :LOL:

I am looking into the bug you have posted as well.
 
The TOS agreement step is missing for the user receiving the gift when full add-ons are gifted (free coupons?). Any ETA when the step will be added? Can't use the upgrade without this step. Thanks!
 
The TOS agreement step is missing for the user receiving the gift when full add-ons are gifted (free coupons?). Any ETA when the step will be added? Can't use the upgrade without this step. Thanks!
I am working on adding this at the moment.
 
Hi,

Me again :(

I get this error if you hit "save" on a gift that is blank.

Server Error
Argument 1 passed to Waindigo_UserUpgrades_Extend_XenForo_Model_UserUpgrade::prepareUserUpgrade() must be of the type array, boolean given, called in /hackersadvantage/forums/library/Waindigo/UpgradeCoupons/Extend/XenForo/ControllerPublic/Account.php on line 171 and defined

  1. XenForo_Application::handlePhpError() in Waindigo/UserUpgrades/Extend/XenForo/Model/UserUpgrade.php at line 168
  2. Waindigo_UserUpgrades_Extend_XenForo_Model_UserUpgrade->prepareUserUpgrade() in Waindigo/UpgradeCoupons/Extend/XenForo/ControllerPublic/Account.php at line 171
  3. Waindigo_UpgradeCoupons_Extend_XenForo_ControllerPublic_Account->actionGift() in XenForo/FrontController.php at line 347
  4. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  5. XenForo_FrontController->run() in /hackersadvantage/forums/index.php at line 1

Server Error
Argument 1 passed to Waindigo_UserUpgrades_Extend_XenForo_Model_UserUpgrade::prepareUserUpgrade() must be of the type array, boolean given, called in /hackersadvantage/forums/library/Waindigo/UpgradeCoupons/Extend/XenForo/ControllerPublic/Account.php on line 171 and defined




    • XenForo_Application::handlePhpError() in Waindigo/UserUpgrades/Extend/XenForo/Model/UserUpgrade.php at line 168
    • Waindigo_UserUpgrades_Extend_XenForo_Model_UserUpgrade->prepareUserUpgrade() in Waindigo/UpgradeCoupons/Extend/XenForo/ControllerPublic/Account.php at line 171
    • Waindigo_UpgradeCoupons_Extend_XenForo_ControllerPublic_Account->actionGift() in XenForo/FrontController.php at line 347
    • XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    • XenForo_FrontController->run() in /hackersadvantage/forums/index.php at line 13
 
Has anyone actually had a user buy and use a gift coupon?

I just had one - the user bought two coupons for the same subscription, tried to use one, it shows this:

B4rKypR.png


Then when he clicks purchase, it gives a blank screen with nothing:

upload_2014-5-15_16-36-42.webp
 
TOS step for free coupon still not working for me at this point. When trying to redeem - account screen is blank as well.
 
Thanks that did fix the issue.

I just found another and not sure if it is with user upgrades, the coupons or the combination of both.

Anyway here is the issue. There is something off with the gifting options. I see 3 options for gifts when there should only be 2. One of the options for upgrades is listed as a gift incorrectly.

See shot:

gift 4.webp

This is not set for a gift purchase yet it appears as one.

gift 2.webp
gift 3.webp

Same as previous post: I have 2 hidden gifts upgrades and 2 regular upgrades:

gift 1.webp
Only the gift upgrades have the gift listed but the 3 month shows up. The account used for 1st shot has a 3 month membership - (it may have been gifted but I cant remember been testing this so many different ways).

Hope this helps.

Thanks!
 
Top Bottom