Jump to content

jmtech

Member
  • Posts

    9
  • Joined

  • Last visited

Everything posted by jmtech

  1. Hi all, Just thought I would update if anyone was interested. I decided to do it the other way round. I have my wordpress site as the main site and I load my Wordpress menu within WHMCS. I have then customised my WHMCS template to match my Wordpress site. Here's how I get my WHMCS menu to match my Wordpress menu. Basically I start by removing all the standard WHMCS menu items. Then I iterate through all the wordpress menu items and add them to WHMCS. // ----- Main Nav Bar ----- add_hook('ClientAreaNavbars', 1, function () { require("../pathToWordpress/wp-load.php"); $wpMenu = wp_get_nav_menu_items('Top Menu'); // Get the current navigation bars. $primaryNavbar = Menu::primaryNavbar(); $secondaryNavbar = Menu::secondaryNavbar(); // Remove unecessary menu items $primaryNavbar->removeChild('Announcements'); $primaryNavbar->removeChild('Knowledgebase'); $primaryNavbar->removeChild('Network Status'); $primaryNavbar->removeChild('Home'); $primaryNavbar->removeChild('Store'); $primaryNavbar->removeChild('Contact Us'); $order = 1; foreach($wpMenu as $item) { $primaryNavbar->addChild($item->title) ->setUri($item->url) ->setOrder($order); $order++; } }
  2. I took a different approach. I created a hook called navigation.php to change the WHMCS menu to have the Wordpress menu items. In my header.tpl I then just modified the style to match my Wordpress style. This is the safest option. add_hook('ClientAreaNavbars', 1, function () { // Load Wordpress can get the menu itmes require("../jmtech/wp-load.php"); $wpMenu = wp_get_nav_menu_items('Top Menu'); // Get the current navigation bars. $primaryNavbar = Menu::primaryNavbar(); $secondaryNavbar = Menu::secondaryNavbar(); // Remove unecessary menu items from WHMCS $primaryNavbar->removeChild('Announcements'); $primaryNavbar->removeChild('Knowledgebase'); $primaryNavbar->removeChild('Network Status'); $primaryNavbar->removeChild('Home'); $primaryNavbar->removeChild('Store'); $primaryNavbar->removeChild('Contact Us'); // Keep menu in order $order = 1; // Add a WHMCS menu for each Wordpress menu foreach($wpMenu as $item) { $primaryNavbar->addChild($item->title) ->setUri($item->url) ->setOrder($order); $order++; } }
  3. The important thing here is to name the session and then define the scope of the cookie.
  4. I know this is quite old but I'm going to be doing something like this shortly so I thought I'd comment instead of starting a new thread. The reason you the variable is 0 is because session variables do not share across domains. I'll let you read up on why. My approach is to put my wordpress site at www.jmtech.com.au and my WHMCS at the subdomain of client.jmtech.com.au and then crate a hook or similar to create and update some variables that I will be able to use cross sub-domain using code similar to the below. session_name("2620368ghwahw90w"); session_set_cookie_params(0, '/', '.mydomain.com'); session_start(); I'll post an update when I've got it working. Cheers, Jason
  5. The best compromise I've found is creating a WHMCS theme that matches my Wordpress theme. Then in WHMCS, including wp-load.php and then iterating through the menu. This way the header, foot and menu are all consistent - with the menu being controlled in Wordpress. I'm about to deploy this, once I'm done I'll share the code. Cheers, Jason
  6. Yeah, I'm currently moving from using WHMCS as the main website to Wordpress and linking to WHMCS just for the Cart Path and Client Portal for exactly this reason.
  7. I'm currently accepting credit card orders from the website (running on WHMCS) and it works well. A visitor comes to the site, selects a product, proceeds to checkout, enters credit card details, the invoice is generated and paid immediately by credit card and the site is provisioned. In order to entice new customers, I want to offer a "no upfront payment, try free for 14 days". I am wanting the process to be one of the following. 1) A visitor comes to the site, selects a product, proceeds to checkout, enters credit card details and the site is provisioned. In 14 days the invoice is generated and paid automatically using the card details on file. or 2) A visitor comes to the site, selects a product, proceeds to checkout, enters credit card details, the invoice is generated with a due date 14 days in the future and the site is provisioned. After 14 days the invoice is automatically paid by credit card. I was thinking of the following approach for each option. 1) Add a PendingOrder hook to set the first payment amount to $0 and the NextDueDate to 14days from the Registration Date. I'm hoping this is run before the invoice is generated and thus doesn't charge immediately. I imagine a $0 invoice will likely be generated and marked as paid - which is ok. Then when the next due date comes up, an invoice should be generated with the full amount of the original order and then charged. This way, someone could purchase an annual hosting subscription, pay nothing upfront and then automatically be charged after 14 days. 2) Add a InvoiceCreationPreEmail hook to set the invoice due date to 14 days after the invoice date. what I want to know is, if I set this- for website orders through the cart part, will WHMCS charge the card immediately, or will it wait for the due date? There's not really any info on when the payment gateway is charged in relation to the hooks for an online order. Anyone done something similar or know the answers to the above questions? I'm a software engineer so have no issues creating all the above, I just need a little more info to avoid a lengthy trial and error process (if possible). Thanks a bunch in advance.
  8. Thanks for that - I'm quite familiar with using and customising the menu objects within WHMCS - however, I'm trying to get access to the object from within Wordpress (outside of WHMCS). Some options that I have. - Scrape the HTML from WHMCS. This would involve getting the HTML for the home page and searching for an element ID for the menu container and getting the inner HTML. - Include WHMCS in Wordpress. Given my wordpress install is in the same physical location as WHMCS, I could try and find and include the relevant PHP file/s to include to gain access to the menu objects from within Wordpress. - Create an Addon to expose the Menu. I could create an addon that presents the menu as a public JSON endpoint. - Manually replicate the menu. Given the menu doesn't change very often, I could just manually update it in Wordpress when it changes. - Control the menu from Wordpress. I've done this before - I could include wp_load.php in WHMCS and then dynamically generate the WHMCS menu based on the Wordpress menu. Anyone know what the equivalent of wp-load.php is for WHMCS? Would save me some time trying to figure it out, if it's at all possible. Cheers, Jason
  9. Hi all, I'm planning on using Wordpress for my KB and News articles and as such will be branding my Wordpress site the same as my WHMCS. I am planning on dynamically generating my Wordpress menu based on the WHMCS menu so I only need to update it in one place. The problem I have is enumerating through the list of menu items defined in WHMCS as there appears to be no API for Navigation. Any ideas on the best way to get this info out of WHMCS? Cheers, Jason
×
×
  • 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