Unpublished prioduct variant still displayed

  • Posts: 250
  • Thank you received: 7
10 years 2 months ago #202290

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1

I have products with variants, if I unpublish some of these variants they are still displayed in the front end.

Ian

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

  • Posts: 13201
  • Thank you received: 2322
10 years 2 months ago #202297

Hi,

All the possible values are listed but a message saying that the product is not available is displayed on unpublished variants.
It is working this way because, when there is many characteristics attached to a product we have to list the dropdowns to allow the combinations between the characteristic values.

But if you want, you can select another way of displaying the variant selection in the configuration of HikaShop.

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

  • Posts: 250
  • Thank you received: 7
10 years 2 months ago #202414

Hi Xavier,

I'm afraid I don't really understand your answer.

I am not seeing a message for unpublished variants, and I don't have any drop downs, I am using a customised template but I don't think I've removed anything to do with that.

I am using List view for variants and if a variant is unpublished convention suggests it shouldn't be visible, and that's how I was expecting it to work.

Regards,

Ian

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

  • Posts: 13201
  • Thank you received: 2322
10 years 2 months ago #202420

Hi,

When using the option "list" to list the variants, an unpublished variant shouldn't be displayed.
I just tried on my local and it is working as expected.

Do you have edited the view "product / show_block_characteristic" ? If it is, please backup it and try with the default view.

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

  • Posts: 250
  • Thank you received: 7
10 years 2 months ago #202567

I have over ridden the templates, I'll check I haven't broken anything.

Thanks,

Ian

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

  • Posts: 84220
  • Thank you received: 13673
  • MODERATOR
10 years 2 months ago #202572

The unpublished/out of stock variants won't display on the list of the product page if the "show out of stock products" setting of the HikaShop configuration is turned off so make sure that it is the case.

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

  • Posts: 250
  • Thank you received: 7
10 years 2 months ago #202641

Ok, I do have "show out of stock products" turned on, but would consider out of stock and unpublished as being different things. In my case I want to show products that are published and out of stock, but I don't want to show products that I haven't published.

Ian

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

  • Posts: 84220
  • Thank you received: 13673
  • MODERATOR
10 years 2 months ago #202662

That's how it works for products.
Variants should indeed work like that too.

I've reproduced the issue on my end and found the origin and added a patch which will be in next version of HikaShop for that.

You need to add the code:

if($name=='product_published' && $variant->$name==0){
									continue;
								}
after the code:
if($name=='product_quantity' && $variant->$name==0){
									continue;
								}
in the file administrator/components/com_hikashop/classes/product.php and that will fix it in the mean time.

The following user(s) said Thank You: iedwards

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

  • Posts: 250
  • Thank you received: 7
10 years 2 months ago #202712

Thank you Nicolas, I have included that and unpublishing variants now works fine.

Ian

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

Time to create page: 0.077 seconds
Powered by Kunena Forum