Get Wishlist products

  • Posts: 1119
  • Thank you received: 114
5 years 7 months ago #306998

Hi,

I am looking for a way to show wishlist products inside cart module? Both wishlist and cart modules use same view "cart.php".

The main idea is to have cart module, customize cart.php file to show also wishlist products without need of wishlist module at all.

Any advise?

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
5 years 7 months ago #307005

Hi,

The simplest would be to make a copy of the mod_hikashop_cart module.
In that copy, you could combine in each file the code of each file of mod_hikashop_cart and mod_hikashop_wishlist.

The following user(s) said Thank You: kyratn

Please Log in or Create an account to join the conversation.

  • Posts: 1119
  • Thank you received: 114
5 years 7 months ago #307041

Hi,

Thanks Nicolas for pointing to this. Just created new module based on hikashop cart module and loaded my own html layout. That also solved other issues i had before.

Thanks again!

Please Log in or Create an account to join the conversation.

  • Posts: 1119
  • Thank you received: 114
5 years 6 months ago #307071

So it seems i still a bit struggling in what i want to achieve.

We use hikashop cart module on some page to show it's content. All works fine until we decided to add wishlist module below. So user could add products from wishlist to cart and Vice versa...

Now we load our custom layouts which is based on cart.php for hikashop cart module and hikashop wishlist module The issue is that i need to check if hikashop cart module is empty or not and then hide wishlist layout too... The only i could find is this:

($this->element->cart_type == 'cart')

But this returns cart_type. How can i find if cart_type cart have some products inside or not?

Been searching for it like 2 hours and i think it will be easier to ask this time.

Thank you

Please Log in or Create an account to join the conversation.

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
5 years 6 months ago #307081

Hi,

You have access to the array of products in $this->element->products and $this->rows.
So you can do a count on these.
If(count($this->element->products)) {
echo 'cart is not empty';
}

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum