"Product Options" with "Characteristics"

  • Posts: 69
  • Thank you received: 0
12 years 5 months ago #55890

Hi

I have added single products as "Product Options" and it works fine, the option is only added to the basket if the user selects "Yes" ... :-)

Problem comes when I add a "product with characteristics" as an additional "Option" for another product.

I have created "products with characteristics" eg (10, 100) which represents pack size of items required

Because a "product with characteristics" shows an associated default value and not "No" and "Yes (+ Price)", the product is added to the basket even if the user hasn't selected it.

I have tried different work a rounds but no success.

Is it possible to use a "products with characteristics" as an option for another product without it automatically adding to the basket ?

Thanks

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

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
12 years 5 months ago #55951

Hi,

That's indeed the case. You have two solutions.

One is to have an additional value to your characteristic representing that "no" value.

The second is to add the line:
$this->values[] = JHTML::_('select.option', 0,JText::_('HIKASHOP_NO'));

before the line:
foreach($optionElement->variants as $variant){

in the file "option" of the view "product" via the menu Display->Views.

The following user(s) said Thank You: JIK, Pit Pony

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

  • Posts: 69
  • Thank you received: 0
12 years 5 months ago #58842

Hi

I tried the second solution with the line of code and I could not get it to work...

So then went back to the first with an additional characteristic representing a 'no' value and successfully created a solution...

Problem is when I add to basket it also adds the 'no' characteristic value items...

Is there a way to stop the characteristics with 'no' value being added to the basket ?

Thanks

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

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
12 years 5 months ago #58887

If the second option didn't work, maybe it's because you were editing the file for the wrong template.

It's not possible to not have the "no" value with the first solution. However, the second solution will do that automatically.

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

  • Posts: 69
  • Thank you received: 0
12 years 5 months ago #58911

Hi

Have managed to get the second solution partly working adding text to view :)

The 'No' value shows in the drop down menu of an added option with characteristics.

The problem now is how do I get the 'No' value to become the default value of the option with characteristics as the set characteristic default value still shows

Thanks

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

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
12 years 5 months ago #58957

You can remove the line:
$value = $variant->product_id;

in that same view file for that.

The following user(s) said Thank You: Pit Pony

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

  • Posts: 209
  • Thank you received: 18
11 years 5 months ago #113670

Hi, I'm trying to upgrade a site to HS version 2.2 and have hit a problem similar to the above posts with adding options to products where the option product has variants.

In my old version, I have a product called "T Shirt" with variants as follows:
No (zero price and quantity set to zero)
Black - XS ($20 price and quantity unlimited)
Black - S ($20 price and quantity unlimited) etc

I set the price on the T Shirt itself to zero so that it picks up the prices from the variants. I set the default variant to "No".
This works perfectly in HS v1.5.8 where the option is shown as a dropdown box, defaulting to No and does not add it to the cart if the No is selected.

However, in ver 2.2.0, the "T Shirt" option ignores the No variant and displays just the priced variants. (I have "show out of stock products" set to yes in both versions). Pic shows dropdown display where variant No has quantity set to zero - choosing any of the size options successfully adds to the cart.



If I set the quantity of the No variant to Unlimited it shows the No variant in the dropdown but WON'T add any of the priced variants to the cart. Pic below shows dropdown display where variant No has quantity set to Unlimited.


Hope you can shed light on this issue. I can provide logins to both the live and upgrade-in-progress sites if you need to look around.

Cheers

Attachments:

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

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
11 years 5 months ago #113962

Hi,

Thank you for the report.

As far as I can see, the variants of options without quantity have never (for 1 year at least) taken into account the "show out of stock product" option.

You can change that by editing the file "option" of the view "product" and changing the line:
if(!$variant->product_published || empty($variant->product_quantity)) continue;

to:
if(!$variant->product_published || (!$this->config->get('show_out_of_stock',1) && empty($variant->product_quantity))) continue;

I didn't find any issue with the add to cart on my end, regardless of how I configured the options/product.

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

Time to create page: 0.085 seconds
Powered by Kunena Forum