[SOLVED] is displaying 2 detail products on 1 page possible?

  • Posts: 292
  • Thank you received: 22
4 years 10 months ago #317870

-- HikaShop version -- : 4.2.3
-- Joomla version -- : 3.9.18
-- PHP version -- : 7.4

Hi,

A short question
Would it be possible, with a bit of effort, to have a page that displays 2 detail views of products next to each other?

My Google quest did not provide a solution so maybe it's no easy task :)

Thanks,
Nico

Last edit: 4 years 10 months ago by nico.van.leeuwen. Reason: solved

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

  • Posts: 83409
  • Thank you received: 13502
  • MODERATOR
4 years 10 months ago #317885

Hi,

Well, it depends :)
It depends what you want.
If the products have options or characteristics or custom fields, I would say no, as it would require a lot of development as the javascript code to handle these isn't made to support that.
If the products don't have these, then you could try to use www.regularlabs.com/extensions/componentsanywhere to have both product pages inside a Joomla article. Or you could also use instead the content tag plugin instead of the components anywhere : www.hikashop.com/support/documentation/1...-product-insert.html
Alternatively, you could also create a menu item of the type HikaShop comparison page, and enter the id of both products in the menu item settings.
Then, you would have both next to one other on the menu item page, with one row per custom product field (great to be able to compare 2 products' specifications together).

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

  • Posts: 292
  • Thank you received: 22
4 years 10 months ago #317923

Hi Nicolas,

Thanks for the tips.
The best solution was componentsanywhere.

Nico

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

  • Posts: 292
  • Thank you received: 22
4 years 10 months ago #319357

Hi, just a quick question about using the componentanywhere solution...

Could it be that when using this option, the option to add a product to the cart for product nr1 is working but doing the same with product nr2 is adding stuff to the cart for nr1 ?

So it's adding only the first product to the cart.
I'm not technical enough to know if this could be the case or something else is causing it.

Thanks for thinking along :-)

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

  • Posts: 83409
  • Thank you received: 13502
  • MODERATOR
4 years 9 months ago #319377

Hi,

I don't think this would be a problem, but it could.
I would need a link to the page to check the situation if that's what you think is happening.

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

  • Posts: 292
  • Thank you received: 22
4 years 9 months ago #319390

Hi,

No problem, this is to the old develop site but the issue is the same.
https://wijn.dlidev.nl/wijn-en-shop/wijnen

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

  • Posts: 83409
  • Thank you received: 13502
  • MODERATOR
4 years 9 months ago #319394

Hi,

This won't work for on reason:
Both areas use the same ids in the HTML tags.
So when you change the characteristic dropdown, it will always refresh the add to cart area of the first product.
And when you click on an add to cart button, it will always get the hidden input fields of the first product.
I understand you're doing this to circumvent the fact that you can't have the characteristic selector on the listing of products. But the reason why we can't easily add that capability is the same reason why what you're doing doesn't work. The id of the HTML elements need to be unique so that the characteristic and the add to cart buttons can work properly. And for the characteristic system, it basically requires rewriting it all.

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

  • Posts: 292
  • Thank you received: 22
4 years 9 months ago #319433

Hi Nicolas,

Clear about why it's not working now. Thanks for the explanation.

Then the last question ... because it's only about 2 products here... would there be a "not so correct" way to work around this changing stuff manually or using a different way to make people have a simmilar feature?

If you think that is undoable then I will accept that it's not possible :lol:

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

  • Posts: 83409
  • Thank you received: 13502
  • MODERATOR
4 years 9 months ago #319442

Hi,

Well, doing for two is the same as doing it for 10. It requires changing all the ids to be unique and rewriting the js code to handle that fact.
The only solution is to spend the time to properly code the capability, which is several full days of work to do it properly.

Now since you only have two products with two variants each, why not have 4 products and use a standard products listing ? That would work.

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

  • Posts: 292
  • Thank you received: 22
4 years 9 months ago #319453

Hi,
Thanks for the update.
I will use a workaround like you suggested or... whatever the customer wants as alternative :)

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

Time to create page: 0.070 seconds
Powered by Kunena Forum