[Skip to main content](#vessel-content)

#   Change Screen After Cart Is Emptied

##

- **[jonblk](/forum/user/9766-jonblk "View jonblk's Profile")**
- [![jonblk's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9766-jonblk "View jonblk's Profile") Topic Author
- [ Offline](/forum/user/9766-jonblk)

Less More

- Posts: 25
- Thank you received: 0
-
-

14 years 3 weeks ago [\#71693](#71693) by [jonblk](/forum/user/9766-jonblk "View jonblk's Profile")  *[Change Screen After Cart Is Emptied](/forum/4-how-to/71693-change-screen-after-cart-is-emptied#71693 "Good Day,  After i delete the last item in my shopping cart, the screen changes and a message at the top reads 'The cart is empty' and all my products with their corresponding prices are displayed in the main area of the window.  How can I just have the message 'The cart is empty' being displayed without the products and their prices showing at the bottom. (It would be OK if the area where the products with their prices remains blank or as white space)  thank you in advance")* was created by *[jonblk](/forum/user/9766-jonblk "View jonblk's Profile")*

Good Day,

After i delete the last item in my shopping cart, the screen changes and a message at the top reads 'The cart is empty' and all my products with their corresponding prices are displayed in the main area of the window.

How can I just have the message 'The cart is empty' being displayed without the products and their prices showing at the bottom.
(It would be OK if the area where the products with their prices remains blank or as white space)

thank you in advance

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxNjkzLWNoYW5nZS1zY3JlZW4tYWZ0ZXItY2FydC1pcy1lbXB0aWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 2 weeks ago [\#71864](#71864) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Change Screen After Cart Is Emptied](/forum/4-how-to/71693-change-screen-after-cart-is-emptied#71864 "Good Day,  After i delete the last item in my shopping cart, the screen changes and a message at the top reads 'The cart is empty' and all my products with their corresponding prices are displayed in the main area of the window.  How can I just have the message 'The cart is empty' being displayed without the products and their prices showing at the bottom. (It would be OK if the area where the products with their prices remains blank or as white space)  thank you in advance")*

Hi,

You can change the page where the customer is redirected when his cart is empty in HikaShop &gt; Configuration &gt; Checkout, the option "URL where to redirect when the cart is empty"

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxNjkzLWNoYW5nZS1zY3JlZW4tYWZ0ZXItY2FydC1pcy1lbXB0aWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jonblk](/forum/user/9766-jonblk "View jonblk's Profile")**
- [![jonblk's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9766-jonblk "View jonblk's Profile") Topic Author
- [ Offline](/forum/user/9766-jonblk)

Less More

- Posts: 25
- Thank you received: 0
-
-

14 years 2 weeks ago [\#72503](#72503) by [jonblk](/forum/user/9766-jonblk "View jonblk's Profile")  Replied by *[jonblk](/forum/user/9766-jonblk "View jonblk's Profile")* on topic *[Re: Change Screen After Cart Is Emptied](/forum/4-how-to/71693-change-screen-after-cart-is-emptied#72503 "Good Day,  After i delete the last item in my shopping cart, the screen changes and a message at the top reads 'The cart is empty' and all my products with their corresponding prices are displayed in the main area of the window.  How can I just have the message 'The cart is empty' being displayed without the products and their prices showing at the bottom. (It would be OK if the area where the products with their prices remains blank or as white space)  thank you in advance")*

Hi again,

I do not necessarily need to change the page the user is redirected to.

Currently when the cart is cleared the URL which users are directed to is "MYSITE/index.php/component/hikashop/product/listing"

I would like to know which file or files I would need to modify in order to change how this page is displayed.
For instance, I would like the 'The cart is empty' message to continue to appear at the top. However I would like to remove all the code which causes the products to appear at this window and replace it with some of my very own code.

How can I do this?

Thank you again.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxNjkzLWNoYW5nZS1zY3JlZW4tYWZ0ZXItY2FydC1pcy1lbXB0aWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

14 years 2 weeks ago [\#72635](#72635) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Change Screen After Cart Is Emptied](/forum/4-how-to/71693-change-screen-after-cart-is-emptied#72635 "Good Day,  After i delete the last item in my shopping cart, the screen changes and a message at the top reads 'The cart is empty' and all my products with their corresponding prices are displayed in the main area of the window.  How can I just have the message 'The cart is empty' being displayed without the products and their prices showing at the bottom. (It would be OK if the area where the products with their prices remains blank or as white space)  thank you in advance")*

Hi,

To edit this view, you can edit the file "product / listing_img_title" or another listing depending on which one is used.
You have to go in HikaShop &gt; Display &gt; Views.

To have a different view only when the cart is empty, you can add a parameter in the url when the cart is cleared, for example: "MYSITE/index.php/component/hikashop/product/listing/cart-empty"
and then in the view file add controls to display your text, like: "if(JRequest::getString('cart','default')=='empty'{echo "Your text";}"

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxNjkzLWNoYW5nZS1zY3JlZW4tYWZ0ZXItY2FydC1pcy1lbXB0aWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jonblk](/forum/user/9766-jonblk "View jonblk's Profile")**
- [![jonblk's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9766-jonblk "View jonblk's Profile") Topic Author
- [ Offline](/forum/user/9766-jonblk)

Less More

- Posts: 25
- Thank you received: 0
-
-

14 years 2 weeks ago [\#72667](#72667) by [jonblk](/forum/user/9766-jonblk "View jonblk's Profile")  Replied by *[jonblk](/forum/user/9766-jonblk "View jonblk's Profile")* on topic *[Re: Change Screen After Cart Is Emptied](/forum/4-how-to/71693-change-screen-after-cart-is-emptied#72667 "Good Day,  After i delete the last item in my shopping cart, the screen changes and a message at the top reads 'The cart is empty' and all my products with their corresponding prices are displayed in the main area of the window.  How can I just have the message 'The cart is empty' being displayed without the products and their prices showing at the bottom. (It would be OK if the area where the products with their prices remains blank or as white space)  thank you in advance")*

Hi again,

I have cleared out the product/listing_img_title file so it is no longer displaying the items I have available.
However there is some other module I believe which is still running on this bottom of this page. Even though my products are not being displayed I can see the words "Display # 20" and "Results 1 - 3 of 3" at the bottom. I would like these words removed from the page. How can I do this?
Also if I do a simple echo "Hello World"; in the product/listing_img_title file "Hello World" is being displayed three times to reflect the number of products I have created. I would like this to stop.
How can I make it stop appearing this way.

PS:- I am not an expert programmer so please explain as thoroughly as possible.

thank you again

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxNjkzLWNoYW5nZS1zY3JlZW4tYWZ0ZXItY2FydC1pcy1lbXB0aWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

14 years 2 weeks ago [\#72911](#72911) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Change Screen After Cart Is Emptied](/forum/4-how-to/71693-change-screen-after-cart-is-emptied#72911 "Good Day,  After i delete the last item in my shopping cart, the screen changes and a message at the top reads 'The cart is empty' and all my products with their corresponding prices are displayed in the main area of the window.  How can I just have the message 'The cart is empty' being displayed without the products and their prices showing at the bottom. (It would be OK if the area where the products with their prices remains blank or as white space)  thank you in advance")*

Hi,

Before of :
echo "Hello World";

you can add:

static $alreadyDone = false;
if($alreadyDone) return;
$alreadyDone = true;

That way, it will do the echo only once.

If you want to remove the pagination at the bottom you can add such CSS on your website:
.hikashop_products_pagination{display:none;}

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxNjkzLWNoYW5nZS1zY3JlZW4tYWZ0ZXItY2FydC1pcy1lbXB0aWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jonblk](/forum/user/9766-jonblk "View jonblk's Profile")**
- [![jonblk's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9766-jonblk "View jonblk's Profile") Topic Author
- [ Offline](/forum/user/9766-jonblk)

Less More

- Posts: 25
- Thank you received: 0
-
-

14 years 2 weeks ago [\#73016](#73016) by [jonblk](/forum/user/9766-jonblk "View jonblk's Profile")  Replied by *[jonblk](/forum/user/9766-jonblk "View jonblk's Profile")* on topic *[Re: Change Screen After Cart Is Emptied](/forum/4-how-to/71693-change-screen-after-cart-is-emptied#73016 "Good Day,  After i delete the last item in my shopping cart, the screen changes and a message at the top reads 'The cart is empty' and all my products with their corresponding prices are displayed in the main area of the window.  How can I just have the message 'The cart is empty' being displayed without the products and their prices showing at the bottom. (It would be OK if the area where the products with their prices remains blank or as white space)  thank you in advance")*

Hi,

The pagination works.

However I still have the problem of three echoes of 'Hello World'.

This is what my code looks like:

&lt;?php

static $alreadyDone = false;
if($alreadyDone) return;
$alreadyDone = true;

echo "Hello World";

?&gt;

I have never used 'static' before so maybe I have used it incorrectly.
Please show me how to correct this.

Thank You again

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxNjkzLWNoYW5nZS1zY3JlZW4tYWZ0ZXItY2FydC1pcy1lbXB0aWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

14 years 2 weeks ago [\#73227](#73227) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Change Screen After Cart Is Emptied](/forum/4-how-to/71693-change-screen-after-cart-is-emptied#73227 "Good Day,  After i delete the last item in my shopping cart, the screen changes and a message at the top reads 'The cart is empty' and all my products with their corresponding prices are displayed in the main area of the window.  How can I just have the message 'The cart is empty' being displayed without the products and their prices showing at the bottom. (It would be OK if the area where the products with their prices remains blank or as white space)  thank you in advance")*

That code is correct.

Static allows you to keep the value in the variable when you come back to that code later on:
[ www.tutorialspoint.com/php/php\_static\_variables.htm](http://www.tutorialspoint.com/php/php_static_variables.htm)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxNjkzLWNoYW5nZS1zY3JlZW4tYWZ0ZXItY2FydC1pcy1lbXB0aWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[jonblk](/forum/user/9766-jonblk "View jonblk's Profile")**
- [![jonblk's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9766-jonblk "View jonblk's Profile") Topic Author
- [ Offline](/forum/user/9766-jonblk)

Less More

- Posts: 25
- Thank you received: 0
-
-

14 years 2 weeks ago [\#73300](#73300) by [jonblk](/forum/user/9766-jonblk "View jonblk's Profile")  Replied by *[jonblk](/forum/user/9766-jonblk "View jonblk's Profile")* on topic *[Re: Change Screen After Cart Is Emptied](/forum/4-how-to/71693-change-screen-after-cart-is-emptied#73300 "Good Day,  After i delete the last item in my shopping cart, the screen changes and a message at the top reads 'The cart is empty' and all my products with their corresponding prices are displayed in the main area of the window.  How can I just have the message 'The cart is empty' being displayed without the products and their prices showing at the bottom. (It would be OK if the area where the products with their prices remains blank or as white space)  thank you in advance")*

Hi again,

I tried the code based on the link you provided and this is what I have:-

&lt;link href="css/css.css" rel="stylesheet" type="text/css" /&gt;

&lt;?php

function keep\_track() {
STATIC $test = "Hello World";
echo $test;
echo " ";
}
keep\_track();

?&gt;

This code works since only one "Hello World" is being printed to the page.

However the rest of my website layout has disappeared (all my menus etc) and "Hello World" is being displayed on a plain white page (see attachment).

HOW can I fix this?

Thank You

- [ ![blank&#95;page.GIF](/forum/attachment/6597) ](/forum/attachment/6597 "blank&#95;page.GIF") [ ](/forum/attachment/6597?download=1 "blank&#95;page.GIF")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxNjkzLWNoYW5nZS1zY3JlZW4tYWZ0ZXItY2FydC1pcy1lbXB0aWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

14 years 1 week ago [\#73594](#73594) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Change Screen After Cart Is Emptied](/forum/4-how-to/71693-change-screen-after-cart-is-emptied#73594 "Good Day,  After i delete the last item in my shopping cart, the screen changes and a message at the top reads 'The cart is empty' and all my products with their corresponding prices are displayed in the main area of the window.  How can I just have the message 'The cart is empty' being displayed without the products and their prices showing at the bottom. (It would be OK if the area where the products with their prices remains blank or as white space)  thank you in advance")*

Hi,

It sounds like you remove the code of your template or joomla and put a code displaying the text helloworld on your website.
I don't see why you did that but it's doing what you told it to do... Since that's obviously not what you want to do, you should revert your changes.

Look, we're not here to teach you how to code in PHP and I already gave you a solution to a problem relate to custom code. That is already outside normal support. Please hire a 3rd party developer so that he can help you develop what you want to achieve. You can find such joomla developers on joomlancers.com

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxNjkzLWNoYW5nZS1zY3JlZW4tYWZ0ZXItY2FydC1pcy1lbXB0aWVkP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.066 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
