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

#   Code PHP pour obtenir le lien de l'image d'une option

##

- **Laurentfrom47**
- ![Laurentfrom47's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg) Topic Author

Less More

- Thank you received: 0
-
-

7 years 11 months ago [\#301560](#301560) by Laurentfrom47  *[Code PHP pour obtenir le lien de l'image d'une option](/forum/5-support-en-francais-french-support-/896443-code-php-pour-obtenir-le-lien-de-limage-dune-option#301560 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : Last -- PHP version -- : 7.2  Bonjour,  Je souhaiterai afficher en tooltip au survol de souris l'image de l'option   i.imgur.com/TRGwh14.jpg , je dois pour cela modifier je pense le fichier option.php et je pense que ça se passe ici :  Auriez-vous les codes PHP pour obtenir l'URL de l'image de l'option ?  Je pense utiliser Tooltips de regularlabs :  Merci.")* was created by *Laurentfrom47*

-- HikaShop version -- : 4.0.1 business
-- Joomla version -- : Last
-- PHP version -- : 7.2

Bonjour,

Je souhaiterai afficher en tooltip au survol de souris l'image de l'option [ i.imgur.com/TRGwh14.jpg](https://i.imgur.com/TRGwh14.jpg), je dois pour cela modifier je pense le fichier option.php et je pense que ça se passe ici : Code:

&lt;span class="hikashop_option_name"&gt; &lt;?php echo $optionInfo-&gt;product_name . $options; ?&gt; &lt;/span&gt;

Auriez-vous les codes PHP pour obtenir l'URL de l'image de l'option ?

Je pense utiliser Tooltips de regularlabs : Code:

{tip image="images/option1.jpg" image_height="150" image_width="200"}Nom de l'option 1{/tip}

Merci.

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

- **Laurentfrom47**
- ![Laurentfrom47's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg) Topic Author

Less More

- Thank you received: 0
-
-

7 years 11 months ago [\#301564](#301564) by Laurentfrom47  Replied by *Laurentfrom47* on topic *[Code PHP pour obtenir le lien de l'image d'une option](/forum/5-support-en-francais-french-support-/896443-code-php-pour-obtenir-le-lien-de-limage-dune-option#301564 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : Last -- PHP version -- : 7.2  Bonjour,  Je souhaiterai afficher en tooltip au survol de souris l'image de l'option   i.imgur.com/TRGwh14.jpg , je dois pour cela modifier je pense le fichier option.php et je pense que ça se passe ici :  Auriez-vous les codes PHP pour obtenir l'URL de l'image de l'option ?  Je pense utiliser Tooltips de regularlabs :  Merci.")*

C'est bon merci j'ai trouvé [ www.hikashop.com/forum/product-category-...-in-the-tooltip.html](https://www.hikashop.com/forum/product-category-display/887193-display-product-option-s-image-in-the-tooltip.html)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODk2NDQzLWNvZGUtcGhwLXBvdXItb2J0ZW5pci1sZS1saWVuLWRlLWxpbWFnZS1kdW5lLW9wdGlvbj90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

7 years 11 months ago [\#301565](#301565) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Code PHP pour obtenir le lien de l'image d'une option](/forum/5-support-en-francais-french-support-/896443-code-php-pour-obtenir-le-lien-de-limage-dune-option#301565 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : Last -- PHP version -- : 7.2  Bonjour,  Je souhaiterai afficher en tooltip au survol de souris l'image de l'option   i.imgur.com/TRGwh14.jpg , je dois pour cela modifier je pense le fichier option.php et je pense que ça se passe ici :  Auriez-vous les codes PHP pour obtenir l'URL de l'image de l'option ?  Je pense utiliser Tooltips de regularlabs :  Merci.")*

Bonjour,

Il n'y a pas de code tout fait. Déjà, les données des images des options ne sont pas chargées. Docn il va d'abord falloir faire une requête MySQL sur la table hikashop_file avec le file_ref_id égal à $optionInfo-&gt;product_id et the file_ref_id égal à product.
une fois que vous avez les données sous forme d'objet dans une variable, vous pouvez faire cela: Code:

$img = $this-&gt;image-&gt;getThumbnail($image-&gt;file_path, array('width' =&gt; '100', 'height' =&gt; '100'), array('default' =&gt; true,'forcesize'=&gt;$this-&gt;config-&gt;get('image_force_size',true),'scale'=&gt;$this-&gt;config-&gt;get('image_scale_mode','inside'))); if($img-&gt;success) echo $img-&gt;url;

The following user(s) said Thank You: Laurentfrom47

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

- **Laurentfrom47**
- ![Laurentfrom47's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg) Topic Author

Less More

- Thank you received: 0
-
-

7 years 11 months ago -  7 years 11 months ago [\#301612](#301612) by Laurentfrom47  Replied by *Laurentfrom47* on topic *[Code PHP pour obtenir le lien de l'image d'une option](/forum/5-support-en-francais-french-support-/896443-code-php-pour-obtenir-le-lien-de-limage-dune-option#301612 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : Last -- PHP version -- : 7.2  Bonjour,  Je souhaiterai afficher en tooltip au survol de souris l'image de l'option   i.imgur.com/TRGwh14.jpg , je dois pour cela modifier je pense le fichier option.php et je pense que ça se passe ici :  Auriez-vous les codes PHP pour obtenir l'URL de l'image de l'option ?  Je pense utiliser Tooltips de regularlabs :  Merci.")*

Bonsoir,

Merci pour votre proposition, en fait j'ai opté pour une autre méthode avec le plugin tooltips de regularlabs, j'utilise ce code dans options.php :
Code:

if(!empty($optionInfo-&gt;product_description)) { $description = JHTML::_('content.prepare',$optionInfo-&gt;product_description); $options = '{tip title="'.$optionInfo-&gt;product_name.'" content="' . $description . '"}&lt;span class="hikashop_option_info" alt="Information"&gt;&lt;/span&gt;{/tip}'; }

le problème est que lorsque la première fois on clique sur l'icone infos de la première option calle pied la tooltip n'est pas bien positionnée (dés le 2eme essai, c'est bon), je ne comprend pas pourquoi, j'ai essayé de demandé à regularlabs d’après lui cela viendrait peut être de hikashop :

> There is '\_\_\_RL\_PROTECTED\_\_\_' code inside the tooltips.
> This is code that gets temporarily added to the content during rendering and should be removed/converted before the final rendering stages.
> For some reason that is not happening on your product page.
>
> So it looks like the places where you are using Tooltips in the hikashop item are not passed through the Joomla plugins correctly, or something.
> So it seems you cannot use Tooltips there. Not in a stable manner at least.

Peut être qu'il y aurait un truc à modifier dans mon code ?

[ v2.tricycle-leconfortable.fr/tricycles/t...adulte-lucycle-femme](https://v2.tricycle-leconfortable.fr/tricycles/tricycle-adulte-lucycle-femme)

Merci.

Last edit: 7 years 11 months ago by Laurentfrom47.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODk2NDQzLWNvZGUtcGhwLXBvdXItb2J0ZW5pci1sZS1saWVuLWRlLWxpbWFnZS1kdW5lLW9wdGlvbj90bXBsPW1hcmtkb3du) 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: 26400
- Thank you received: 4080
-
- [](http://obsi.dev)
-

7 years 11 months ago [\#301629](#301629) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Code PHP pour obtenir le lien de l'image d'une option](/forum/5-support-en-francais-french-support-/896443-code-php-pour-obtenir-le-lien-de-limage-dune-option#301629 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : Last -- PHP version -- : 7.2  Bonjour,  Je souhaiterai afficher en tooltip au survol de souris l'image de l'option   i.imgur.com/TRGwh14.jpg , je dois pour cela modifier je pense le fichier option.php et je pense que ça se passe ici :  Auriez-vous les codes PHP pour obtenir l'URL de l'image de l'option ?  Je pense utiliser Tooltips de regularlabs :  Merci.")*

Bonjour,

Je crains ne pas pouvoir vous dire grand chose puisque nous ne savons pas comment fonctionne exactement Tooltips.
Mais HikaShop ne va pas faire d'opérations spécialement pouvant empêcher un plugin de modifier le contenu.
Par contre ; je ne pourrais que vous conseiller de passer par "content.prepare" et non poser le contenu directement ; car c'est peut-être cela qui vient casser le flux normal... Si "tip" est fait pour fonctionner sur des articles Joomla, il faut passer par le flux classique de traitement d'un article et donc via le système de preparation de contenu de Joomla.

Après, je crains que cela ne sorte très largement du domaine de notre support.

Cordialement,

---

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

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

- **Laurentfrom47**
- ![Laurentfrom47's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg) Topic Author

Less More

- Thank you received: 0
-
-

7 years 11 months ago [\#301642](#301642) by Laurentfrom47  Replied by *Laurentfrom47* on topic *[Code PHP pour obtenir le lien de l'image d'une option](/forum/5-support-en-francais-french-support-/896443-code-php-pour-obtenir-le-lien-de-limage-dune-option#301642 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : Last -- PHP version -- : 7.2  Bonjour,  Je souhaiterai afficher en tooltip au survol de souris l'image de l'option   i.imgur.com/TRGwh14.jpg , je dois pour cela modifier je pense le fichier option.php et je pense que ça se passe ici :  Auriez-vous les codes PHP pour obtenir l'URL de l'image de l'option ?  Je pense utiliser Tooltips de regularlabs :  Merci.")*

Bonjour,

Merci pour votre réponse, je comprend.

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

- **Laurentfrom47**
- ![Laurentfrom47's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg) Topic Author

Less More

- Thank you received: 0
-
-

7 years 10 months ago [\#301685](#301685) by Laurentfrom47  Replied by *Laurentfrom47* on topic *[Code PHP pour obtenir le lien de l'image d'une option](/forum/5-support-en-francais-french-support-/896443-code-php-pour-obtenir-le-lien-de-limage-dune-option#301685 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : Last -- PHP version -- : 7.2  Bonjour,  Je souhaiterai afficher en tooltip au survol de souris l'image de l'option   i.imgur.com/TRGwh14.jpg , je dois pour cela modifier je pense le fichier option.php et je pense que ça se passe ici :  Auriez-vous les codes PHP pour obtenir l'URL de l'image de l'option ?  Je pense utiliser Tooltips de regularlabs :  Merci.")*

Bonjour,

à priori le problème venait du composant de SEF que j'ai viré, tout marche mieux et plus vite...

Je souhaiterai ajouter le prix de l'option à coté du nom de l'option dans le tooltips, j'utilise ce code : Code:

$options = JHTML::_('content.prepare','{tip [b]title="'.$optionInfo-&gt;product_name.'"[/b] content="' . $description . '"}&lt;span class="hikashop_option_info" alt="Information"&gt;&lt;/span&gt;{/tip}');

Quel code pourrais-je ajouter à coté de '.$optionInfo-&gt;product_name.' pour afficher le prix ?

En vous remerciant.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODk2NDQzLWNvZGUtcGhwLXBvdXItb2J0ZW5pci1sZS1saWVuLWRlLWxpbWFnZS1kdW5lLW9wdGlvbj90bXBsPW1hcmtkb3du) 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")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

7 years 10 months ago [\#301687](#301687) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Code PHP pour obtenir le lien de l'image d'une option](/forum/5-support-en-francais-french-support-/896443-code-php-pour-obtenir-le-lien-de-limage-dune-option#301687 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : Last -- PHP version -- : 7.2  Bonjour,  Je souhaiterai afficher en tooltip au survol de souris l'image de l'option   i.imgur.com/TRGwh14.jpg , je dois pour cela modifier je pense le fichier option.php et je pense que ça se passe ici :  Auriez-vous les codes PHP pour obtenir l'URL de l'image de l'option ?  Je pense utiliser Tooltips de regularlabs :  Merci.")*

Bonjour,

Quelque chose comme cela: Code:

'.$this-&gt;currencyHelper-&gt;format(reset($optionInfo-&gt;prices)-&gt;price_value_with_tax,reset($optionInfo-&gt;prices)-&gt;price_currency_id).'

The following user(s) said Thank You: Laurentfrom47

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

- **Laurentfrom47**
- ![Laurentfrom47's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg) Topic Author

Less More

- Thank you received: 0
-
-

7 years 10 months ago [\#301775](#301775) by Laurentfrom47  Replied by *Laurentfrom47* on topic *[Code PHP pour obtenir le lien de l'image d'une option](/forum/5-support-en-francais-french-support-/896443-code-php-pour-obtenir-le-lien-de-limage-dune-option#301775 "-- HikaShop version -- : 4.0.1 business -- Joomla version -- : Last -- PHP version -- : 7.2  Bonjour,  Je souhaiterai afficher en tooltip au survol de souris l'image de l'option   i.imgur.com/TRGwh14.jpg , je dois pour cela modifier je pense le fichier option.php et je pense que ça se passe ici :  Auriez-vous les codes PHP pour obtenir l'URL de l'image de l'option ?  Je pense utiliser Tooltips de regularlabs :  Merci.")*

C'est parfait, merci.

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

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