Jump to content

J-B

Members
  • Content count

    65
  • Joined

  • Last visited

Community Reputation

11 Good

About J-B

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Yeah, this was the mistake! You are my hero 💪
  2. Hi @brian! thanks for your help, but your code dont work. I always see the Paypment "stripe". Have any idea why?
  3. I am not a programmer. Can you tell me how to do it?
  4. <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); use Illuminate\Database\Capsule\Manager as Capsule; function checkIfCanUseCC($vars) { global $_LANG; $errormsg = array(); $number_of_results = Capsule::table('tblinvoices')->where('userid', $_SESSION['userid'])->where('status', 'Paid')->count(); if ($number_of_results == 0 && $_SESSION['cart']['paymentmethod'] == "stripe") { $errormsg = $_LANG['firstpaymentnocc']; } return $errormsg; } add_hook('ShoppingCartValidateCheckout', 1, 'checkIfCanUseCC'); ?> Can anyone tell me why this hook sometimes works and sometimes not? On my dev it works fine, but customers say they can not pay even though they have more than 1 successful payments in the database. It the "ShoppingCartValidateCheckout" wrong to disable a payment on checkout? Or is it a Bug in WHMCS 7.5.2?
  5. This code is not working too. Zero Invoices is sending again to the customers. Any other solution?
  6. Hey @Kian thanks for your Support! I will try it.
  7. Hi, I have a hook (its not from me) that disable sending 0.00 invoices. <?php use Illuminate\Database\Capsule\Manager as Capsule; function disable_00_invoices($vars) { $email_template_name = $vars['messagename']; # Email template name being sent $relid = $vars['relid']; # Related ID it's being sent for - client ID, invoice ID, etc... //Checking for certain template name, if so - this is our case if ($email_template_name == "Invoice Created" || $email_template_name == "Invoice Payment Confirmation") { //getting total of the invoice $data = Capsule::table('tblinvoices')->where('id',$relid)->first(); //if it is equal to '0.00' we disable email sending if (isset($data->total) && $data->total == '0.00') $merge_fields['abortsend'] = true; } return $merge_fields; } add_hook("EmailPreSend",1,"disable_00_invoices"); ?> This hook works great, but it disable invoice that is paid via credit too. I have try ... if (isset($data->total) && $data->total == '0.00') && (isset($data->credit) && $data->credit == '0.00') But this code isnt working. Anyone a idea how I can disable only 0.00 total invoices and not invoices that is paid via credit?
  8. $_SESSION['cart']['paymentmethod'] is the solution 😵 Thanks, can be closed!
  9. $number_of_results = Capsule::table('tblinvoiceitems')->where('userid', $_SESSION['userid'])->where('invoiceid', '>', '1')->count(); if ($number_of_results == 0 && $paymentmethod == 'banktransfer' ) { But can anyone explain me why $paymentmethod is undefined? https://developers.whmcs.com/hooks-reference/shopping-cart/#shoppingcartvalidatecheckout the the doc is "paymentmethod string The selected payment method". Why is paymentmethod not the selected payment method? 🧐
  10. Hi, i am trying to create a Hook to disallow new customer to use Credit card Payment. So I think ShoppingCartValidateCheckout is the correct Hook for this. Can anyone help me how to put this in the hook: <?php use Illuminate\Database\Capsule\Manager as Capsule; function checkIfCanUseCC($vars){ ## No PHP Code if SELECT * FROM `tblinvoiceitems` WHERE `userid` = ($_SESSION['uid']) AND `invoiceid` = 0 { $paymentmethod == 'banktransfer' return array("Error: The payment method is not allowed for new customers!", "Please switch to another Payment"); } ## } add_hook('ShoppingCartValidateCheckout', 1, 'checkIfCanUseCC'); ?> Anyone a Idea how to set the "No PHP Code" to PHP?
  11. I used your solution for that. Thanks again! clientregister.tpl {if $accepttos} <div class="row"> <div class="col-md-12"> <div class="panel panel-danger tospanel"> <div class="panel-heading"> <h3 class="panel-title"><span class="fa fa-exclamation-triangle tosicon"></span> &nbsp; {$LANG.ordertos}</h3> </div> <div class="panel-body"> <div class="col-md-12"> <label class="checkbox"> <input type="checkbox" name="accepttos" class="accepttos"> {$LANG.ordertosagreement} <a href="{$tosurl}" target="_blank">{$LANG.ordertos}</a> <br /> <input type="checkbox" required name="gdprconsent" oninvalid="this.setCustomValidity('{$LANG.registerds}')" oninput="setCustomValidity('')"> {$LANG.orderdsagreement} </label> </div> </div> </div> </div> </div> {/if}
  12. The Federal Data Protection Act (that is the link that you have post) is not the EU General Data Protection Regulation!
  13. Hi @othellotech, my english is not the best, but my german is perfect I take my informationen only from german Sites, now I explain you what is written in german Blogs about the GDPR .... Translate this with Google. There is, if personal data stored in the database the explicit consent is needed. And with me it is that if someone writes me something, this is stored in the database (WHMCS Ticket System)! I live in Germany, so I'm teasing what is said in Germany, before I receive a warning. Every country seems to interpret the laws differently. Welcome to the EU
  14. Are you kidding me? I never said that I want to use a preticked box. I use a checkbox that the user is free to give (click the box or not, isnt preticked) me the consent. How do you want to do that? Bether ideas are welcome! I think I have solved it great.
×

Important Information

By using this site, you agree to our Terms of Use & Guidelines