Jump to content

Nathum

Members
  • Content count

    9
  • Joined

  • Last visited

Community Reputation

10 Good

About Nathum

  • Rank
    Member
  1. Modern Products Template MOD

    Thanks Brian
  2. I think this should be a permanent change to the template. Description: Add's Sold Out to products so customers don't have to see the out of stock page. Before After Edit /public_html/whmcs/templates/orderforms/modern/products.tpl Remove (Line 65-69) {if $product.qty} <span class="qty"> ({$product.qty} {$LANG.orderavailable}) </span> {/if} Replace <div class="text-right"> <a href="cart.php?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}" class="btn btn-success btn-lg"><i class="fa fa-shopping-cart"></i> {$LANG.ordernowbutton}</a> </div> </div> </div> With <div class="text-right"> <div class="name"> <span class="qty"><br> ({$product.qty} {$LANG.orderavailable}) </span> </div> <a href="cart.php?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}" class="btn btn-success btn-lg {if $product.qty lt '1'} btn-danger disabled{/if}"><i class="fa fa-shopping-cart"></i> {if $product.qty lt '1'} Sold Out{else}{$LANG.ordernowbutton} {/if}</a> </div> </div> </div>
  3. Sold Out Button

    Hi, I got sick of having Order Now on products that are sold out. So here is somecode I would like to share, hopefully WHMCS add it. Around Line 75 in \whmcs\templates\orderforms\modern <a href="cart.php?a=add&{if $product.bid}bid={$product.bid}{else}pid={$product.pid}{/if}" class="btn btn-success btn-lg {if $product.qty lt '1'} btn-danger disabled{/if}"><i class="fa fa-shopping-cart"></i> {if $product.qty lt '1'} Sold Out{else}{$LANG.ordernowbutton} {/if}</a> Screenshot
  4. Hi, I thought I would share that I managed to do this, and should help out others. The topic that did it for me. http://thereforei.am/2012/07/03/cancelling-subscriptions-created-with-paypal-standard-via-the-express-checkout-api/ So in the module I created under the function terminate. I used the API to get the product details of the service. This gave me the subscription ID. I then run the PayPal function which terminated the subscription. //// SUSPEND PAYPAL PAYMENTS //// $command = "getclientsproducts"; $adminuser = "whmusername"; $values["clientid"] = $params['clientsdetails']['userid']; $values["serviceid"] = $params["serviceid"]; $values["responsetype"] = "xml"; $PRODUCTARRAY = localAPI($command,$values,$adminuser); $SUBSCRIPTIONID = $PRODUCTARRAY[products][product][0]['subscriptionid']; change_subscription_status( $SUBSCRIPTIONID, 'Cancel' ); //// SUSPEND PAYPAL PAYMENTS //// PayPal Function /** * Performs an Express Checkout NVP API operation as passed in $action. * * Although the PayPal Standard API provides no facility for cancelling a subscription, the PayPal * Express Checkout NVP API can be used. */ function change_subscription_status( $profile_id, $action ) { $api_request = 'USER=' . urlencode( 'api_username' ) . '&PWD=' . urlencode( 'api_password' ) . '&SIGNATURE=' . urlencode( 'api_signature' ) . '&VERSION=76.0' . '&METHOD=ManageRecurringPaymentsProfileStatus' . '&PROFILEID=' . urlencode( $profile_id ) . '&ACTION=' . urlencode( $action ) . '&NOTE=' . urlencode( 'Profile cancelled at store' ); $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, 'https://api-3t.sandbox.paypal.com/nvp' ); // For live transactions, change to 'https://api-3t.paypal.com/nvp' curl_setopt( $ch, CURLOPT_VERBOSE, 1 ); // Uncomment these to turn off server and peer verification // curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, FALSE ); // curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, FALSE ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_POST, 1 ); // Set the API parameters for this transaction curl_setopt( $ch, CURLOPT_POSTFIELDS, $api_request ); // Request response from PayPal $response = curl_exec( $ch ); // If no response was received from PayPal there is no point parsing the response if( ! $response ) die( 'Calling PayPal to change_subscription_status failed: ' . curl_error( $ch ) . '(' . curl_errno( $ch ) . ')' ); curl_close( $ch ); // An associative array is more usable than a parameter string parse_str( $response, $parsed_response ); return $parsed_response; } Hope this helps and saves plenty of time and $$$ Feel free to improve it. Like if subcription == ' ' Enjoy
  5. Spam Account Keeps Registering

    Today I noticed that someone tried to exploit WHMCS using a SQL query. I am running version Version: 5.3.10 Am I protected against this? /http://upload.adfteam.com/files/1419490208.jpg /http://upload.adfteam.com/files/1419490233.jpg /http://upload.adfteam.com/files/1419490260.jpg Thanks
  6. Change Password Function

    Hi, I am writing the change password function. However I need to retrieve the current password and new entered password to perform my code. I believe $params['password'] will display the current password until $success is true. What I need to do is provide in my code the new password before successful. function template_ChangePassword($params) { # Code to perform action goes here... if ($successful) { $result = "success"; } else { $result = "Error Message Goes Here..."; } return $result; } Nathum
  7. Hi, Sorry but I could not reply to this topic. http://forum.whmcs.com/showthread.php?29969-WHM-Import-amp-Orders I have the same issue, I imported WHM accounts but unable to see a web hosting order for them OrderID# 0 I have setup the dates for the client and when an invoice is next due. However the invoice was never created and sent out. I would like to see orders for the products that had been imported. Thanks Nathum.
  8. Header Solution Wordpress/blablabla

    As for the footer.tpl Which was more tricky. I replaced.... <div class="whmcscontainer"> <div class="footer"> <div id="copyright">{$LANG.copyright} © {$date_year} {$companyname}. {$LANG.allrightsreserved}.</div> {if $langchange}<div id="languagechooser">{$setlanguage}</div>{/if} <div class="clear"></div> </div> </div> {php} $headerstring = file_get_contents('http://www.clanhost.com.au/index.php', true); $headerscripts = substr($headerstring, 0, strpos( $headerstring, '<div id="header">')); $footer = strstr($headerstring, '<div class="outer footsy">'); echo $headerscripts . " " . $footer; {/php} Let me explain. I needed the java/scripts from my site so line 1 puts the site into a string. Line 2 remove anything before <div id="header"> so all I get are the scripts. Line 3 removes anything before the footer div so all I get is the footer. Then I simply echo the scripts and then the footer Nathum
  9. Hi, After pointless hours of reading through the forums, google and plugins that won't work without bugs. I have figured out a way to implement the header from wordpress into WHMCS. This is a little dirty but it works with one fault which maybe someone could come up with a solution. Ok so 1st Open your theme's header.tpl file. Remove.... <div id="whmcsheader"> <div class="whmcscontainer"> <div id="whmcstxtlogo"><a href="index.php">{$companyname}</a></div> <div id="whmcsimglogo"><a href="index.php"><img src="templates/{$template}/img/whmcslogo.png" alt="{$companyname}" /></a></div> </div> </div> Insert.... {php} $header = file_get_contents('http://www.clanhost.com.au/index.php', true); $header = substr($header, 0, strpos( $header, '<div class="outer planner">')); echo $header; {/php} So basically what this does.... Downloads your website's front page into a string $header Finds the line in your front pages html <div class="outer planner"> and deletes everything after. Then echo everything from the start of your code to the next <div>. The only downside... Which I am unable to figure out yet is, the div layer sits behind WHMCS so drop down menus appear behind WHMCS. Anyway that's my solution to the header that works flawlessly almost. Nathum - - - Updated - - - I figured out the the bug, Place the {php} code after <div class="navbar navbar-fixed-top">
×

Important Information

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