I don’t have that much experience with Prestashop, php, and Smarty.
How do I get the category of lastProductAdded?
I am trying to make the “continue shopping” button redirect to the category of the last product added.
<a href="{$link->getCategoryLink($lastProductAdded.category->id)|escape:'htmlall':'UTF-8'}" class="button_large" title="{l s='Continue shopping'}">« {l s='Continue shopping'}</a>
The following code doesn’t seem to work, giving category id of 0 for some reason. (I have no idea whether it makes sense either)
Any help would be much appreciated. Thank you!
(The variable lastProductAdded and function getCategoryLink are already defined in-built)
For Prestashop 1.4.x you need to modificate Cart::getLastProduct() with this code:
Regards