Pas de produit affiche "désolé déjà vendu"

  • Posts: 20
  • Thank you received: 0
9 years 3 months ago #203649

-- url of the page with the problem -- : galerie-vintage.com/index.php/product/74...OVIER%20ET%20TOSO%20
-- HikaShop version -- : essential
-- Joomla version -- : 2.5.28

Bonjour,
dans les fiches produit affichage "reversed"
j'ai ajouté au product / show_reversed.php

<?php
//LAYOUT listing_price
if($this->element->product_quantity == 0){
echo '<strong><span style="color:#f00;">Désolé déjà vendu</span></strong><br/>';
}
?>
Mais je ne vois pas comment faire disparaître alors le prix...

Je souhaite en fait que si la quantité est 0 alors pas de prix affiché et à la place "Désolé déjà vendu"
Merci pour votre aide.
Pierre.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 3 months ago #203652

Bonjour,

Le code affichant le prix est:

		if ($this->params->get('show_price')) {
			$this->row = & $this->element;
			$this->setLayout('listing_price');
			echo $this->loadTemplate();
		}
Donc il faut ajouter votre "if / else" autour de ce code.

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

  • Posts: 20
  • Thank you received: 0
9 years 3 months ago #203744

<?php
//LAYOUT listing_price
if($this->element->product_quantity == 0){
echo '<strong><span style="color:#f00;">Désolé déjà vendu</span></strong><br/>';
}
else
($this->params->get('show_price')) {
			$this->row = & $this->element;
			$this->setLayout('listing_price');
			echo $this->loadTemplate();
		}
?>

Comme ça?

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

  • Posts: 13201
  • Thank you received: 2322
9 years 3 months ago #203753

Bonjour,

Plutôt comme ça:

if($this->element->product_quantity == 0){
	echo '<strong><span style="color:#f00;">Désolé déjà vendu</span></strong><br/>';
}else if ($this->params->get('show_price')) {
	$this->row = & $this->element;
	$this->setLayout('listing_price');
	echo $this->loadTemplate();
}

The following user(s) said Thank You: recupart

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

  • Posts: 20
  • Thank you received: 0
9 years 3 months ago #203829

Parfait!!!!
Merci ;)

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

  • Posts: 20
  • Thank you received: 0
9 years 3 months ago #203830

Dans le même ordre d'idée:
Quand il n'y a qu'un seul exemplaire en vente j'ai

1 item in stock
et puisque c'est ce que j'ai choisi le petit rectangle d’incrément.

j'ai déjà un

if($this->row->product_quantity>1)

dans le listing price.
Comment supprimer aussi ici cette notion de quantité quand je n'ai qu'un seul exemplaire?

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

  • Posts: 82526
  • Thank you received: 13284
  • MODERATOR
9 years 3 months ago #203861

Vous pouvez ajouter le code:

if($this->row->product_quantity==1 && $this->params->get('show_quantity_field') !=0){
	$this->params->set('show_quantity_field',0);
}
après le code:
if($this->config->get('show_quantity_field') == -2)
	$this->params->set('show_quantity_field', @$this->row->product_display_quantity_field);
dans le fichier "quantity".

The following user(s) said Thank You: recupart

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

  • Posts: 20
  • Thank you received: 0
9 years 3 months ago #203865

et je supprime X_ITEM_IN_STOCK
à la ligne $text = JText::sprintf(' ', $this->row->product_quantity);
Que c'est beau comme ça...
Merci.

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

Time to create page: 0.058 seconds
Powered by Kunena Forum