Variants - Set default value and product display

  • Posts: 158
  • Thank you received: 6
10 years 1 month ago #175171

-- url of the page with the problem -- : offerings.myartisanweb.com
-- HikaShop version -- : 2.3.3
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.28
-- Error-message(debug-mod must be tuned on) -- : n/a

Good day,

I have two questions:

1. How do I change the default value from unlimited to 0 for the variants found in my characteristic Ring Size? Typically they will have 2-3 sizes in stock, so it would be easier for them to add new products to their site if all of the ring size variants were set to 0 as the quantity instead of the default which is unlimited.

2. The ring quantity is set to "unlimited" so the characteristic "Ring Size" controls the inventory. However, when all ring sizes sell out in a particular ring it still shows up in the list of available rings on the front-end. Is there a little line of PHP that I could add that would say something like "Any products in the category of "Rings" that have no variant quantities in stock under characteristics "Ring Size" do not display"? An example of a ring that sold out but is still showing can be seen here: screencast.com/t/beklXm65H - I get this message: Ring Size No values found. Instead, I'd rather the ring not show up as available. I do have "Display out of stock products" toggled to "no"

Thanks,

Dawn

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 1 month ago #175258

Hi,

1. There is two things to do here. First, edit the column "product_quantity" of the table hikashop_product of your database via your phpmyadmin and set the default to 0 instead of -1. Second, before adding the characteristics to your main product, set the quantity of the main product to 0. Then, when you save the product with the new characteristics, all the variants should have their quantity to 0.

2. No, changing the code for that is quite complex.
The best in that case is to put the total stock in the main product. That way, that stock will also be decremented as well as the variant when it is purchased and thus you'll reach 0 in the main product when all the variants stock is 0 and in that case the main product won't display on the listing.

The following user(s) said Thank You: artisanwebandprint

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

  • Posts: 158
  • Thank you received: 6
10 years 1 month ago #175600

Brilliant! It worked perfectly.

Note for other readers. For answer #1, Nicolas recommends to edit the column "Product Quantity", here is a screenshot of where to do that in PHPMyAdmin:



Dawn

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

Time to create page: 0.058 seconds
Powered by Kunena Forum