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

#   $product = $productClass-&gt;get($product\_id); is accesssing the wrong product

##

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

Less More

- Posts: 99
- Thank you received: 7
-
-

8 hours 8 minutes ago [\#100000788](#100000788) by [Markus Schnier](/forum/user/44597-markus-schnier "View Markus Schnier's Profile")  *[$product = $productClass-&gt;get($product\_id); is accesssing the wrong product](/forum/26-product-category-display/100000167-product-productclass-get-product-id-is-accesssing-the-wrong-product#100000788 "-- url of the page with the problem -- :   www.2-rad-schwede.de/  -- HikaShop version -- : 6.8.2 Business -- Joomla version -- : 5.4.10 -- PHP version -- : 8.4.28 -- Browser(s) name and version -- : Firefox 160.0  Hi,  Im using a site module and Sourcerer to calculate financing options as part of the product description. I access the product price via the product based on the product&#95;ID. The problem is that it's not the presented product.  Also strange. The related products (also presented via a site module) are also based on the wrong product and not on the shown one.   On my test site it's working but in production not. For test purposes I show some product details in the Finanzing tabs on the product site.   Any idea what is going wrong.  Thanks , Markus  Sourcecode : ")* was created by *[Markus Schnier](/forum/user/44597-markus-schnier "View Markus Schnier's Profile")*

-- url of the page with the problem -- : [ www.2-rad-schwede.de/](https://www.2-rad-schwede.de/)
-- HikaShop version -- : 6.8.2 Business
-- Joomla version -- : 5.4.10
-- PHP version -- : 8.4.28
-- Browser(s) name and version -- : Firefox 160.0

Hi,

Im using a site module and Sourcerer to calculate financing options as part of the product description. I access the product price via the product based on the product_ID. The problem is that it's not the presented product.

Also strange. The related products (also presented via a site module) are also based on the wrong product and not on the shown one. 

On my test site it's working but in production not. For test purposes I show some product details in the Finanzing tabs on the product site. 

Any idea what is going wrong.

Thanks ,
Markus

Sourcecode : 
Code:

&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Ratenkredit – Der flexible Kredit ab 0% Zinsen&lt;/strong&gt;&lt;br /&gt;Beim Ratenkredit sind Sie absolut individuell unterwegs. Eine Finanzierung wie für Sie gemacht. Wählen Sie aus verschiedenen Finanzierungsalternativen - ab einem Nominalzins von 0% und Laufzeiten bis zu 48 Monaten – ganz auf Ihre spezielle Situation und Bedürfnisse zugeschnitten.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; {source raw="true"} &lt;?php // HikaShop laden if (!@include_once(JPATH_ADMINISTRATOR . '/components/com_hikashop/helpers/helper.php')) {     return; } // Aktuelle Produkt-ID ermitteln $product_id = (int) hikashop_getCID('product_id'); $RadPreis = 0; if ($product_id &gt; 0) {     // Produkt direkt aus HikaShop laden     $productClass = hikashop_get('class.product');     $product = $productClass-&gt;get($product_id);     if ($product) {         // Produktpreis inklusive HikaShop-Rabatten ermitteln         $currencyClass = hikashop_get('class.currency');         $ids = array($product_id);         $options = array('no_discounts' =&gt; false);         $currencyClass-&gt;getProductPrices(             $product,             $ids,             $options         );         // Endgültigen Bruttopreis übernehmen         if (!empty($product-&gt;prices)) {             $RadPreis = (float) $product-&gt;prices[0]-&gt;price_value_with_tax;         }     } } echo " Rad: "; echo $product-&gt;product_name; echo " / Code: "; echo $product-&gt;product_code; // Ab hier bisherige Berechnung if ($RadPreis &gt; 0) {     $Kredit6Rate = $RadPreis / 6.000114298777;     $Kredit6Zins = 0;     $Kredit12Rate = $RadPreis / 11.7556824543724;     $Kredit12Zins = $RadPreis / 48.0263157894737;     $Kredit36Rate = $RadPreis / 33.9553686934023;     $Kredit36Zins = $RadPreis / 16.6959887403237;     echo "&lt;small&gt;&lt;ul&gt;";     echo "&lt;li&gt;&lt;strong&gt;0% Ratenkredit mit 6 Monaten Laufzeit&lt;br&gt;&lt;/strong&gt;";     echo "Bei einem Nettodarlehensbetrag von " . number_format($RadPreis, 2, ',', '.') . " € entspricht dies einer monatlichen Rate von " . number_format($Kredit6Rate, 2, ',', '.') . " € mit einem Sollzins (p.a. fest) von 0% und einem Eff. Jahreszins von 0%. Zinsen insgesamt von " . number_format($Kredit6Zins, 2, ',', '.') . " € und einem Gesamtbetrag von " . number_format($RadPreis + $Kredit6Zins, 2, ',', '.') . " €.&lt;/br&gt;&lt;/br&gt;";

- [ ![product.jpg](/forum/attachment/100000229) ](/forum/attachment/100000229 "product.jpg") [ ](/forum/attachment/100000229?download=1 "product.jpg")
- [ ![det2.jpg](/forum/attachment/100000230) ](/forum/attachment/100000230 "det2.jpg") [ ](/forum/attachment/100000230?download=1 "det2.jpg")
- [ ![shar.jpg](/forum/attachment/100000231) ](/forum/attachment/100000231 "shar.jpg") [ ](/forum/attachment/100000231?download=1 "shar.jpg")
- [ ![focus2.jpg](/forum/attachment/100000232) ](/forum/attachment/100000232 "focus2.jpg") [ ](/forum/attachment/100000232?download=1 "focus2.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS8xMDAwMDAxNjctcHJvZHVjdC1wcm9kdWN0Y2xhc3MtZ2V0LXByb2R1Y3QtaWQtaXMtYWNjZXNzc2luZy10aGUtd3JvbmctcHJvZHVjdD90bXBsPW1hcmtkb3du) 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.062 seconds

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