Characteristics not working with stock control

  • Posts: 107
  • Thank you received: 3
10 years 8 months ago #146660

I'm testing my site and I'm still having the characteristics problem. I have a product with two characteristics fields (C1 and C2) and each characteristic has two values (C1-1, C1-2, C2-1, C2-2). If I have 3 untits of this product and I only have the stock in the main product, I understand that the client only can buy 3 units of some characteristics combination and not 3 units os each characteristics combination, and this is what is happening in my site.

May hikashop work like I think it must work or I'm mistaken?

OPTIONS are working worse than characteristics. You can buy an unlimited number of products in the same purchase though you only have 3 units.

I can't put online my site due to this errors.

I'm using last version 2.3.0

Please, help. Thanks.

Last edit: 10 years 8 months ago by lanzanet.

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

  • Posts: 12953
  • Thank you received: 1778
10 years 8 months ago #146673

Hi,
Can you tell me how do you exactly want to set the stock control of your product ? Note that with characteristics you can :
1. Set a quantity through the "quantity" option of each variants of your product so that the stock will be managed independently of their main product.

2. Only set a quantity through the main product so that the stock can only be managed through the main product configuration page.

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

  • Posts: 107
  • Thank you received: 3
10 years 8 months ago #146676

Hi. Thanks for answering.

I've explained it above. I've a product with 3 stock units and I want to control only these 3 units. This product has 2 characteristics with 2 variants on each characteristic and with an unlimited stock on all 4 variants (it may be result on only the stock control on the main product).

Then I can buy 3 units of each combination of characteristics resulting on 12 units that I can buy, and I only have 3 on stock.

Maybe if you buy less (or equal) than 3 units on different purchases it may work, but if you do what I've said in the same purchase it doesn't work. You can add to cart 3 units of one variant, and then without going to checkout choose other variant and then add 3 units and so on with all variants, and then you can go to checkout and buy 12 units of a product that has only 3 on stock.

Please help. Thanks.

Last edit: 10 years 8 months ago by lanzanet.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 8 months ago #146704

Hi,

Thank you for bearing with us. Such debugging is quite complex to do and we're having a hard time just keeping up with "easy" support so I hadn't the time to look at the issue until now.

Please add the code:

$quantity_for_same_main_product =& $this->_getGlobalQuantityOfVariants($cartContent,$product,$cart_product_id_for_product);
				if($quantity_for_same_main_product>$product->product_quantity){
					$in_excess = $quantity_for_same_main_product-$product->product_quantity;
					if($quantity>$in_excess){
						$quantity=$product->wanted_quantity=$quantity-$in_excess;
						$quantity_for_same_main_product=$quantity_for_same_main_product - $in_excess;
					}else{
						$quantity_for_same_main_product=$quantity_for_same_main_product - $quantity;
						$quantity=$product->wanted_quantity=0;
					}
				}
after the line:
$product->product_quantity = $parentProduct->product_quantity;
in the file administrator/components/com_hikashop/classes/cart.php and that should fix the problem (it did on my tests). Please let us know how it goes so that we can publish a hot fix build of the new version or continue to work on the issue.

The following user(s) said Thank You: lanzanet

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

  • Posts: 107
  • Thank you received: 3
10 years 8 months ago #146707

Thanks Nicolas. It works!

Only one thing, the message of 'Limit reached. You can't add the product ...' appears in english and I've configured the shop in spanish. Can I change the language message so the clients could understand it?

Thanks!!

Last edit: 10 years 8 months ago by lanzanet.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 8 months ago #146718

The message is displayed in the current language on my end.
If that's not the case on your website, it probably means that it's just not yet translated for your language and you would have to edit your translation file via the Languages tab of the configuration in order to check on that.

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

  • Posts: 107
  • Thank you received: 3
10 years 8 months ago #146741

Hi Nicolas, the LIMIT_REACHED var was not translated in my language file. I've edited it and now it works fine.

Thanks!

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

Time to create page: 0.078 seconds
Powered by Kunena Forum