price_site_id

  • Posts: 234
  • Thank you received: 7
  • Hikashop Business
1 year 8 months ago #361058

Hello. What is the purpose of the price_site_id field in the hikashop_price table?

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

  • Posts: 85103
  • Thank you received: 13871
  • MODERATOR
1 year 8 months ago #361059

Hi,

It is for the integration made by JMS Multisites:
www.jms2win.com/
Thanks to this, you can create different slave websites with one Joomla website and provide different prices on each website for each product.
If you don't use JMS Multisites, then this column is not used.

The following user(s) said Thank You: Bender

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

  • Posts: 234
  • Thank you received: 7
  • Hikashop Business
1 week 6 days ago #370199

Hi, after updating to 6.2.0 I noticed an issue with price selection. If a product has two prices — one with a string in price_site_id and one with an empty price_site_id — the product page only shows the one with the Site ID, even if it's higher. However, the category listing still shows the lower (empty Site ID) price.

I have 'Show several prices' enabled, but var_dump($this->row->prices) in the template shows only one price object. It seems the core filters out the second price before it reaches the view. Is this an intended change in specificity logic?

var dump on product listing

array(1) { [0]=> object(stdClass)#5677 (13) { ["price_id"]=> int(191478) ["price_currency_id"]=> int(81) ["price_product_id"]=> int(56480) ["price_value"]=> string(12) "740503.68000" ["price_min_quantity"]=> int(0) ["price_access"]=> string(3) "all" ["price_site_id"]=> string(0) "" ["price_users"]=> string(0) "" ["price_start_date"]=> int(0) ["price_end_date"]=> int(0) ["price_zone_id"]=> string(0) "" ["price_value_with_tax"]=> float(858985) ["taxes"]=> array(1) { ["0000_00000003"]=> object(stdClass)#5667 (20) { ["taxation_id"]=> int(3) ["zone_namekey"]=> array(1) { [0]=> string(22) "country_Kazakhstan_109" } ["category_namekey"]=> string(11) "default_tax" ["tax_namekey"]=> string(15) "НДС 16% (KZ)" ["taxation_published"]=> int(1) ["taxation_type"]=> string(0) "" ["taxation_access"]=> string(3) "all" ["taxation_cumulative"]=> int(0) ["taxation_post_code"]=> string(0) "" ["taxation_date_start"]=> int(1767291300) ["taxation_date_end"]=> int(0) ["taxation_internal_code"]=> string(0) "" ["taxation_note"]=> string(57) "Налог на добавленную стоимость" ["taxation_site_id"]=> string(0) "" ["taxation_ordering"]=> int(0) ["tax_rate"]=> string(7) "0.16000" ["zone_type"]=> string(7) "country" ["tax_ratio"]=> int(1) ["tax_amount"]=> float(118481) ["amount"]=> float(740504) } } } } 858 985 KZT за шт.


vardump form product page

array(1) { [0]=> object(stdClass)#5309 (14) { ["price_id"]=> int(191483) ["price_currency_id"]=> int(81) ["price_product_id"]=> int(56480) ["price_value"]=> string(12) "623793.10345" ["price_min_quantity"]=> int(0) ["price_access"]=> string(3) "all" ["price_site_id"]=> string(1) "A" ["price_users"]=> string(0) "" ["price_start_date"]=> int(0) ["price_end_date"]=> int(0) ["price_zone_id"]=> string(0) "" ["price_value_with_tax"]=> float(723600) ["taxes_added"]=> bool(true) ["taxes"]=> array(1) { ["0000_00000003"]=> object(stdClass)#5307 (20) { ["taxation_id"]=> int(3) ["zone_namekey"]=> array(1) { [0]=> string(22) "country_Kazakhstan_109" } ["category_namekey"]=> string(11) "default_tax" ["tax_namekey"]=> string(15) "НДС 16% (KZ)" ["taxation_published"]=> int(1) ["taxation_type"]=> string(0) "" ["taxation_access"]=> string(3) "all" ["taxation_cumulative"]=> int(0) ["taxation_post_code"]=> string(0) "" ["taxation_date_start"]=> int(1767291300) ["taxation_date_end"]=> int(0) ["taxation_internal_code"]=> string(0) "" ["taxation_note"]=> string(57) "Налог на добавленную стоимость" ["taxation_site_id"]=> string(0) "" ["taxation_ordering"]=> int(0) ["tax_rate"]=> string(7) "0.16000" ["zone_type"]=> string(7) "country" ["tax_ratio"]=> int(1) ["tax_amount"]=> float(99807) ["amount"]=> float(623793) } } } }

Last edit: 1 week 6 days ago by Bender.

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

  • Posts: 85103
  • Thank you received: 13871
  • MODERATOR
1 week 6 days ago #370201

Hi,

I checked the code relative to price_site_id in administrator/components/com_hikashop/classes/currency.php
However, no modification was made on that code in years.
There is no particular intention. The code handling the price_site_id was added following the recommendations of the developer of JMS Multisites more than 10 years ago and it wasn't changed since then as far as I know.

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

  • Posts: 234
  • Thank you received: 7
  • Hikashop Business
1 week 5 days ago #370215

Hi Nicolas,

I understand that this field is related to old JMS Multisites logic. We don't mind the legacy code, but there is a clear inconsistency in how it behaves now.

The issue is that the category listing and the product page use different logic for the same data. The listing shows the lower price (ignoring the Site ID), while the product page filters it out. Even with 'Show several prices' enabled, the array is truncated before reaching the template.

If the core logic treats a non-empty price_site_id as a strict priority filter even when no multisite environment is present, it effectively breaks the price display settings for many users. We'll find a workaround on our end, but you might want to check why the fetching logic differs so much between the listing and the product view.

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

  • Posts: 85103
  • Thank you received: 13871
  • MODERATOR
1 week 4 days ago #370217

Hello,

Thank you for your patience.

We have unified the logic for price_site_id handling between the product listings and the product details page. Previously, there were slight differences in how the system prioritized the prices, which effectively lead to the inconsistencies you observed.

We have implemented a shared mechanism that is now used by both views. This ensures that the exact same logic is applied everywhere to determine which price takes precedence, based on the price_site_id and whether the JMS Multisites component is installed or not.

This modification will be included in the next release (HikaShop 6.3.0).

The following user(s) said Thank You: Bender

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

Time to create page: 0.062 seconds
Powered by Kunena Forum