Skip to main content

Ne pas afficher prix si le produit si stock 0

More
10 years 1 month ago #247398 by micker
-- HikaShop version -- : 2.6.3 [1606230841]
-- Joomla version -- : 3.6.2

Bonjour je voudrais savoir comment faire pour enlever le prix sir le produit n'est plus en stock
dans la vue catégorie et dans la vue produit.
Merci

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

More
10 years 1 month ago #247399 by micker
autre question lié ... j'utilise un badge quand le stock est à 0
comment faire pour que cela s'affiche sur la page de catégorie ?
Merci

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

More
10 years 1 month ago #247417 by Mohamed Thelji
Bonjour,

1. Il n'y a pour l'instant aucune option pour cela, lorsqu'un produit n'est plus en stock le prix reste affiché et un message "plus de stock" s'affiche.
Une solution serait de modifier directement le code des fichiers de la vue "product" via "Hikashop->Affichages->Vues" afin d'éviter l'affichage du prix lorsqu'il n'y a plus de stock.

2. Il vous suffira simplement :
- D'aller sur la page de configuration de votre menu de listing de catégories
- D'aller sur l'onglet "Product Options"
- D'activer l'option "Badge"

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

More
10 years 1 month ago #247464 by micker
1 pouvez vous me donner un bout de code pour la surcharge ?
2 je vais tester merci

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

More
10 years 1 month ago #247484 by micker
Hello pour le 2
cela ne fonctionne pas

réglage du lien de menu



affichage catégorie



affichage produit

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

More
10 years 1 month ago - 10 years 1 month ago #247466 by Jerome
1.
www.hikashop.com/forum/product-category-...n-category-view.html
www.hikashop.com/forum/4-how-to/9692-hid...uct-pages.html#27426

2.
Alors peut être que le soucis vient de votre template. Essayez voir avec le template par défaut de Joomla. Sinon, merci de fournir un lien vers la page en question.

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Last edit: 10 years 1 month ago by nicolas.

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

More
10 years 1 month ago #248721 by micker
hello pour le prix produit quand il n'y a plus de stock j'ai trouver nikel ... par contre pour le badge en mode listing ....
il n'y a pas de surcharge ... bizarre
Code:
<?php /** * @package HikaShop for Joomla! * @version 2.6.3 * @author hikashop.com * @copyright (C) 2010-2016 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?><?php $mainDivName = $this->params->get('main_div_name',''); $link = hikashop_contentLink('product&task=show&cid='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway,$this->row); if(!empty($this->row->extraData->top)) { echo implode("\r\n",$this->row->extraData->top); } ?> <div class="hikashop_listing_img" id="div_<?php echo $mainDivName.'_'.$this->row->product_id; ?>"> <!-- PRODUCT IMG --> <div class="hikashop_product_image"> <div class="hikashop_product_image_subdiv"> <?php if($this->params->get('link_to_product_page',1)){ ?> <a href="<?php echo $link;?>" title="<?php echo $this->escape($this->row->product_name); ?>"> <?php } $image_options = array('default' => true,'forcesize'=>$this->config->get('image_force_size',true),'scale'=>$this->config->get('image_scale_mode','inside')); $img = $this->image->getThumbnail(@$this->row->file_path, array('width' => $this->image->main_thumbnail_x, 'height' => $this->image->main_thumbnail_y), $image_options); if($img->success) { echo '<img class="hikashop_product_listing_image" title="'.$this->escape(@$this->row->file_description).'" alt="'.$this->escape(@$this->row->file_name).'" src="'.$img->url.'"/>'; } $main_thumb_x = $this->image->main_thumbnail_x; $main_thumb_y = $this->image->main_thumbnail_y; $horizontal = '0'; $vertical = '0'; if($this->params->get('display_badges',1)){ $this->classbadge->placeBadges($this->image, $this->row->badges, $vertical, $horizontal); } $this->image->main_thumbnail_x = $main_thumb_x; $this->image->main_thumbnail_y = $main_thumb_y; if($this->params->get('link_to_product_page',1)){ ?> </a> <?php } ?> </div> </div> <!-- EO PRODUCT IMG --> <!-- PRODUCT PRICE --> <?php if($this->params->get('show_price','-1')=='-1'){ $config =& hikashop_config(); $this->params->set('show_price',$config->get('show_price')); } if($this->params->get('show_price')){ $this->setLayout('listing_price'); echo $this->loadTemplate(); } ?> <!-- EO PRODUCT PRICE --> <!-- PRODUCT CUSTOM FIELDS --> <?php if(!empty($this->productFields)) { foreach ($this->productFields as $fieldName => $oneExtraField) { if(!empty($this->row->$fieldName) || (isset($this->row->$fieldName) && $this->row->$fieldName === '0')) { ?> <dl class="hikashop_product_custom_<?php echo $oneExtraField->field_namekey;?>_line"> <dt class="hikashop_product_custom_name"> <?php echo $this->fieldsClass->getFieldName($oneExtraField);?> </dt> <dd class="hikashop_product_custom_value"> <?php echo $this->fieldsClass->show($oneExtraField,$this->row->$fieldName); ?> </dd> </dl> <?php } } } ?> <!-- EO PRODUCT CUSTOM FIELDS --> <!-- PRODUCT VOTE --> <?php if($this->params->get('show_vote_product')){ $this->setLayout('listing_vote'); echo $this->loadTemplate(); } ?> <!-- EO PRODUCT VOTE --> <!-- ADD TO CART BUTTON AREA --> <?php if($this->params->get('add_to_cart') || $this->params->get('add_to_wishlist')){ ?><form action="<?php echo hikashop_completeLink('product&task=updatecart'); ?>" method="post" name="hikashop_product_form_<?php echo $this->row->product_id.'_'.$this->params->get('main_div_name'); ?>"><?php $this->ajax=''; if(!$this->config->get('ajax_add_to_cart',0)){ $this->ajax = 'return hikashopModifyQuantity(\''.$this->row->product_id.'\',field,1,\'hikashop_product_form_'.$this->row->product_id.'_'.$this->params->get('main_div_name').'\',\'cart\');'; } $this->setLayout('quantity'); echo $this->loadTemplate(); if(!empty($this->ajax) && $this->config->get('redirect_url_after_add_cart','stay_if_cart')=='ask_user'){ ?> <input type="hidden" name="popup" value="1"/> <?php } ?> <input type="hidden" name="product_id" value="<?php echo $this->row->product_id; ?>" /> <input type="hidden" name="add" value="1"/> <input type="hidden" name="ctrl" value="product"/> <input type="hidden" name="task" value="updatecart"/> <input type="hidden" name="return_url" value="<?php echo urlencode(base64_encode(urldecode($this->redirect_url)));?>"/> </form><?php } ?> <!-- EO ADD TO CART BUTTON AREA --> <!-- COMPARISON AREA --> <?php if(JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) { ?> <br/><?php if( $this->params->get('show_compare') == 1 ) { $js = 'setToCompareList('.$this->row->product_id.',\''.$this->escape($this->row->product_name).'\',this); return false;'; echo $this->cart->displayButton(JText::_('ADD_TO_COMPARE_LIST'),'compare',$this->params,$link,$js,'',0,1,'hikashop_compare_button'); } else { ?> <input type="checkbox" class="hikashop_compare_checkbox" id="hikashop_listing_chk_<?php echo $this->row->product_id;?>" onchange="setToCompareList(<?php echo $this->row->product_id;?>,'<?php echo $this->escape($this->row->product_name); ?>',this);"><label for="hikashop_listing_chk_<?php echo $this->row->product_id;?>"><?php echo JText::_('ADD_TO_COMPARE_LIST'); ?></label> <?php } } ?> <!-- EO COMPARISON AREA --> </div> <?php if(!empty($this->row->extraData->bottom)) { echo implode("\r\n",$this->row->extraData->bottom); } if($this->rows[0]->product_id == $this->row->product_id){ ?> <style> #<?php echo $mainDivName; ?> .hikashop_product_image{ height:<?php echo $this->image->main_thumbnail_y;?>px; text-align:center; clear:both; } #<?php echo $mainDivName; ?> .hikashop_product_image_subdiv{ position:relative; text-align:center; clear:both; width:<?php echo $this->image->main_thumbnail_x;?>px; margin: auto; } </style> <?php } ?>

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

More
10 years 4 weeks ago #248734 by nicolas
Bonjour,

Je pense toujours que le problème vient de l'option d'affichage "badges" de votre listing.
Peut être que vous n'éditez pas le bon élément de menu ?
Changez la ligne:
if($this->params->get('display_badges',1)){
en:
if(true){
dans votre vue et cela affichera les badges tout le temps.

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

More
10 years 4 weeks ago #248807 by micker
alors maintenant c'est bon il y ales badge mais ils sont tous en haut à droite .... et comme les style sont sur les éléments ...
Les infos ci dessous

Part of the message is hidden for the guests. Please log in or register to see it.

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

More
10 years 4 weeks ago - 10 years 4 weeks ago #248824 by Philip
Bonjour,

C'est bien un problème de Css, pour corriger cela éditer votre frontend Css, je vois que vous avez d'ailleurs déjà customisé celui-ci.
Peut être est ce une valeure qui à justement était supprimée ?

En tout cas, ajouté cela :
Code:
li.span3.hikashop_product { position: relative; }

Note : pour éditer votre frondend Css, consulter ce tuto (en anglais)

J'espère que cela vous aidera.

Cordialement
Last edit: 10 years 4 weeks ago by Philip.

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

More
10 years 3 weeks ago #249154 by micker
hello tout ceci est réglé sauf que je tombe sur une coquille avec les variantes ...
pour ne pas afficher le prix si la quantité est vide je fais
Code:
if(!empty($this->row->product_quantity))
dans la vue listing ...
comment faire pour faire ce test sur la quantité des variantes ?
Merci par avance

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

More
10 years 3 weeks ago - 10 years 3 weeks ago #249161 by Philip
Bonjour,

Votre condition devrai plutôt être de ce type :
Code:
// Si le code est tout sauf = à 0 : if($this->row->product_quantity != 0) { DISPLAY PRICE } // Si besoin, pour les cas ou la quantity = 0 else { DISPLAY COMING SOON...ETC... }

Pour les variantes, elles ne sont d'une manière générale pas accessibles sur les listing produits...

Cordialement.
Last edit: 10 years 3 weeks ago by Philip.

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

More
10 years 3 weeks ago #249232 by micker
crotte aucun moyen ??

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

More
10 years 3 weeks ago - 10 years 3 weeks ago #249236 by Philip
Bonjour,

Si bien sur mais cela demande un custom code beaucoup plus avancé, cela reste possible si vous disposez de bonnes connaissance en php et de la structure d'HikaShop.
Ou bien, vous pouvez contacter parmi nos partenaires , un developpeur pour voir dans un premier temps combien cela pourrait coûter.

Cordialement.
Last edit: 10 years 3 weeks ago by Philip.

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

Time to create page: 0.334 seconds
Powered by Kunena Forum