show variants in product-list view

  • Posts: 98
  • Thank you received: 3
7 years 3 months ago #286592

-- url of the page with the problem -- : connectcad.com/index.php/pricing-purchase
-- HikaShop version -- : 3.2.2
-- Joomla version -- : 3.8.3
-- PHP version -- : 5.6.32
-- Browser(s) name and version -- : Firefox 5.6.32

Hello,
I am trying to show a drop-down list of product variants in product-list view. I made an override in quantity_legacy.php but doesn't seem to work. I actually added the following line of code, where the button "show options" was printed.
echo $this->characteristic->displayFE($this->element,$this->params);
Am I missing something?
Thank you

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

  • Posts: 83778
  • Thank you received: 13564
  • MODERATOR
7 years 3 months ago #286594

Hi,

$this->characteristic doesn't exist on listings. Also, the data needed in $this->elements from the variants/characteristics isn't there either. And on top of that, the display/displayFE functions of type.characteristic isn't meant to be called more than once on a page.
So you won't be able to do it like that. It would basically require a lot more complex development.
You'd be better off loading the data from the database in the view yourself and displaying the dropdown yourself with custom javascript to replace the id of the product in the form/button.

The following user(s) said Thank You: cpreen

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

Time to create page: 0.056 seconds
Powered by Kunena Forum