Disallow unpublished variants

  • Posts: 377
  • Thank you received: 7
11 years 7 months ago #130535

Hi,

for some reason if I unpublish a variant of a product or even delete it i am still able to select it on the drop downs, the popup message comes up saying i have successfully added this to my cart and it is only when i navigate to the cart that it says that i cannot have this product in my cart when the product variant isn't even supposed to exist as i deleted it.

Is there a way i can get it to display this message on the popup so instead of saying, this has been successfully added to your cart it should say 'this combination is not available' or something along those lines? The ideal scenario would be that the drop down filters what can be selected as each option is selected so that people can't even get to the variant option however i dont know how hard this would be to implement?

Thanks

Alex

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

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
11 years 7 months ago #130558

You should not even be able to see the add to cart button for that variant (and not even see the variant in the dropdown if you turned off the "display out of stock products" option of the configuration).
Can you provide a link to the product page with the issue with a screenshot of your product's variants listing and provide your HikaShop version so that we can see what you did ?

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

  • Posts: 377
  • Thank you received: 7
11 years 7 months ago #130564

Hi Nicolas, the version is 2.2.2

Below on this page i should not be able to select the size 85x55 two sided in 500 qty.

I have the display add to cart for free products set to none and the display out of products set to no.

I have attached the variant screen shot showing this variant is unpublished however it is still selectable and the popup says that it has been added to the cart.

hexaprint.co.uk/print-product/429-300gsm-art-board-coated.html

Kind regards

Attachments:

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

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
11 years 7 months ago #130696

Hi,

That's because you commented out some of the HTML on the show_default view file. That HTML is used to swap the add to cart button of each variant when you change the characteristics selection. If you comment it out, the add to cart button area is not swapped anymore. Also, because of that, when you click on the add to cart button, it always add the default variant to the cart, regardless of the characteristic selected.

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

  • Posts: 377
  • Thank you received: 7
11 years 7 months ago #130875

I see, i was trying to hide the qty field because it is managed by the variant. I have removed all customised code on these pages. I can now see an add to wishlist button, although i have disabled add to wishlist feature in the config. Can i change this to display something like, variant type not available? And stop the button from working because if i click on it it still says it has been added to the cart.

Thanks

Alex

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

  • Posts: 12953
  • Thank you received: 1778
11 years 7 months ago #130893

Hi,
I think that you'll maybe find a solution through this thread :

If you have 2 characteristics for your product, and that you want to hide one value of this characteristic for your product, you'll have to :
- Unpublish every variant of your product which this characteristic value
- Set the Display out of stock products option to NO

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

  • Posts: 377
  • Thank you received: 7
11 years 7 months ago #130951

Hi Mohamed,

I believe this is what i did already. I unpublished the variant i didnt want to show and then set the display out of stock products to no and have even disallowed wishlist. However i can still see the product and i can click on add to wishlist. Please see attached...

I think quite simply i shouldnt be able to select it from the dropdown if i have unpublished it in the backend. I have even deleted one of the variants and it still shows up. (85x55 one 500)

Thanks

Alex

Attachments:

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

  • Posts: 83995
  • Thank you received: 13605
  • MODERATOR
11 years 7 months ago #130969

If you want to remove the quantity field, simply change the "Display the quantity field on the product page" option of the configuration.

If the add to wishlist button is displayed, it means that you have some of the options of the wishlists turned on in the configuration. Please make sure that you turn them all off.

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

  • Posts: 377
  • Thank you received: 7
11 years 7 months ago #131582

Hi Nicolas,

I have managed to hide the qty field ok thanks.

I am still having no luck with hiding the unpublished variants. I have set all wishlist options to no and have unpublished the variant however i am still have to select it. Please see screen shots of my config, the variant and the product page, sorry this isn't making much sense to me, the wishlist option is quite obviously set to be disabled when it is still displaying on the front end..

Thanks

Alex

Attachments:

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

  • Posts: 26253
  • Thank you received: 4040
  • MODERATOR
11 years 7 months ago #131842

Hi,

I know that we made some hot fixes in the wishlists for HikaShop 2.2.2, so depending when you download HikaShop, it could be helpful to re-download it.

Kind regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 377
  • Thank you received: 7
11 years 7 months ago #131981

Hi Jerome,

After re-installing 2.2.2 this now hides the wishlist button which is great. For some reason however one of the variants i deleted still shows in the drop down, surely this is not correct? The variant i deleted is 85x55 one sided 500 however it can still be seen on the front end.

Thanks

Alex

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

  • Posts: 13201
  • Thank you received: 2322
11 years 7 months ago #132044

Hi,

To hide the wishlist button when the variant is unpublished, you can edit the view "product / quantity" via the menu display > Views and replace the code:

		<div class="hikashop_product_no_stock">
		<?php
			echo JText::_('NO_STOCK').'<br/>';
			$waitlist = $this->config->get('product_waitlist',0);
			if(hikashop_level(1) && ($waitlist==2 || ($waitlist==1 && (!empty($this->element->main->product_waitlist) || !empty($this->element->product_waitlist))))){ ?>
				</div><div id="hikashop_product_waitlist_main" class="hikashop_product_waitlist_main">
				<?php
				$empty='';
				jimport('joomla.html.parameter');
				$params = new HikaParameter($empty);
				echo $this->cart->displayButton(JText::_('ADD_ME_WAITLIST'),'add_waitlist',$params,hikashop_completeLink('product&task=waitlist&cid='.$this->row->product_id),'window.location=\''.str_replace("'","\'",hikashop_completeLink('product&task=waitlist&cid='.$this->row->product_id)).'\';return false;');


			}
			if(hikashop_level(1) && $this->params->get('add_to_wishlist')  && $wishlistEnabled  && !$hideForGuest && $this->config->get('display_add_to_wishlist_for_free_products','1')){
				echo '<div id="hikashop_add_wishlist">';
					echo $this->cart->displayButton(JText::_('ADD_TO_WISHLIST'),'add',$this->params,$url,$wishlistAjax,'',@$this->row->product_max_per_order,1,'',false);
				echo '</div>';
			}
		}?>
		</div>
By:
		<div class="hikashop_product_no_stock">
		<?php
			echo JText::_('NO_STOCK').'<br/>';
			$waitlist = $this->config->get('product_waitlist',0);
			if(hikashop_level(1) && ($waitlist==2 || ($waitlist==1 && (!empty($this->element->main->product_waitlist) || !empty($this->element->product_waitlist))))){ ?>
				</div><div id="hikashop_product_waitlist_main" class="hikashop_product_waitlist_main">
				<?php
				$empty='';
				jimport('joomla.html.parameter');
				$params = new HikaParameter($empty);
				echo $this->cart->displayButton(JText::_('ADD_ME_WAITLIST'),'add_waitlist',$params,hikashop_completeLink('product&task=waitlist&cid='.$this->row->product_id),'window.location=\''.str_replace("'","\'",hikashop_completeLink('product&task=waitlist&cid='.$this->row->product_id)).'\';return false;');


			}
$productClass = hikashop_get('class.product');
$full = $productClass->get($this->row->product_id);
			if($full->product_published && hikashop_level(1) && $this->params->get('add_to_wishlist')  && $wishlistEnabled  && !$hideForGuest && $this->config->get('display_add_to_wishlist_for_free_products','1')){
				echo '<div id="hikashop_add_wishlist">';
					echo $this->cart->displayButton(JText::_('ADD_TO_WISHLIST'),'add',$this->params,$url,$wishlistAjax,'',@$this->row->product_max_per_order,1,'',false);
				echo '</div>';
			}
		}?>
		</div>

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

Time to create page: 0.108 seconds
Powered by Kunena Forum