Jump to content

Products Category on shopping-cart.tpl


Recommended Posts

The gifts improvisation from my previous topic works very ok thanks to rocky, but now i want to give my customers the ability to select one of those gifts and add it to cart. I want to do this on the shopping-cart.tpl, before sending me the final order.

Could you help me to display this gifts products on that page? I have 3 types of gifts (4 gifts for orders < X, 4 gifts for orders between X and Y, and 4 gifts for orders > Y). I ordered this types by a custom reference (something like GIFT TYPE 1, GIFT TYPE 2 etc.) so i can sort them in product-list (fisrt line for that type of order, second for an order between X and Y etc.). I took out the add to cart button from that page and from gift product detailes.

How could i list this products under my shopping cart (the big one) and make prestashop show the first 4 products if my total cart value is less than X, the first 4 products and the next 4 for value > X and < Y etc. and let the customer “add to cart” just one of them?

I tried with {if $total_price > X}something{/if} but i cant get the products to show.

The first topic - http://www.prestashop.com/forums/viewthread/46497/development/solved_show_products_from_category_x_inside_product_page

The solution for my first problem was to modify the products category module.

I tried to put that module in other places than the product page itself but the module does not appear.



LE1: Partially solved: i've managed to put that module in shopping cart extra hook (public function hookShoppingCartExtra instead of public function hookProductFooter).

The only problem is how to insert the add to cart button and how to hide the gifts that are not in that price range.


LE2: Another part done - show add to cart button

Solution: in productscategory.tpl replace first line by

{if count($categoryProducts) > 0 && $path <> ""} 
display the products on every page - without add to cart button (in my case)
display the products only on order page - here you put in the add to cart button code

Link to comment
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
  • Create New...