[Skip to main content](#vessel-content)

#   Price and stock don't update when picking another variant

##

- **[nrgiser](/forum/user/39434-nrgiser "View nrgiser's Profile")**
- [![nrgiser's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39434-nrgiser "View nrgiser's Profile") Topic Author
- [ Offline](/forum/user/39434-nrgiser)

Less More

- Posts: 17
- Thank you received: 0
-
-

8 years 8 months ago [\#289579](#289579) by [nrgiser](/forum/user/39434-nrgiser "View nrgiser's Profile")  *[Price and stock don't update when picking another variant](/forum/26-product-category-display/894112-price-and-stock-dont-update-when-picking-another-variant#289579 "-- url of the page with the problem -- :   staging6.2-sleep.be/index.php/categoriee...ue-check-kussensloop  -- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.5 (3.8.6 just came out a few hours ago) -- PHP version -- : 7.0.27 -- Browser(s) name and version -- : Google Chrome 64.0.3282.186  Hi,  The URL above points to a product with 5 variants. 1 of them has a price 41,32 and a stock of 10, a second one has the same price but a stock of 15 and the other 3 have no stock and a price of 49,59.  The one with the stock of 15 is the default variant. When opening the above URL the stock and price of the default variant is shown. But when I pick another variant, the stock and price stay doesn't change. I'm 100% sure that the price used to change when picking another variant. The stock I don't know because I just activated that a few days ago.  What could be causing this problem?  Kind regards,  Jan Buskens")* was created by *[nrgiser](/forum/user/39434-nrgiser "View nrgiser's Profile")*

-- url of the page with the problem -- : [ staging6.2-sleep.be/index.php/categoriee...ue-check-kussensloop](http://staging6.2-sleep.be/index.php/categorieen/product/134575-haestens-original-double-blue-check-kussensloop)
-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.5 (3.8.6 just came out a few hours ago)
-- PHP version -- : 7.0.27
-- Browser(s) name and version -- : Google Chrome 64.0.3282.186

Hi,

The URL above points to a product with 5 variants. 1 of them has a price 41,32 and a stock of 10, a second one has the same price but a stock of 15 and the other 3 have no stock and a price of 49,59.

The one with the stock of 15 is the default variant. When opening the above URL the stock and price of the default variant is shown. But when I pick another variant, the stock and price stay doesn't change.
I'm 100% sure that the price used to change when picking another variant. The stock I don't know because I just activated that a few days ago.

What could be causing this problem?

Kind regards,

Jan Buskens

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQxMTItcHJpY2UtYW5kLXN0b2NrLWRvbnQtdXBkYXRlLXdoZW4tcGlja2luZy1hbm90aGVyLXZhcmlhbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

8 years 8 months ago [\#289584](#289584) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Price and stock don't update when picking another variant](/forum/26-product-category-display/894112-price-and-stock-dont-update-when-picking-another-variant#289584 "-- url of the page with the problem -- :   staging6.2-sleep.be/index.php/categoriee...ue-check-kussensloop  -- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.5 (3.8.6 just came out a few hours ago) -- PHP version -- : 7.0.27 -- Browser(s) name and version -- : Google Chrome 64.0.3282.186  Hi,  The URL above points to a product with 5 variants. 1 of them has a price 41,32 and a stock of 10, a second one has the same price but a stock of 15 and the other 3 have no stock and a price of 49,59.  The one with the stock of 15 is the default variant. When opening the above URL the stock and price of the default variant is shown. But when I pick another variant, the stock and price stay doesn't change. I'm 100% sure that the price used to change when picking another variant. The stock I don't know because I just activated that a few days ago.  What could be causing this problem?  Kind regards,  Jan Buskens")*

Hello,

Do you have an override for the characteristic selector ?
It would be a file in your template folder ( html/hikashop_characteristics.php )

CF : [ www.hikashop.com/support/documentation/6...tation.html#override](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#override)

Regards,

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQxMTItcHJpY2UtYW5kLXN0b2NrLWRvbnQtdXBkYXRlLXdoZW4tcGlja2luZy1hbm90aGVyLXZhcmlhbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nrgiser](/forum/user/39434-nrgiser "View nrgiser's Profile")**
- [![nrgiser's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39434-nrgiser "View nrgiser's Profile") Topic Author
- [ Offline](/forum/user/39434-nrgiser)

Less More

- Posts: 17
- Thank you received: 0
-
-

8 years 8 months ago [\#289616](#289616) by [nrgiser](/forum/user/39434-nrgiser "View nrgiser's Profile")  Replied by *[nrgiser](/forum/user/39434-nrgiser "View nrgiser's Profile")* on topic *[Price and stock don't update when picking another variant](/forum/26-product-category-display/894112-price-and-stock-dont-update-when-picking-another-variant#289616 "-- url of the page with the problem -- :   staging6.2-sleep.be/index.php/categoriee...ue-check-kussensloop  -- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.5 (3.8.6 just came out a few hours ago) -- PHP version -- : 7.0.27 -- Browser(s) name and version -- : Google Chrome 64.0.3282.186  Hi,  The URL above points to a product with 5 variants. 1 of them has a price 41,32 and a stock of 10, a second one has the same price but a stock of 15 and the other 3 have no stock and a price of 49,59.  The one with the stock of 15 is the default variant. When opening the above URL the stock and price of the default variant is shown. But when I pick another variant, the stock and price stay doesn't change. I'm 100% sure that the price used to change when picking another variant. The stock I don't know because I just activated that a few days ago.  What could be causing this problem?  Kind regards,  Jan Buskens")*

Yes, there is.

Since I can't attach it, below you can find the code that's in it.
Code:

&lt;?php defined('_JEXEC') or die('Restricted access'); ?&gt; &lt;?php function hikashop_characteristics_html(&amp;$element,&amp;$params,&amp;$obj){ switch($params-&gt;get('characteristic_display')){ case 'table': if(count($obj-&gt;characteristics)==2){ $html = ''; $firstCharacteristic = reset($obj-&gt;characteristics); $secondCharacteristic = end($obj-&gt;characteristics); $html.= '&lt;table class="hikashop_product_characteristic_chooser"&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;'; if(!empty($secondCharacteristic-&gt;values)){ foreach($secondCharacteristic-&gt;values as $value){ $html.='&lt;td&gt;'.$value-&gt;characteristic_value.'&lt;/td&gt;'; } } $html.='&lt;/tr&gt;'; $obj-&gt;options=' onclick="return hikashopUpdateVariantData(this.value);"'; $size=0; if(!empty($firstCharacteristic-&gt;values)){ foreach($firstCharacteristic-&gt;values as $value){ $html.='&lt;tr&gt;&lt;td style="text-align:right"&gt;'.$value-&gt;characteristic_value.'&lt;/td&gt;'; if(strlen($value-&gt;characteristic_value)&gt;$size)$size=strlen($value-&gt;characteristic_value); if(!empty($secondCharacteristic-&gt;values)){ foreach($secondCharacteristic-&gt;values as $value2){ $class = ''; $classspan = ''; foreach($element-&gt;variants as $k =&gt; $variant){ $char1 = false; $char2 = false; foreach($variant-&gt;characteristics as $variantCharacteristic){ if($variantCharacteristic-&gt;characteristic_id==$value-&gt;characteristic_id){ $char1 = true; }elseif($variantCharacteristic-&gt;characteristic_id==$value2-&gt;characteristic_id){ $char2 = true; } if($char1&amp;&amp;$char2){ if(!$variant-&gt;product_published &#124;&#124; $variant-&gt;product_quantity==0){ $class = ' hikashop_product_variant_out_of_stock'; $classspan=' hikashop_product_variant_out_of_stock_span'; } break 2; } } } $name = '_'.$value-&gt;characteristic_id.'_'.$value2-&gt;characteristic_id; $radio="\n\t&lt;span class=\"hikashop_product_characteristic_span".$classspan."\"&gt;&lt;input type=\"radio\" class=\"hikashop_product_characteristic".$class."\" name=\"hikashop_product_characteristic\" id=\"hikashop_product_characteristic".$name."\" value=\"".$name."\" ".$obj-&gt;options; if($obj-&gt;characteristics[$value-&gt;characteristic_parent_id]-&gt;default-&gt;characteristic_id==$value-&gt;characteristic_id &amp;&amp; !empty($obj-&gt;characteristics[$value2-&gt;characteristic_parent_id]-&gt;default-&gt;characteristic_id) &amp;&amp; $obj-&gt;characteristics[$value2-&gt;characteristic_parent_id]-&gt;default-&gt;characteristic_id==$value2-&gt;characteristic_id){ $radio.=' checked'; } $radio.=" /&gt;&lt;/span&gt;"; $html.='&lt;td&gt;'.$radio.'&lt;/td&gt;'; } } $html.='&lt;/tr&gt;'; } } $html.='&lt;/table&gt;'; if($params-&gt;get('characteristic_display_text')){ $space = ''; for($i=0;$i&lt;=$size;$i++){ $space.='&amp;nbsp;&amp;nbsp;'; } $html='&lt;table class="hikashop_product_characteristic_chooser"&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td class="hikashop_charactersitic_name"&gt;'.$space.@$secondCharacteristic-&gt;characteristic_value.'&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="hikashop_charactersitic_name"&gt;'.$firstCharacteristic-&gt;characteristic_value.'&lt;/td&gt;&lt;td&gt;'.$html.'&lt;/td&gt;&lt;/table&gt;'; } break; } default: case 'radio': case 'dropdown': $main_html = '&lt;table class="hikashop_product_characteristics_table"&gt;'; $config =&amp; hikashop_config(); foreach($obj-&gt;characteristics as $characteristic){ $main_html.='&lt;tr style="vertical-align: top;"&gt;'; $values = array(); $switch_done = false; if(!empty($characteristic-&gt;values)){ foreach($characteristic-&gt;values as $k =&gt; $value){ if(!$config-&gt;get('show_out_of_stock',1)){ $hasQuantity = false; foreach($element-&gt;variants as $variant){ foreach($variant-&gt;characteristics as $variantCharacteristic){ if($variantCharacteristic-&gt;characteristic_id==$value-&gt;characteristic_id){ if($variant-&gt;product_quantity != 0){ $hasQuantity = true; }elseif( $element-&gt;product_id==$variant-&gt;product_id &amp;&amp; !$switch_done){ $id = 'hikashop_product_characteristic_'.$characteristic-&gt;characteristic_id; $js = " window.hikashop.ready( function() {hikashopUpdateVariant(document.getElementById('".$id."'));});"; if (!HIKASHOP_PHP5) { $doc =&amp; JFactory::getDocument(); }else{ $doc = JFactory::getDocument(); } $doc-&gt;addScriptDeclaration("\n&lt;!--\n".$js."\n//--&gt;\n"); $switch_done = true; } } } } if(!$hasQuantity) continue; } $values[$k]=$value-&gt;characteristic_value; } } $html=$obj-&gt;display(@$characteristic-&gt;characteristic_id,@$characteristic-&gt;default-&gt;characteristic_id,$values,$characteristic-&gt;characteristic_display_method); if($params-&gt;get('characteristic_display_text') &amp;&amp; isset($characteristic-&gt;characteristic_value)){ $html=$characteristic-&gt;characteristic_value.'&lt;/td&gt;&lt;td&gt;'.$html; } $main_html.='&lt;td&gt;'.$html.'&lt;/td&gt;&lt;/tr&gt;'; } $main_html.='&lt;/table&gt;'; $html = $main_html; break; } return $html; } ?&gt;

Did I break it myself?

Kind regards,

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQxMTItcHJpY2UtYW5kLXN0b2NrLWRvbnQtdXBkYXRlLXdoZW4tcGlja2luZy1hbm90aGVyLXZhcmlhbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

8 years 8 months ago [\#289624](#289624) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Price and stock don't update when picking another variant](/forum/26-product-category-display/894112-price-and-stock-dont-update-when-picking-another-variant#289624 "-- url of the page with the problem -- :   staging6.2-sleep.be/index.php/categoriee...ue-check-kussensloop  -- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.5 (3.8.6 just came out a few hours ago) -- PHP version -- : 7.0.27 -- Browser(s) name and version -- : Google Chrome 64.0.3282.186  Hi,  The URL above points to a product with 5 variants. 1 of them has a price 41,32 and a stock of 10, a second one has the same price but a stock of 15 and the other 3 have no stock and a price of 49,59.  The one with the stock of 15 is the default variant. When opening the above URL the stock and price of the default variant is shown. But when I pick another variant, the stock and price stay doesn't change. I'm 100% sure that the price used to change when picking another variant. The stock I don't know because I just activated that a few days ago.  What could be causing this problem?  Kind regards,  Jan Buskens")*

Hi,

Well that's code coming from the template or added by yourself.
Apparently, it is missing some pieces.
Rename that file to something else in order to deactivate it.
That way, you'll use the default characteristics selector of HikaShop and it should work properly.
You might want to report that to your template provider.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQxMTItcHJpY2UtYW5kLXN0b2NrLWRvbnQtdXBkYXRlLXdoZW4tcGlja2luZy1hbm90aGVyLXZhcmlhbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nrgiser](/forum/user/39434-nrgiser "View nrgiser's Profile")**
- [![nrgiser's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39434-nrgiser "View nrgiser's Profile") Topic Author
- [ Offline](/forum/user/39434-nrgiser)

Less More

- Posts: 17
- Thank you received: 0
-
-

8 years 8 months ago [\#289871](#289871) by [nrgiser](/forum/user/39434-nrgiser "View nrgiser's Profile")  Replied by *[nrgiser](/forum/user/39434-nrgiser "View nrgiser's Profile")* on topic *[Price and stock don't update when picking another variant](/forum/26-product-category-display/894112-price-and-stock-dont-update-when-picking-another-variant#289871 "-- url of the page with the problem -- :   staging6.2-sleep.be/index.php/categoriee...ue-check-kussensloop  -- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.5 (3.8.6 just came out a few hours ago) -- PHP version -- : 7.0.27 -- Browser(s) name and version -- : Google Chrome 64.0.3282.186  Hi,  The URL above points to a product with 5 variants. 1 of them has a price 41,32 and a stock of 10, a second one has the same price but a stock of 15 and the other 3 have no stock and a price of 49,59.  The one with the stock of 15 is the default variant. When opening the above URL the stock and price of the default variant is shown. But when I pick another variant, the stock and price stay doesn't change. I'm 100% sure that the price used to change when picking another variant. The stock I don't know because I just activated that a few days ago.  What could be causing this problem?  Kind regards,  Jan Buskens")*

Hi,

That was indeed the problem.
Where can I find the original file? I would like to compare it with the override file.

Kind regards,

Jan Buskens

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQxMTItcHJpY2UtYW5kLXN0b2NrLWRvbnQtdXBkYXRlLXdoZW4tcGlja2luZy1hbm90aGVyLXZhcmlhbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86576
- Thank you received: 14320
-
-

8 years 8 months ago [\#289893](#289893) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Price and stock don't update when picking another variant](/forum/26-product-category-display/894112-price-and-stock-dont-update-when-picking-another-variant#289893 "-- url of the page with the problem -- :   staging6.2-sleep.be/index.php/categoriee...ue-check-kussensloop  -- HikaShop version -- : 3.3.0 -- Joomla version -- : 3.8.5 (3.8.6 just came out a few hours ago) -- PHP version -- : 7.0.27 -- Browser(s) name and version -- : Google Chrome 64.0.3282.186  Hi,  The URL above points to a product with 5 variants. 1 of them has a price 41,32 and a stock of 10, a second one has the same price but a stock of 15 and the other 3 have no stock and a price of 49,59.  The one with the stock of 15 is the default variant. When opening the above URL the stock and price of the default variant is shown. But when I pick another variant, the stock and price stay doesn't change. I'm 100% sure that the price used to change when picking another variant. The stock I don't know because I just activated that a few days ago.  What could be causing this problem?  Kind regards,  Jan Buskens")*

Hi,

The file you want to look at is administrator/components/com_hikahsop/types/characteristic.php
Note that it's not a direct copy of the code. Some things have to be modified for the override to work.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTQxMTItcHJpY2UtYW5kLXN0b2NrLWRvbnQtdXBkYXRlLXdoZW4tcGlja2luZy1hbm90aGVyLXZhcmlhbnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.065 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
