Jump to content

silidrone

Member
  • Posts

    4
  • Joined

  • Last visited

About silidrone

silidrone's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. Hi, Yes indeed I only have USD and I decided to go with the language overriding as I am not using Setup Fees anywhere else in my WHMCS, now I am satisfied with how it looks, I do realize it's really hacky, but it does the job. Thank you for your help, have a great day!
  2. I figured out how to get product price by product id from the $vars object and thus wrote this code: <?php use WHMCS\Session; use WHMCS\Product; add_hook('OrderProductPricingOverride', 1, function($vars) { $pid = $vars['pid']; $command = 'GetProducts'; $postData = array( 'pid' => $pid, ); $result = localAPI($command, $postData); $price = $result['products']['product'][0]['pricing']['USD']['monthly']; return ['setup' => strval(-$price/2)]; }); Everything seems to be working but I am a bit disturbed by the fact that it says Setup Fee: -$... (where ... is the discount amount returned by my hook) in the configure order page, but I'm guessing that is not possible to change to First Month Discount or any text I would like. If it is though, I'd be happy to hear how. Thanks for helping me so far!
  3. Hi, First of all, thank you for trying to help me out! I see how the 1st option could be done, but I feel like it isnt flexible enough, so I decided to go with the 2nd option you provided, adding a hook. I added a hook in hooks.php, the file looks like (public/customers/modules/addons/hooks.php): <?php use WHMCS\Session; add_hook('OrderProductPricingOverride', 1, function($vars) { return ['setup' => '-5.00']; }); But the thing is, I want it to be 50% off, and the only way I can see this being done is somehow to access to current price of the product. Is that possible via the $vars object (array)? If I am doing anything wrong so far, please warn me.
  4. Hi, I am trying to provide my customers with 50% on specific products for lifetime with a specific coupon. Now, I also want to (disconnectedly of this) have 50% off for the first month on those specific products. So if my product costs $10 normally, for a customer with the lifetime discount coupon code, it would cost $2.5 first month and then $5 dollars for the rest of their life. How can I accomplish this? Usually I had 50% off first month as a coupon, and 50% for lifetime as a coupon as well, but I understand two coupons cannot be applied to one product. So is there a workaround to accomplish this?
  5. Welcome to WHMCS.Community silidrone! We're glad you're here please take some time to familiarise yourself with the Community Rules & Guidelines and take a moment to introduce yourself to other WHMCS.Community members in the Introduce Yourself Board.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated