Jump to content

disable View Button when cart is empty


adamjedgar

Recommended Posts

hi guys,

In whmcs , in my opinion, the "View Cart" button should be invisible unless the cart actually has something in it.

Apparently this is some thing that tech support have said to me is a customisation they cannot help me with.

What do i need to do to whmcs in order to make it so? (my assumption is, i will need to decompile the software, edit the relevant code and recompile it again?)

 

kind regards

Adam

Link to comment
Share on other sites

Hi Adam,

9 hours ago, adamjedgar said:

Apparently this is some thing that tech support have said to me is a customisation they cannot help me with.

aaahh - Support have their three standard replies depending on the situation...

  1. if it's a customisation, they'll send you here to the Community.
  2. if it's a new feature, they'll forward you to requests.whmcs.com - a place where new ideas go to die... or occasionally finally get resurrected after 5 years development time.
  3. if it's a bug, they may slowly admit to it, but will be unable to give you an ETA on a solution - so that could be days if it's a hotfix-able issue... or months until the next maintenance release... or completely forgotten about and never resolved.
9 hours ago, adamjedgar said:

What do i need to do to whmcs in order to make it so? (my assumption is, i will need to decompile the software, edit the relevant code and recompile it again?)

thankfully, nothing so drastic - though good luck decompiling 8,500 files (most encoded), altering the code and recompiling again.... I shudder at the thought! headshake.gif

with regards to the button, that's in /templates/six (or custom)/header.tpl

<li class="primary-action">
	<a href="{$WEB_ROOT}/cart.php?a=view" class="btn">
		{$LANG.viewcart}
	</a>
</li>

to make that button visibility conditional on there being items in the cart, just wrap it in an if statement...

{if $numitemsincart gt 0}
	<li class="primary-action">
		<a href="{$WEB_ROOT}/cart.php?a=view" class="btn">
			{$LANG.viewcart}
		</a>
	</li>
{/if}

 

Link to comment
Share on other sites

thanks, Brian...this gives me a place to start.

What I don't understand about all of this, considering this is what I would have thought is a basic function that all shopping carts should have, why isn't it programmed into the interface by default? (for example, a checkbox in the admin area that allows us to turn it on or off)

I am surprised that a platform that is considered a market leader should be missing things like this. 

I am also surprised that a platform that is considered a market leader, and therefore i make the assumption it turns over tens of millions of dollars per year, has one of the crappiest series of template choices I have ever seen. To say the default theme was designed would be an overstatement...it looks like something that fell out of the back of a horses ass. Even a lot of the third party ones are complete and utter rot (i use the term rot because they are worse than rubbish).

Please don't take the criticisms above the wrong way...as a non-programmer, mechanically, for the most part, I am very happy with whmcs , however, considering we pay monthly for it, the revenue we generate should produce a complete product (including the client interface) and I am deeply disappointed with the lack of transparency and quality of the third party templates I have found in the whmcs marketplace thus far. This leaves people like me between a rock and a hard place.

As someone who spends quite a deal of time with Wordpress, I am exposed to good and bad template interfaces. Anyone who has used Avada, for example, will understand what I mean.

I am considering a Zomex theme for example. Anyone got any thoughts on best template to buy?

Edited by adamjedgar
Link to comment
Share on other sites

Hi Adam,

17 hours ago, adamjedgar said:

What I don't understand about all of this, considering this is what I would have thought is a basic function that all shopping carts should have, why isn't it programmed into the interface by default? (for example, a checkbox in the admin area that allows us to turn it on or off)

going from memory, I think it's only been asked less than a handful of times in the 5+ years that i've been here... as to why it's not there by default, i've no idea... going back to v5, the option wasn't in that version either, so I doubt that it's ever been an option.... though as you can see by the above code, it would be simple for them to add it.

... and getting the developers to add a checkbox option to do anything in the admin area is a fruitless task.... there are lots of basic features that the carts are missing, though you'll probably see more than I would because i've become too accustomed to the WHMCS carts and their weirdly missing features... WHMCS response would probably be that because the user can tweak a feature themselves (via template edit, hook, css whatever), then adding another checkbox to the admin area gets a lower priority in terms of development.

17 hours ago, adamjedgar said:

I am surprised that a platform that is considered a market leader should be missing things like this. 

the carts, except for a few minor visual changes, basically follow the same cart process that's been used in WHMCS for all the time i've been using it (and probably long before that).

17 hours ago, adamjedgar said:

I am also surprised that a platform that is considered a market leader, and therefore i make the assumption it turns over tens of millions of dollars per year, has one of the crappiest series of template choices I have ever seen.

I think you wouldn't get much disagreement from the vast majority of users with that last statement - the templates have never been its greatest feature... this is how the old Vertical Steps orderform template looked in v5.

2FugxLI.png

thrilling isn't it... and I think VerticalSteps was one of the most popular of the templates back then. 🙄

17 hours ago, adamjedgar said:

To say the default theme was designed would be an overstatement...

WHMCS were very proud of 'Six' and 'standard_cart' when they launched it three years ago.

17 hours ago, adamjedgar said:

it looks like something that fell out of the back of a horses ass. Even a lot of the third party ones are complete and utter rot (i use the term rot because they are worse than rubbish).

generally, unless you put some considerable work in, custom orderform templates just follow the existing order process and are basically just css styling changes.

I will add that we haven't seen any new orderform templates in recent years... so every orderform template option you currently see within WHMCS is at least 3 years old... standard_cart has been updated code-wise, but the other templates (sliders/comparisons) are just 'pretty' opening pages for standard_cart and haven't been visually changed in the last couple of years... Modern (it nearly was once!) and Boxes are still shipped, but haven't been updated in years (they're probably 5+ years old too).

the big hope is that there will be new cart templates with v8 - though we'll literally have no idea what's coming until we see the first beta (next year I assume now), or they start hinting at forthcoming features in their blog/twitter etc... even features like conditional linking of configurable options is tricky to do in the current templates, yet I know other billing solutions do it by default... so WHMCS are years behind in terms of template development.

I think there's a valid argument that WHMCS should look outside of the development team for new template designs, but whether they will, I doubt.... the viability of that might also depend on whether they make changes to the core cart process, or whether it's still going to follow the same old path.

17 hours ago, adamjedgar said:

Please don't take the criticisms above the wrong way...

it's good that fellow users should criticise the product - there is a lot with WHMCS to be critical of (to varying degrees).

17 hours ago, adamjedgar said:

as a non-programmer, mechanically, for the most part, I am very happy with whmcs , however, considering we pay monthly for it, the revenue we generate should produce a complete product (including the client interface) and I am deeply disappointed with the lack of transparency and quality of the third party templates I have found in the whmcs marketplace thus far. This leaves people like me between a rock and a hard place.

custom templates are often a double-edged sword - yes, you can get closer to the look you want for your site, but updating WHMCS can become much more complicated - though if it's a commercial custom, you can at least rely (hopefully!) on the developer to update their themes... though if they go missing, then you're stuck with a custom template you may not be able to easily update.

17 hours ago, adamjedgar said:

As someone who spends quite a deal of time with Wordpress, I am exposed to good and bad template interfaces. Anyone who has used Avada, for example, will understand what I mean.

WordPress would be another template option - though it's never one that i'm keen on because you're relying on third-party plugins to integrate it with WHMCS and that's just adding another layer to manage.

17 hours ago, adamjedgar said:

I am considering a Zomex theme for example. Anyone got any thoughts on best template to buy?

can I give you two pieces of advice going forward with your custom template purchase and use...

  1. choose a developer that you believe will be around for a while... e.g it's pointless to buy a v7.6 template now, upgrade to v8 in the future and then find your developer is nowhere to be found - and you're left in a position of getting someone else to update the template, or having to purchase another template... so not only should you choose a good design for your site, you also need to find someone that's going to support it going forward... Jack @ zomex has got a good reputation for support and updates, but we can all get killed by the proverbial bus in the road tomorrow, so there are no guarantees with any template developer.
  2. if you are using a custom template (main theme and/or orderform) and you see the message in the admin area that a WHMCS update is available ("Update Now!") - do absolutely nothing!
    that simplistic nudge message from WHMCS drives me nuts, because some users blindly run the update and then complain that x, y or z feature is no longer working -  often because they haven't updated the template - or even checked that an update is available from its developer yet... so when you see the message, before updating WHMCS, check with the template developers (same applies for addon modules too) for updates... if it's a minor update (v7.6.1 -> v7.6.2), you may get away with no template changes; for major updates (v7.6.1 -> v7.7 or v8), you will certainly require template updates.
    sadly, WHMCS updates come with no prior warnings for developers (they may have a vague idea if there is a beta period, but generally they're a bolt from the blue), so some can be caught out by their release and then it's a scramble for them to work through the limited documentation to see what needs to be updated in the templates.... therefore, patience is always the key with updating!
Link to comment
Share on other sites

  • 4 weeks later...
On 10/1/2018 at 8:41 AM, brian! said:

{if $numitemsincart gt 0} <li class="primary-action"> <a href="{$WEB_ROOT}/cart.php?a=view" class="btn"> {$LANG.viewcart} </a> </li> {/if}

You could do the above, but if you want to show the button but have it disabled then you could do the below

<li class="primary-action"> <a href=" {$WEB_ROOT}/cart.php?a=view"  class="btn" {if $numitemsincart >  0}disabled{/if}> {$LANG.viewcart} </a>   </li>

 

also its not entirely possible to do this as a admin panel item checkbox by using hooks or using the affilate links enable checkbox, like I do.

Edited by hanstavo
Link to comment
Share on other sites

On 10/3/2018 at 7:57 PM, adamjedgar said:

What I don't understand about all of this, considering this is what I would have thought is a basic function that all shopping carts should have, why isn't it programmed into the interface by default? (for example, a checkbox in the admin area that allows us to turn it on or off)

I am surprised that a platform that is considered a market leader should be missing things like this. 

I'm pretty sure that every single shopping cart system I tested allows you to view the cart even if there is nothing inside. Even Amazon, I just checked, shows a big 0 on my cart and I can click it just fine. I'm not sure from where you are getting it's a a standard thing. Its not. All major eCommerce sites let you view an empty cart.

Edited by yggdrasil
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