Product Available From Dates Bug?

  • Posts: 105
  • Thank you received: 9
9 years 3 months ago #210794

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.4.38
-- Browser(s) name and version -- : Firefox

I have products that are only available on certain days. When I have the dates input for products avail in the future, the "add to cart" button disappears, and a note shows when the product becomes avail. Great.

The problem I'm having is that if you click enter, it will add it to the cart so that you can checkout with it.

Any thoughts on how to solve? Thanks.

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 3 months ago #210797

I've checked your website but couldn't find any product with the behavior you're describing.
Can you provide a link to such page so that we can analyse the problem as we don't have it on our end ?

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

  • Posts: 105
  • Thank you received: 9
9 years 3 months ago #210857

I had unpublished the product. Temporarily publishing it, so you can check the behavior.
Product showing upcoming date avail

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 3 months ago #210947

Hi,

Change the line:

<form action="<?php echo hikashop_completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form" enctype="multipart/form-data">
to:
<form action="<?php echo hikashop_completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form" onsubmit="return hikashop_product_form_check();" enctype="multipart/form-data">
	<script type="text/javascript">
	function hikashop_product_form_check(){
		var add_to_cart_main_div = document.getElementById('hikashop_product_quantity_main');
		if(!add_to_cart_main_div)
			return true;
		var main_div_inputs = add_to_cart_main_div.getElementsByTagName('input');
		if(!main_div_inputs.length){
			var main_div_links = add_to_cart_main_div.getElementsByTagName('a');
			if(!main_div_links.length)
				return false;
		}
		return true;
	}
	</script>
in the file "show" of the view "product" for your frontend template and that will avoid the problem. We'll also add that on our end for the next version of HikaShop.

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

  • Posts: 105
  • Thank you received: 9
9 years 3 months ago #210963

Thanks!!

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

Time to create page: 0.060 seconds
Powered by Kunena Forum