Display options or variants on product listing page

  • Posts: 177
  • Thank you received: 5
7 years 1 month ago #266638

-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.6.5

Is it possible now in Hikashop 3 with new "Add to cart" and "Checkout" system to select options or variants from product listing page and recalculate automatically without opening Product details page?
As we can do it in Virtuemart

Attachments:

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

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
7 years 1 month ago #266657

Hi,

There is no option to do that for now.

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

  • Posts: 177
  • Thank you received: 5
7 years 1 month ago #266739

As I noticed, this is one of the most frequently requested functions on the forum.
:) it was in your's TODO list 4 yeasr ago
And this function really makes shopping easier and more convenient.
Unfortunately, we are waiting on :whistle:

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

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
7 years 1 month ago #266745

Hi,

The first step to make that possible what to completely rewrite the add to cart system. This was done with HikaShop 3.
The next step will be to rewrite completely the variants selection system to be AJAXified. And then we'll be able to add that possibility.
Please understand that such developments are complex and take a lot of time to do it properly.

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

  • Posts: 177
  • Thank you received: 5
7 years 4 weeks ago #266881

While waiting for the development of this functional, thought about how to temporarily replace it.
Maybe popup window opened when click Choose option. Found this topic.
Tried to do it. But when in this modal window click "Add to cart" - cart module's content doesn't refresh until I refresh page manually.
Is there any solution to this problem?

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

  • Posts: 177
  • Thank you received: 5
7 years 4 weeks ago #266883

For example, if I will use Dropdown cart type, maybe I can add some javascript to refresh cart content every time click to show cart content?

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

  • Posts: 177
  • Thank you received: 5
7 years 4 weeks ago #266894

nicolas wrote:

window.hikashop.submitCartModule(this, 'hikashop_cart_<?php echo $module_id; ?>', 'cart');
I was simply saying that the cart module can be refreshed with such javascript.

Also useful. A crutch, but it works at least that way.

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

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
7 years 4 weeks ago #266904

Hi,

That's a goode idea. You can edit the file "cart" of the view "product" and change the code:

$extra_data .= ' onclick="if(window.hikashop.toggleOverlayBlock(\'hikashop_cart_dropdown_'.$module_id.'\')) return false;"';
You could try this instead:
$extra_data .= ' onclick="if(window.hikashop.toggleOverlayBlock(\'hikashop_cart_dropdown_'.$module_id.'\')){ window.Oby.fireAjax(\'cart.updated\');return false; }"';

Last edit: 7 years 4 weeks ago by nicolas.

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

  • Posts: 177
  • Thank you received: 5
7 years 4 weeks ago #266910

(\'cart.updated\') or get 500 error. When I click on the cart, the content unfolds and immediately folds back.

Is there a difference between

window.hikashop.submitCartModule(this, 'hikashop_cart_<?php echo $module_id; ?>', 'cart');
and
window.Oby.fireAjax('cart.updated');
?

Install additional joomla module "Perfect Everything in Everyway", place Hikashop full cart into it and add action to it's toggler onclick="window.hikashop.submitCartModule(this, \'hikashop_cart_202\', \'cart\');"

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

  • Posts: 177
  • Thank you received: 5
7 years 4 weeks ago #266923

Can I create additional Popup Product detail page layout (different from usual Product details page)? Want to remove product photo and description from popup.

Popup opens by URL
<a class="modal hikabtn hikacart" rel="{handler: 'iframe', size: {x: 450, y: 480}}" href="/kafe-mariya/product/3239-shashlyk-iz-perepelov/tmpl-component.html" title="Шашлык из ПЕРЕПЕЛОВ" onhover="SqueezeBox.fromElement(this,{parse: 'rel'});return false;">Choose option</a>

Maybe add something to rel or href?

Last edit: 7 years 4 weeks ago by alikon1.

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

  • Posts: 177
  • Thank you received: 5
7 years 4 weeks ago #266971

Add to top of /components/com_hikashop/views/product/tmpl/show.php:

<?php
$layout = $this->productlayout;
if(!empty($_GET['layout_name'])){$layout = $_GET['layout_name'];}
$this->productlayout = $layout;
?>
To add_to_cart_ajax.php href atribute add ?layout_name=show_popup.
And create this show_popup.php file.

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

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
7 years 3 weeks ago #266935

Hi,

Ah yes, I had forgotten the backslashes.
And yes, that will also reload the cart dropdown itself when that is triggered. So that won't help. It would require some further modifications in cart.php

fireAjax('cart.updated') will refresh all the carts on the page.
hikashop.submitCartModule(this, 'hikashop_cart_<?php echo $module_id; ?>', 'cart') will submit the data of one cart module and then refresh all the carts on the page so you don't want to use that here since it would remove from the cart the product you just added.

Yes, add an extra parameter to the URL of the link and check for that parameter in the view files of the product page to display or not the elements.

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

Time to create page: 0.089 seconds
Powered by Kunena Forum