Jump to content

Info from feeds being shown beneath all HTML


keenooooo

Recommended Posts

I've been creating a WHMCS theme from scratch and have come across quite a few issues!

The first of which is... On the homepage:

https://my.hostnomad.com/?systpl=pan

If you scroll to the very bottom, you can see that for some reason the information that I am pulling from WHMCS feeds is being shown at the very bottom of the page! When I try to inspect it, nothing shows up.

Any idea how to stop this happening?

Also, on this page you can see the "Powered by WHMCompleteSolution" even though I have paid for the removal. (Proof at https://my.hostnomad.com)

Any ideas why this occurs?

Thanks in advance!

Link to comment
Share on other sites

1 hour ago, keenooooo said:

Any idea how to stop this happening?

I think it's the Owl Carousel script - I answered a similar question earlier in the year...

1 hour ago, keenooooo said:

Also, on this page you can see the "Powered by WHMCompleteSolution" even though I have paid for the removal.

you might need to re-issue the license for the removal to become active.

also, in your header, the BASE CSS and custom.css links are called twice - doesn't really matter, but thought it worth mentioning...

RyDqkRh.png

 

Link to comment
Share on other sites

Thank you SO much for this brian! It is 100% the Owl Carousel and I'm going to try and figure out a way of getting round that. Potentially just going to hardcode it for the time being as it's only for the prices and descriptions of specific products and they don't change often.

And thank you again for the heads up for the repeated code. Not sure how I missed that! 

Regarding ""Powered by WHMCompleteSolution"", I've had the license for years and it doesn't show up on all other templates! Strange.

Link to comment
Share on other sites

23 hours ago, keenooooo said:

Thank you SO much for this brian! It is 100% the Owl Carousel and I'm going to try and figure out a way of getting round that.

as the OP reported in the thread, I think it can use feeds without issue - you just need to tweak the carousel settings.

23 hours ago, keenooooo said:

Potentially just going to hardcode it for the time being as it's only for the prices and descriptions of specific products and they don't change often. 

you could use an action hook to get the current details from the database - it's not a million miles away from the one in the above thread, except it's finding products and not domains...

<?php

use Illuminate\Database\Capsule\Manager as Capsule;

function homepage_products_hook($vars)
{
	$products = Capsule::table('tblproducts')
		->join('tblpricing', 'tblproducts.id', '=', 'tblpricing.relid')
		->where('tblpricing.type', 'product')
		->where('tblproducts.hidden','0')
		->where('tblproducts.gid','1')	
		->select('tblproducts.id','tblproducts.name','tblproducts.description','tblpricing.monthly')
		->orderBy('tblproducts.order')						
		->groupBy('tblproducts.id')
		->get();
	$results = json_decode(json_encode($products), true);
	return array("myproducts" => $results);
}
add_hook("ClientAreaPageHome", 1, "homepage_products_hook");
?>

that will give you an array of products ($myproducts) on the homepage that are: in Product Group 1 and not hidden and the array will contain 4 fields - Product ID, Product Name, Product Description, Monthly Price... as per the domain hook, instead of just taking all products from a certain product group, you could give it a list of Product IDs and use that instead.

with that array, you could then generate your carousel output in a foreach loop, or access each field individually... e.g the first result elements could be directly accessed using the following for name, desc and price...

{$myproducts[0].name}
{$myproducts[0].description}
{$myproducts[0].monthly}

.. and for the second result, you would change the 0 to 1 and so on.

also, the monthly price won't be currency formatted - you could do that in the hook if you wanted to, but as I assume you're only using one currency, you might as well just add a pound sign before the price.

Just £{$myproducts[0].monthly} per month
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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