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

#   Affichage en front-end d'un produit non publié

##

- **[NosyWeb](/forum/user/88-nosyweb "View NosyWeb's Profile")**
- [![NosyWeb's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar88.png)](/forum/user/88-nosyweb "View NosyWeb's Profile") Topic Author
- [ Offline](/forum/user/88-nosyweb)

Less More

- Posts: 211
- Thank you received: 9
-
-

6 years 3 months ago [\#322848](#322848) by [NosyWeb](/forum/user/88-nosyweb "View NosyWeb's Profile")  *[Affichage en front-end d'un produit non publié](/forum/5-support-en-francais-french-support-/900565-affichage-en-front-end-dun-produit-non-publie#322848 "-- url of the page with the problem -- :   nwd2.cloudaccess.host/produits-comtois  -- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.20  Bonjour,  Avant de publier sur le site un nouveau produit, est-il possible de l'afficher pour validation avant publication. J'ai essayé d'afficher un produit non publié, en me connectant an tant que super admin, sans succès. Cette demande est assez importante car nous développons un process qui se déclenche dès la publication d'un produit. Merci d'avance. Salutations.")* was created by *[NosyWeb](/forum/user/88-nosyweb "View NosyWeb's Profile")*

-- url of the page with the problem -- : [ nwd2.cloudaccess.host/produits-comtois](https://nwd2.cloudaccess.host/produits-comtois)
-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.9.20

Bonjour,

Avant de publier sur le site un nouveau produit, est-il possible de l'afficher pour validation avant publication.
J'ai essayé d'afficher un produit non publié, en me connectant an tant que super admin, sans succès.
Cette demande est assez importante car nous développons un process qui se déclenche dès la publication d'un produit.
Merci d'avance.
Salutations.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vOTAwNTY1LWFmZmljaGFnZS1lbi1mcm9udC1lbmQtZHVuLXByb2R1aXQtbm9uLXB1YmxpZT90bXBsPW1hcmtkb3du) 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: 86587
- Thank you received: 14326
-
-

6 years 3 months ago [\#322861](#322861) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Affichage en front-end d'un produit non publié](/forum/5-support-en-francais-french-support-/900565-affichage-en-front-end-dun-produit-non-publie#322861 "-- url of the page with the problem -- :   nwd2.cloudaccess.host/produits-comtois  -- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.20  Bonjour,  Avant de publier sur le site un nouveau produit, est-il possible de l'afficher pour validation avant publication. J'ai essayé d'afficher un produit non publié, en me connectant an tant que super admin, sans succès. Cette demande est assez importante car nous développons un process qui se déclenche dès la publication d'un produit. Merci d'avance. Salutations.")*

Bonjour,

Il n'y a pas d'option pour cela. L'affichage d'un produit non publié est complètement bloqué sur le frontend.
Pour changer cela, il faudrait changer le code: Code:

$filters = array( 'pr.product_id = ' . $product_id, 'pr.product_related_type = ' . $database-&gt;Quote('options'), 'p.product_published = 1', '(p.product_sale_start = \'\' OR p.product_sale_start &lt;= '.time().')', '(p.product_sale_end = \'\' OR p.product_sale_end &gt; '.time().')' );

en:
Code:

$filters = array( 'pr.product_id = ' . $product_id, 'pr.product_related_type = ' . $database-&gt;Quote('options'), '(p.product_sale_start = \'\' OR p.product_sale_start &lt;= '.time().')', '(p.product_sale_end = \'\' OR p.product_sale_end &gt; '.time().')' ); if(!$is_admin) $filters[] = 'p.product_published = 1';

dans le fichier components/com_hikashop/views/product/view.html.php sachant qu'il faut définir $is_admin à true ou false en fonction de la situation (genre en vérifiant les groupes utilisateur de l'utilisateur en cours).

The following user(s) said Thank You: [NosyWeb](/forum/user/88-nosyweb "View NosyWeb's Profile")

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

- **[NosyWeb](/forum/user/88-nosyweb "View NosyWeb's Profile")**
- [![NosyWeb's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar88.png)](/forum/user/88-nosyweb "View NosyWeb's Profile") Topic Author
- [ Offline](/forum/user/88-nosyweb)

Less More

- Posts: 211
- Thank you received: 9
-
-

6 years 3 months ago [\#322868](#322868) by [NosyWeb](/forum/user/88-nosyweb "View NosyWeb's Profile")  Replied by *[NosyWeb](/forum/user/88-nosyweb "View NosyWeb's Profile")* on topic *[Affichage en front-end d'un produit non publié](/forum/5-support-en-francais-french-support-/900565-affichage-en-front-end-dun-produit-non-publie#322868 "-- url of the page with the problem -- :   nwd2.cloudaccess.host/produits-comtois  -- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.20  Bonjour,  Avant de publier sur le site un nouveau produit, est-il possible de l'afficher pour validation avant publication. J'ai essayé d'afficher un produit non publié, en me connectant an tant que super admin, sans succès. Cette demande est assez importante car nous développons un process qui se déclenche dès la publication d'un produit. Merci d'avance. Salutations.")*

Merci Nicolas, je transmets à notre développeur.
Bonne journée.

The following user(s) said Thank You: [Philip](/forum/user/34318-philip "View Philip's Profile")

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

- **[NosyWeb](/forum/user/88-nosyweb "View NosyWeb's Profile")**
- [![NosyWeb's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar88.png)](/forum/user/88-nosyweb "View NosyWeb's Profile") Topic Author
- [ Offline](/forum/user/88-nosyweb)

Less More

- Posts: 211
- Thank you received: 9
-
-

6 years 3 months ago -  6 years 3 months ago [\#322976](#322976) by [NosyWeb](/forum/user/88-nosyweb "View NosyWeb's Profile")  Replied by *[NosyWeb](/forum/user/88-nosyweb "View NosyWeb's Profile")* on topic *[Affichage en front-end d'un produit non publié](/forum/5-support-en-francais-french-support-/900565-affichage-en-front-end-dun-produit-non-publie#322976 "-- url of the page with the problem -- :   nwd2.cloudaccess.host/produits-comtois  -- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.20  Bonjour,  Avant de publier sur le site un nouveau produit, est-il possible de l'afficher pour validation avant publication. J'ai essayé d'afficher un produit non publié, en me connectant an tant que super admin, sans succès. Cette demande est assez importante car nous développons un process qui se déclenche dès la publication d'un produit. Merci d'avance. Salutations.")*

Bonjour Nicolas,
(c'est Marc)

J'ai tenté d'appliquer la soluce ci-dessus, mais ca ne semble pas avoir d'effet !?
Dans notre cas, nous avons besoin qu'un admin puisse voir en front tous ses produits (même si dépubliés)
1- dans la liste des produits d'une categorie
2- et aussi dans le detail de la fiche produit

Pour le point 1, j'ai une solution en ajoutant un plugin sur l'event de la view product :
$app-&gt;triggerEvent( '**onBeforeProductListingLoad**', array( &amp; $filters, &amp; $order, &amp; $view, &amp; $select, &amp; $select2, &amp; $a, &amp; $b, &amp; $on) );
et en modifiant le $filters dans le plugin (puisque passé par référence).

Pour le point 2, la solution proposée ne semble pas marcher.
Il semble que Hikashop renvoie vers la page 404, avant d'accéder à la view, comme si un controle Hikashop detectait que le produit est dépublié et donc pas accessible !?
- as-tu une suggestion pour pour m'aider a trouver le code qui effectue cette redirection 404 ?

Merci d'avance.

Last edit: 6 years 3 months ago by [NosyWeb](/forum/user/88-nosyweb "View NosyWeb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vOTAwNTY1LWFmZmljaGFnZS1lbi1mcm9udC1lbmQtZHVuLXByb2R1aXQtbm9uLXB1YmxpZT90bXBsPW1hcmtkb3du) 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: 86587
- Thank you received: 14326
-
-

6 years 3 months ago [\#322983](#322983) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Affichage en front-end d'un produit non publié](/forum/5-support-en-francais-french-support-/900565-affichage-en-front-end-dun-produit-non-publie#322983 "-- url of the page with the problem -- :   nwd2.cloudaccess.host/produits-comtois  -- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.9.20  Bonjour,  Avant de publier sur le site un nouveau produit, est-il possible de l'afficher pour validation avant publication. J'ai essayé d'afficher un produit non publié, en me connectant an tant que super admin, sans succès. Cette demande est assez importante car nous développons un process qui se déclenche dès la publication d'un produit. Merci d'avance. Salutations.")*

Bonjour,

Le soucis n'est pas la redirection 404.
Elle est effectuée par le code: Code:

if(empty($this-&gt;element)) { if($this-&gt;config-&gt;get('404_when_product_not_found',1)){ throw new Exception(JText::_('PRODUCT_NOT_FOUND'), 404); echo '&lt;/div&gt;'; return; } $app-&gt;enqueueMessage(JText::_('PRODUCT_NOT_FOUND')); hikashop_setPageTitle(JText::_('PRODUCT_NOT_FOUND')); echo '&lt;/div&gt;'; return; }

dans product / show.php car les données du produit demandé n'ont pas pu être chargées dans le view.html.php
Donc à mon avis, le soucis c'est que la valeur de $is_admin dans mon exemple de code à modifier n'a pas été initialisée correctement auparavant.

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

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