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

#   varient price won't work in mobile view

##

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

Less More

- Posts: 47
- Thank you received: 3
-
-

1 year 8 months ago [\#365818](#365818) by [diacotm](/forum/user/52238-diacotm "View diacotm's Profile")  *[varient price won't work in mobile view](/forum/31-development/909185-varient-price-wont-work-in-mobile-view#365818 "-- HikaShop version -- : 5.0.2 -- Joomla version -- : 5.1.4 -- PHP version -- : 8.02  Hi, I use variants to have different prices for my products by some characteristics, in the desktop view price will update by selecting different characters but in the mobile view it seems it is disabled and does not update the price, how can I fix this issue?  Thanks in advance")* was created by *[diacotm](/forum/user/52238-diacotm "View diacotm's Profile")*

-- HikaShop version -- : 5.0.2
-- Joomla version -- : 5.1.4
-- PHP version -- : 8.02

Hi,
I use variants to have different prices for my products by some characteristics, in the desktop view price will update by selecting different characters but in the mobile view it seems it is disabled and does not update the price, how can I fix this issue?

Thanks in advance

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50LzkwOTE4NS12YXJpZW50LXByaWNlLXdvbi10LXdvcmstaW4tbW9iaWxlLXZpZXc/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14280
-
-

1 year 8 months ago [\#365821](#365821) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[varient price won't work in mobile view](/forum/31-development/909185-varient-price-wont-work-in-mobile-view#365821 "-- HikaShop version -- : 5.0.2 -- Joomla version -- : 5.1.4 -- PHP version -- : 8.02  Hi, I use variants to have different prices for my products by some characteristics, in the desktop view price will update by selecting different characters but in the mobile view it seems it is disabled and does not update the price, how can I fix this issue?  Thanks in advance")*

Hi,

I can see that the view files are heavily customized. And a major change is that you have the price area twice, once for the desktop and one for the mobile.
And it's not only for the price but also for the add to cart button.
I'm afraid you might have the same issue with the add to cart button: On mobile, once you change the selected variant and click on the add to cart button, you might get the default product added to the cart.

Instead of having twice the HTML of these areas on the page, I would recommend to have it only once, and change the display with CSS to make the price / add to cart area fixed at the bottom.

However, seeing all the work already made to customize the display, an easier solution might be to edit the javascript of the show_block_characteristic view file in order to update the HTML of the main areas not based on the ID (as you can only have one element with one ID on a page with HTML, which is what is causing your problem), but based on the class, with a loop as to update all the main areas, both the one for mobile and the one for desktop.
You'll want to adapt the code in the javascript function hikashopUpdateVariantData

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50LzkwOTE4NS12YXJpZW50LXByaWNlLXdvbi10LXdvcmstaW4tbW9iaWxlLXZpZXc/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 47
- Thank you received: 3
-
-

1 year 8 months ago [\#365824](#365824) by [diacotm](/forum/user/52238-diacotm "View diacotm's Profile")  Replied by *[diacotm](/forum/user/52238-diacotm "View diacotm's Profile")* on topic *[varient price won't work in mobile view](/forum/31-development/909185-varient-price-wont-work-in-mobile-view#365824 "-- HikaShop version -- : 5.0.2 -- Joomla version -- : 5.1.4 -- PHP version -- : 8.02  Hi, I use variants to have different prices for my products by some characteristics, in the desktop view price will update by selecting different characters but in the mobile view it seems it is disabled and does not update the price, how can I fix this issue?  Thanks in advance")*

Hi,
Thanks for the help,
but I don't know exactly what to do, cause I don't know the javascript, is it possible to tell me what to do?
and also about the desktop and mobile view, as you can see I delete the desktop view code completely in the mobile view, is it still affecting the code?
Thanks in advance

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50LzkwOTE4NS12YXJpZW50LXByaWNlLXdvbi10LXdvcmstaW4tbW9iaWxlLXZpZXc/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 47
- Thank you received: 3
-
-

1 year 8 months ago [\#365828](#365828) by [diacotm](/forum/user/52238-diacotm "View diacotm's Profile")  Replied by *[diacotm](/forum/user/52238-diacotm "View diacotm's Profile")* on topic *[varient price won't work in mobile view](/forum/31-development/909185-varient-price-wont-work-in-mobile-view#365828 "-- HikaShop version -- : 5.0.2 -- Joomla version -- : 5.1.4 -- PHP version -- : 8.02  Hi, I use variants to have different prices for my products by some characteristics, in the desktop view price will update by selecting different characters but in the mobile view it seems it is disabled and does not update the price, how can I fix this issue?  Thanks in advance")*

Hi,
I deleted the desktop view code and tested it again, everything works fine;
Is it possible to put desktop and mobile code in two separate PHP files to load each one when the viewport is set?
Thanks in advanced

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50LzkwOTE4NS12YXJpZW50LXByaWNlLXdvbi10LXdvcmstaW4tbW9iaWxlLXZpZXc/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14280
-
-

1 year 8 months ago [\#365830](#365830) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[varient price won't work in mobile view](/forum/31-development/909185-varient-price-wont-work-in-mobile-view#365830 "-- HikaShop version -- : 5.0.2 -- Joomla version -- : 5.1.4 -- PHP version -- : 8.02  Hi, I use variants to have different prices for my products by some characteristics, in the desktop view price will update by selecting different characters but in the mobile view it seems it is disabled and does not update the price, how can I fix this issue?  Thanks in advance")*

Hi,

Sure, that would indeed be better.
You can use a PHP library like Mobile Detect : [ docs.mobiledetect.net/home](https://docs.mobiledetect.net/home)
Then, once you detect if you're on mobile or not, you can require one PHP file or the other.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2RldmVsb3BtZW50LzkwOTE4NS12YXJpZW50LXByaWNlLXdvbi10LXdvcmstaW4tbW9iaWxlLXZpZXc/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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.080 seconds

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