Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Stock Control But Don't Show
Next Page
Author « Topic »
Page: of 2

TJM
Advanced Member

United Kingdom
398 Posts

Pre-sales questions only
(More Details...)

Posted - 03/02/2019 :  12:00:21  
Hello all,

I am using stock control but don't want the customer to see it unless they are logged in at level 5, I have used the code below in the includes.php as before but it is still showing:

$showinstock=FALSE;
if(@$_SESSION['clientID']!=''){
if(@$_SESSION['clientLoginLevel']==5) $showinstock=TRUE;
}

Any advice on how to only see it at login level 5 would be appreciated.

instock is listed against the $detailpagelayout= 'instock...., $csvProdFields = pInStock.....

Many thanks in advance
Tim


Tim Jones
TJ Motorsport
https://www.tjmotorsport.co.uk

Andy
ECT Moderator

95440 Posts

Posted - 03/02/2019 :  12:44:05  
Hi Tim

I don't think that's going to be possible when using the detailpagelayout parameter.

Andy

Please feel free to review / rate our software

TJM
Advanced Member

United Kingdom
398 Posts

Pre-sales questions only
(More Details...)

Posted - 03/02/2019 :  13:31:44  
Thank you Andy, if I was to remove instock listed against the $detailpagelayout= 'instock...., $csvProdFields = pInStock....., would it then work? I can then just see stock in admin section?

Regards
Tim

Tim Jones
TJ Motorsport
https://www.tjmotorsport.co.uk

dbdave
ECT Moderator

USA
10276 Posts

Posted - 03/02/2019 :  13:46:33  
What about specifying a different detail page layout if login level is 5

$detailpagelayout= this
if(@$_SESSION['clientID']!=''){
if(@$_SESSION['clientLoginLevel']==5) $detailpagelayout= that
}

TJM
Advanced Member

United Kingdom
398 Posts

Pre-sales questions only
(More Details...)

Posted - 03/02/2019 :  13:50:01  
Thank you for that, do I then have to do anything to the $detailpagelayout= 'instock...., $csvProdFields = pInStock..... to make this work?

Sorry for all the questions, just getting a bit above my basic understanding.

Regards
Tim

Tim Jones
TJ Motorsport
https://www.tjmotorsport.co.uk

dbdave
ECT Moderator

USA
10276 Posts

Posted - 03/02/2019 :  14:18:53  
The first will have the instock NOT listed and then the second will have it listed.

So basically

what you had before

$detailpagelayout will be listed before the code below without the instock set.
copy over the $detailpagelayout (add in the instock part when you want it to appear) to only work when the login level is 5

$detailpagelayout (string without instock)
if(@$_SESSION['clientID']!=''){
if(@$_SESSION['clientLoginLevel']==5) (string with instock);
}
$detailpagelayout

That bit of code is just saying use detail layout A but if there is a client logged in, and their login level = 5, then use detail layout B instead.

If you are still having trouble, post up the entire $detailpagelayout line and I will show you how to write it.






Edited by - dbdave on 03/02/2019 14:19:49

TJM
Advanced Member

United Kingdom
398 Posts

Pre-sales questions only
(More Details...)

Posted - 03/02/2019 :  14:50:15  
Thanks again,

I have tried this but does not seem to be working?

$detailpagelayout='navigation,productimage,manufacturer,productid,productname,options,price,listprice,quantity,sku,discounts,addtocart,description,previousnext,emailfriend,reviews';
if(@$_SESSION['clientID']!=''){
if(@$_SESSION['clientLoginLevel']==5);
}
$detailpagelayout='navigation,productimage,manufacturer,productid,productname,options,price,listprice,quantity,sku,discounts,instock,addtocart,description,previousnext,emailfriend,reviews';

Is this correct?
Regards
Tim

Tim Jones
TJ Motorsport
https://www.tjmotorsport.co.uk

dbdave
ECT Moderator

USA
10276 Posts

Posted - 03/02/2019 :  15:35:55  
try it like this

$detailpagelayout='navigation,productimage,manufacturer,productid,productname,options,price,listprice,quantity,sku,discounts,addtocart,description,previousnext,emailfriend,reviews';
if(@$_SESSION['clientID']!=''){
if(@$_SESSION['clientLoginLevel']==5) {
$detailpagelayout='navigation,productimage,manufacturer,productid,productname,options,price,listprice,quantity,sku,discounts,instock,addtocart,description,previousnext,emailfriend,reviews';
}}

Edited by - dbdave on 03/02/2019 15:37:53

TJM
Advanced Member

United Kingdom
398 Posts

Pre-sales questions only
(More Details...)

Posted - 03/03/2019 :  04:20:36  
Thanks again, but still not working.
Regards
Tim

Tim Jones
TJ Motorsport
https://www.tjmotorsport.co.uk

dbdave
ECT Moderator

USA
10276 Posts

Posted - 03/03/2019 :  07:16:55  
I will test it out. I was just working off your old code, but I will give it a test.

dbdave
ECT Moderator

USA
10276 Posts

Posted - 03/03/2019 :  07:52:59  
This works pefectly for me

$detailpagelayout='navigation,productimage,productname,instock,description,sku,listprice,price,currency,options,quantity,addtocart,socialmedia,previousnext,reviews,custom3';
if(@$_SESSION['clientID']!=''){
if(@$_SESSION['clientLoginLevel']==5) $detailpagelayout='navigation,productimage,productname,description,sku,listprice,price,currency,options,quantity,addtocart,socialmedia,previousnext,reviews,custom3';
}


A few things to note.
This is my detailpage layout, so make sure you substitute yours....
You must be testing with an account that has login level 5 set
If you change the login level of an account (to test with), you must logout and log back in for that to be active.
Make sure $detailpagelayout is not defined further down in the includes file, or on the product detail page itself.
That should be it. If it's still not working, I can take a look with FTP access you could send via a message by clicking my username.

Let me know if you still have trouble.

TJM
Advanced Member

United Kingdom
398 Posts

Pre-sales questions only
(More Details...)

Posted - 03/03/2019 :  11:21:04  
Thankyou, that works, I have just have to look at all the CSS now as it totally changes the look of the page. I also need to look at product page and featured products on home page.

Thank you again though.

Regards
Tim

Tim Jones
TJ Motorsport
https://www.tjmotorsport.co.uk

dbdave
ECT Moderator

USA
10276 Posts

Posted - 03/03/2019 :  12:08:04  
Good to hear Tim.

I understand about the css.

TJM
Advanced Member

United Kingdom
398 Posts

Pre-sales questions only
(More Details...)

Posted - 03/03/2019 :  12:35:13  
Thank you again.
Regards
Tim

Tim Jones
TJ Motorsport
https://www.tjmotorsport.co.uk

Phil
ECT Moderator

United Kingdom
7620 Posts

Posted - 03/04/2019 :  04:30:47  
Hi Tim,
Try it like this:
$detailpagelayout='navigation,productimage,productname,description,manufacturer,sku,listprice,' . (@$_SESSION['clientLoginLevel']==5 ? 'instock,' : '') . 'price,currency,options,quantity,addtocart,previousnext';



* Database Migrations and Conversions*
* ASP to PHP Cart Conversions*

*Contact Us*
*Buy The PHP Capture Card Plugin*
*Rate Our Services/View Our Feedback*

Edited by - Phil on 03/04/2019 04:32:32

TJM
Advanced Member

United Kingdom
398 Posts

Pre-sales questions only
(More Details...)

Posted - 03/04/2019 :  10:27:38  
Hello Phil

Thank you for that, doesn't seem to work but thank you.

Hello dbdave

I think I might have made a mistake when testing your version, it looks like I deleted the proddeatils from the layout css and that is why it was all over the place.

Regards and many thanks to you both. Will have to put this one hold for the time being.

Tim

Tim Jones
TJ Motorsport
https://www.tjmotorsport.co.uk

TJM
Advanced Member

United Kingdom
398 Posts

Pre-sales questions only
(More Details...)

Posted - 04/19/2019 :  01:27:00  
After re-reading above I have followed Phil's option and it now works on every page except Quickbuy, I forgot to add the code to each of the Layout Options in my includes page. Is there anyway of getting it to work on the Quickbuy, this is the current code I have:

$productpagelayout='productimage,productname,reviewstars,' . (@$_SESSION['clientLoginLevel']==5 ? 'instock,' : '') . ', listprice,price,detaillink,quickbuy';

Regards
Tim

Tim Jones
TJ Motorsport
https://www.tjmotorsport.co.uk

Andy
ECT Moderator

95440 Posts

Posted - 04/19/2019 :  01:33:17  
Hi Tim

I think that would be the same but with $quickbuylayout rather than $productpagelayout

Andy

Please feel free to review / rate our software

TJM
Advanced Member

United Kingdom
398 Posts

Pre-sales questions only
(More Details...)

Posted - 04/19/2019 :  01:42:46  
Thank you Andy, would the following be correct?

$quickbuylayout='productimage,productname,reviewstars,' . (@$_SESSION['clientLoginLevel']==5 ? 'instock,' : '') . ', listprice,price,detaillink';

or would quickbuy have to remain in there?

Regards
Tim

Tim Jones
TJ Motorsport
https://www.tjmotorsport.co.uk

Andy
ECT Moderator

95440 Posts

Posted - 04/19/2019 :  01:45:48  
I think that should be fine in theory.

Andy

Please feel free to review / rate our software

TJM
Advanced Member

United Kingdom
398 Posts

Pre-sales questions only
(More Details...)

Posted - 04/19/2019 :  13:47:11  
That did not work, which is funny as it worked for product and product detail page, any other ideas on quickbuy, should I remove quickbuy from:

$productpagelayout='productimage,productname,reviewstars,' . (@$_SESSION['clientLoginLevel']==5 ? 'instock,' : '') . ', listprice,price,detaillink,quickbuy';

Regards and thanks again
Tim

Tim Jones
TJ Motorsport
https://www.tjmotorsport.co.uk
Page: of 2 « Topic »  
Next Page
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000