Jump to content
system32

If there is no order, hide the product page.

Recommended Posts

Hello,

I'm developing a client panel.
There's something I'm hanging out with.

For example, if there is no product or order on the product services page, I just want to have a new order button.

For example, the following image.

Page URL:  clientarea.php?action=services
I want it to be page:  https://prnt.sc/meyypo

 

Of course, whenever an order or product is available, the products page will display normally.

Screenshot_1.png

Share this post


Link to post
Share on other sites
On 31/01/2019 at 22:07, system32 said:

For example, if there is no product or order on the product services page, I just want to have a new order button.

I would have thought the solution to that would be to count the $services array in the template... it it's equal to zero, then they have no products at all and you can show your alternate message.... other tabled client area pages should work in a similar way.

Share this post


Link to post
Share on other sites

I've tried it.
But I haven't been very successful.
Because there is no product, we can only display the message I want.
But the warning message does not disappear because it is the product.

Share this post


Link to post
Share on other sites
15 hours ago, system32 said:

I've tried it.
But I haven't been very successful.
Because there is no product, we can only display the message I want.
But the warning message does not disappear because it is the product.

as an example, i'm going to do this in "Six" - so you'll see sidebars, but I assume in your theme, you're not going to call them... in any event, they could be removed if they had to (before or after)....

so if a client has no products and goes to clientarea.php?action=services, they should see...

0J3yb6k.png

if we edit the clientareaproducts.tpl template and use...

{if $services|@count eq 0}
	{$LANG.clientareaproductsnone}<br>You have not added any product - add first product now<br><a href="cart.php" class="btn btn-info" role="button">Add New Product</a>
{else}

* rest of current template * 

{/if}

you should then see....

xX3ZvEF.png

now you'd need to play with the layout (divs etc), but as I understand it, that basically does what your original question asked about...

Share this post


Link to post
Share on other sites
5 hours ago, brian! said:

as an example, i'm going to do this in "Six" - so you'll see sidebars, but I assume in your theme, you're not going to call them... in any event, they could be removed if they had to (before or after)....

so if a client has no products and goes to clientarea.php?action=services, they should see...

0J3yb6k.png

if we edit the clientareaproducts.tpl template and use...


{if $services|@count eq 0}
	{$LANG.clientareaproductsnone}<br>You have not added any product - add first product now<br><a href="cart.php" class="btn btn-info" role="button">Add New Product</a>
{else}

* rest of current template * 

{/if}

you should then see....

xX3ZvEF.png

now you'd need to play with the layout (divs etc), but as I understand it, that basically does what your original question asked about...

 

Thanks for your reply.
I did it like you said, and it happened.
It was exactly what I wanted.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated