Hi All,
Has anyone tried to add a message to the Basket side-bar block, which appears only when the basket is empty, such as - "There are 0 items in your basket". Most big online shops have an 'empty basket' message somewhere on their pages.
It would be a small addition - probably just a few lines a code - to make the basket more user friendly.
I'm pretty much a php noob, but I figure the file to add code to would be - basket\views\basket-side-bar.html.php .
I had a stab at what the code might look like -
}
else {
?><p>
title="<?= t("There are 0 items in your basket")?>"
}
I tried this and similar lines, but they produced a blank webpage on my site!
Does anyone know if I'm on the right track here, and how to integrate with the existing code?
Any ideas would be appreciated.
Thanks.
Posts: 45
That's indeed how I did it:
Let me know if you need more help.
Jeroen
www.kidsfotos.nl
Posts: 121
I have tried to add this and nothing seems to happen.
Where did you insert the code above?
Thanks
DGF
Posts: 45
My mistake: you just need to add the 'else'-part before the last curly bracket in file \views\basket-side-bar.html.php.
Jeroen
Posts: 121
I have tried this , although I am not sure where the esle statement goes. I get my page Ok but the sidebar disappears
DGF
Posts: 15
Thanks Jeroen for your quick reply. I have it working now.
Plain text also works between the <div>.
DGF - the code goes between the last two } brackets at end of the original file.
- make sure you still have two }} at the end, - the final } to close the whole file.
else {
?><div id="sidebar-basket">
Shopping Basket is empty
</div><?
<!-- or use php code instead
<?= t("Shopping Basket is empty")?> -->
}
Chris
www.graphicscapes.com