If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Customization from the Admin / Show Customer Authorization Status

Show Customer Authorization Status

Started by elgobay on 20 Apr 2020, 11:02 PM · Views: 4,143

Results 1 to 5 of 5
20 Apr 2020, 11:02 PM
#1
elgobay avatar

elgobay

New Zenner

Join Date:
Jan 2009
Posts:
7
Plugin Contributions:
0

Show Customer Authorization Status

What is the purpose of the: Authorization: Left/Right column in Admin Settings?
I'm trying to be able to show my customers their authorization status on their account page when they login.
Additionally: I would like only Approved (customer_authorization_0) customers to see a link, Example: For approved customers; here is a link to your file, elseif "You are not approved to view this file".
This is what I've tried without the elseif statement but no luck;

<?php if ($customers->fields['customers_authorization_0'] == 0) { ?> <li><?php echo ' <a href="/products/products.zip">Products Data Download</a>'; ?></li> <?php } //endif approved account ?>

Zen-cart 1.5.1
Thank you

21 Apr 2020, 8:02 AM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Show Customer Authorization Status

elgobay:

What is the purpose of the: Authorization: Left/Right column in Admin Settings?
I'm trying to be able to show my customers their authorization status on their account page when they login.
Additionally: I would like only Approved (customer_authorization_0) customers to see a link, Example: For approved customers; here is a link to your file, elseif "You are not approved to view this file".
This is what I've tried without the elseif statement but no luck;

<?php if ($customers->fields['customers_authorization_0'] == 0) { ?> <li><?php echo ' <a href="/products/products.zip">Products Data Download</a>'; ?></li> <?php } //endif approved account ?>

Zen-cart 1.5.1
Thank you

The field you are looking for is called "customers_authorization". so if your query is in $customers you can do something like

if ($customers->fields['customers_authorization'] == 0) {
...

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

21 Apr 2020, 10:48 AM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Show Customer Authorization Status

Additionally, in your link for customers, would recommend removing the opening slash from "/products/products.zip" unless the products folder is not located in the same directory as your store.

Reason is, if the products directory is located in the store's directory, then the page will be given sufficient information that when attempting to then access the products directory, it will go there next... If the products directory (now or at some point in the future) is at the not at the root of your domain name then when attempting to click that link, the reference would be as if to try from the domain root. In the case of the products directory being in the same path as the store and the store is in a Web facing sub-directory, then the initial slash will point to the wrong location...

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

21 Apr 2020, 12:00 PM
#4
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Show Customer Authorization Status

LOL I didn't even read that far, I got stuck on "customer_authorization_0".

@Elgobay, if you're offering a download, you may want to look at how Zen Cart provides a downloadable product - possibly free - securely through the cart.

https://docs.zen-cart.com/user/products/downloadable/

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

22 Apr 2020, 8:30 PM
#5
elgobay avatar

elgobay

New Zenner

Join Date:
Jan 2009
Posts:
7
Plugin Contributions:
0

Re: Show Customer Authorization Status

Ok, thanks for the replies.
I have the link working / showing up and going to the download.
The issue I'm having is: It shows for all account users and I want it to show to ONLY "Approved" (customer_authorization_0) accounts, not pending authorization accounts.
I know this is my argument should be:

<?php if ($customers->fields['customers_authorization_0'] == 0) { ?>

What should be here; "== 0)" to only shoe the link to approved users?
Plus I need "elseif" arguments included.
I'm making the edits in tpl_account.
If anyone can provide me the full code I need to use, which works, send me your price. I also have a bigger multisite job which I'll give you.