- Posts: 75
- Thank you received: 7
Checkout Button Disappears Once Variant Is Chosen
- wildweststudios
-
Topic Author
- Offline
Less
More
4 years 7 months ago #339377
by wildweststudios
Checkout Button Disappears Once Variant Is Chosen was created by wildweststudios
-- HikaShop version -- : 4.4.5
-- Joomla version -- : 3.10.3
-- PHP version -- : 7.4.27
-- Browser(s) name and version -- : Firefox 96.0.3
I notice that when a variant is chosen from the dropdown on the product display page that my Checkout button at the bottom of the right side column then disappears.
It must have been this way for a long time and I never saw it until now. You can still add to cart as normal, and then customers have been getting to checkout from the mini-cart module, but the button itself is missing.
Going to another product will return the Checkout button, but choosing any variant will remove it.
I can't see what has been done to cause this, but I track the code to the 'product/show_default.php' view, where I see this:
I cannot quite figure out what to do here. Is there some modification of this code which will allow the checkout button to remain once a variant is chosen?
-- Joomla version -- : 3.10.3
-- PHP version -- : 7.4.27
-- Browser(s) name and version -- : Firefox 96.0.3
I notice that when a variant is chosen from the dropdown on the product display page that my Checkout button at the bottom of the right side column then disappears.
It must have been this way for a long time and I never saw it until now. You can still add to cart as normal, and then customers have been getting to checkout from the mini-cart module, but the button itself is missing.
Going to another product will return the Checkout button, but choosing any variant will remove it.
I can't see what has been done to cause this, but I track the code to the 'product/show_default.php' view, where I see this:
Code:
<?php }
if(empty ($this->element->characteristics) || $this->params->get('characteristic_display')!='list'){ ?>
<div id="hikashop_product_quantity_main" class="hikashop_product_quantity_main">
<?php
$this->row = & $this->element;
$this->ajax = 'if(hikashopCheckChangeForm(\'item\',\'hikashop_product_form\')){ return hikashopModifyQuantity(\'' . $this->row->product_id . '\',field,1' . $form . ',\'cart\'); } else { return false; }';
$this->setLayout('quantity');
echo $this->loadTemplate();
?>
<a id="checkoutbut" class="btn" href="/checkout">Checkout</a>
</div>
<?php } ?>
I cannot quite figure out what to do here. Is there some modification of this code which will allow the checkout button to remain once a variant is chosen?
Please Log in or Create an account to join the conversation.
4 years 7 months ago #339378
by nicolas
Replied by nicolas on topic Checkout Button Disappears Once Variant Is Chosen
Hi,
I couldn't access the URL you provided:
i.imgur.com/tfGJe7Y.png
However, I checked some other products you have (they didn't have variants, unfortunately), and I think that the issue is that you added your checkout button in the show_default.php after the code
but you didn't do the same modification in product / show.php where the variant HTML is generated. So when you switch the variant, the HTML of the area in the div hikashop_product_quantity_main is replaced by the HTML of the selected variant generated by product / show.php and thus the button is missing from it.
I couldn't access the URL you provided:
i.imgur.com/tfGJe7Y.png
However, I checked some other products you have (they didn't have variants, unfortunately), and I think that the issue is that you added your checkout button in the show_default.php after the code
Code:
$this->setLayout('quantity');
echo $this->loadTemplate();
The following user(s) said Thank You: wildweststudios
Please Log in or Create an account to join the conversation.
- wildweststudios
-
Topic Author
- Offline
Less
More
- Posts: 75
- Thank you received: 7
4 years 7 months ago #339385
by wildweststudios
Replied by wildweststudios on topic Checkout Button Disappears Once Variant Is Chosen
You were exactly right. The button was missing from 'show.php'.
Once I added it to that view now the problem is solved.
Once I added it to that view now the problem is solved.
The following user(s) said Thank You: nicolas
Please Log in or Create an account to join the conversation.
Time to create page: 0.166 seconds