Jump to content

how can add a button in clientareaproductdetails


Anders

Recommended Posts

i cant get it to work 😞 if i add this code

$groupproducts = Capsule::table('tblproducts')->where('gid','1')->pluck('id');
$activeservices = Capsule::table('tblhosting')->where('userid',$client->id)->where('domainstatus','Active')->where('packageid','<>','4')->count();

then my button is not showing on #pid 5 what is what i wanted

and shows ok  on Pid #4 how can i add pid #1, 2, 3  to show ?

 

i tried like this 

 '<>','1','2','3','4')->count();

but it did not work.

Link to comment
Share on other sites

7 minutes ago, Anders said:

i cant get it to work

first line is now irrelevant (although i'm so confused, it might be lol).

8 minutes ago, Anders said:

then my button is not showing on #pid 5 what is what i wanted

just so i've got it straight in my head - if a client has an active pid#5 product, should the message display or not ?

11 minutes ago, Anders said:

i tried like this but it did not work.

it wouldn't, that would need wherein or wherenotin... though i'm so confused about the required conditions, I couldn't guarantee that I could tell you my own name at this point. 🤕

Link to comment
Share on other sites

16 hours ago, Anders said:

if a client has an active pid#5 product,  message should not display!

aahh... for simplicity, and future proofing, i'll move the logic out of the queries and into the IF Statement...

for a single product, it should be...

$activeservices = Capsule::table('tblhosting')->where('userid',$client->id)->where('domainstatus','Active')->where('packageid','5')->count();

for a product group...

$groupproducts = Capsule::table('tblproducts')->where('gid',2)->pluck('id');
$activeservices = Capsule::table('tblhosting')->where('userid',$client->id)->where('domainstatus','Active')->whereIn('packageid',$groupproducts)->count();

you don't need both - choose one of them.

in either case, if the current user doesn't have a #5 active product, the count should be equal to 0 and the message should not display.

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