Jump to content

stickyn1

Member
  • Posts

    4
  • Joined

  • Last visited

About stickyn1

Recent Profile Visitors

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

stickyn1's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. GOTO setup > Product/Services > Product Bundles. Here you can bundle your items together "packages".
  2. ALL I NEED IS: Someone to look at my (if, else if) statements. The code works except after the first IF statement. It WILL install, and communicate with the installatron. It will install my custom package if divi is selected. However if a user selects "Extra, or theme3" the values are not read, and nothing but the default package is installed. if($vars["params"]["customfields"]["Theme"] === "divi") { $contentid = "2wzimd6mgticcg4osc0sgk04g"; } else if($vars["params"]["customfields"]["Theme"] === "extra") { $contentid = "2wzimd6mgticcg4osc0sgk04g"; } else if($vars["params"]["customfields"]["Theme"] === "theme3") { $contentid = "cso44k8ym1s0s8kk02vnrxgo4"; } else { return; }
  3. Having a problem with custom query links in new updated WHMCS not BETA! Ultimately the site needs to send a query to the custom field named "Theme", choices so far are: divi, extra, theme3 a user shops images of themes that he/she will have setup through automation. Once the user selects a theme, and hits the START TODAY button the link has a query built in it. http://demo.whmcs.com/cart.php?a=add&pid=5&cf_Theme=extra this query should auto populate the "Drop Down" box with the value "extra". it does not.. Now the user is faced with the Domain picker, and after that will be the Configuration page. ----MAYBE THE DOMAIN PICKER IS THE PROBLEM?---"I tried it without domain picker, don't work" On the configuration page is the DROP DOWN box with three choices. (divi, extra, theme3) the query was supposed to fill in the drop down box. This is where the link changes on me above in the address bar. EVEN if i disable the domain option on checkout I still get the new URL below: https://www.blahblah.com/clients/cart.php?a=confproduct&i=30 I am trying to figure out what i did wrong with the query link. There is a possibility that it could be another field name. I looked at the source, and tried the following:cf_customfield29 https://www.blahblah.com/clients/cart.php?a=add&pid=2&cf_customfield29=extra ---THIS WAY DID NOT WORK EITHER--- SOURCE CODE OF CUSTOM FIELD: <select class="form-control" id="customfield29" name="customfield[29]"><option value="divi">divi</option><option value=" extra"> extra</option><option value=" theme3"> theme3</option></select> PLEASE: post example working codes. Maybe thinking of writting another hook, or function to populate. Not sure what to do. SIDE NOTE: this style of linking works fine: http://demo.whmcs.com/cart.php?a=add&pid=1&configoption[1]=100 However i have a custom hook that ties into the "customfields", and i do not know how to code my hook to use configurable option instead of custom fields. You may have a look at what code i am referring too here: https://forum.whmcs.com/showthread.php?118434-WHMCS-automation-using-installatron-code-kinda-works
  4. I have some code that does not work, I think i may of wrote it wrong. The below codes are hooks inside the WHMCS hooks folder. It tells the installatron "one click app installer" to install a pre-built WordPress theme by using the templates ID. The code also imports over usernames, passwords, and site title. The above code works great, however it stops working after the first "IF". it will install with option "divi" selected. any other options it will not install anything. The first section below works great. if($vars["params"]["customfields"]["Theme"] === "divi") { $contentid = "2wzimd6mgticcg4osc0sgk04g"; } The second section with value of "=="extra" and "theme3 does not work. <?php function installatron_autoinstall($vars) { // Exit if a hosting account is not being provisioned. We don't want to be here! if ( $vars["params"]["type"] !== "hostingaccount" ) { return; } //CODE BELOW: Adds hosting pacakges ie...1,2,3...from the WHM //if(intval($vars["params"]["packageid"]) !== 2){ // return; //} //Below we are selecting a pre-built wordpress theme with the content ID //found in the installatron admin settings. This template ID is at the end of the .appdata string under //files & tables if($vars["params"]["customfields"]["Theme"] === "divi") { $contentid = "2wzimd6mgticcg4osc0sgk04g"; } else if($vars["params"]["customfields"]["Theme"] === "extra") { $contentid = "2wzimd6mgticcg4osc0sgk04g"; } else if($vars["params"]["customfields"]["Theme"] === "theme3") { $contentid = "cso44k8ym1s0s8kk02vnrxgo4"; } else { return; } $query = array( "cmd" => "install", "background" => "yes",//execute as a background process "application" => "wordpress", "url" => "http://".$vars["params"]["domain"], "login" => $vars["params"]["customfields"]["Username"],//custom field in WHMCS "Verbatim" "passwd" => $vars["params"]["customfields"]["Password"],//custom field in WHMCS "Verbatim" "sitetitle" => $vars["params"]["customfields"]["Title"],//custom field in WHMCS "Verbatim" "content" => $contentid,//matches custom ID above which tells wordpredd what to install ); $response = _installatron_call_v2($vars, $query); if ( $response["result"] === false ) { error_log("Installatron API Error: ".var_export($response,true)."\nRequest: ".var_export($vars["params"],true), 3, "/tmp/whmcs_installatron_error_log"); return; } // Success! //echo $response["message"]; } add_hook("AfterModuleCreate", 9, "installatron_autoinstall"); ?>
×
×
  • 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