Prix public affiché des produits d'1 catégorie

  • Posts: 10
  • Thank you received: 0
10 years 3 months ago #161113

-- url of the page with the problem -- : www.cadeauxdeluxe.fr
-- HikaShop version -- : 2.3.1
-- Joomla version -- : 3.3.1
-- PHP version -- : 5.4.28
-- Browser(s) name and version -- : Dernières versions Internet Explorer, Firefox et Chrome
-- Error-message(debug-mod must be tuned on) -- :

Bonjour,

Je souhaite lorsque je clique sur une catégorie de produit (module) afficher 2 prix dans la liste des produits qui s'affiche :
- le tarif public (product_msrp)
- le tarif du produit sur mon site (product_price)

Je souhaite afficher le product_msrp "barré"

Ci-dessous le paramétrage par défaut pour les catégories :
- Classement sur le champ : category_name
- Afficher les sous-catégories : Pas d'enfant
- Nombre de sous-catégories :
- Afficher les votes dans les catégories : NON
- Afficher le nombre de produits : NON
- Lien sur catégories principales : NON
- Afficher seulement les catégories avec des produits : NON

Merci d'avance pour votre aide

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

  • Posts: 12953
  • Thank you received: 1778
10 years 3 months ago #161127

Bonjour,
1. Pour modifier l'affichage du prix via votre listing de produit, la solution serai de directement éditer le fichier "listing_price" de la vue "product" de votre template de front-end.
2. Afin de barrer le prix "product_msrp" utilisé du code CSS fera l'affaire : www.hikashop.com/support/documentation/1...ize-the-display.html

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

  • Posts: 10
  • Thank you received: 0
10 years 3 months ago #161387

Bonjour,

Merci pour votre réponse ... Ci-dessous le code du fichier "listing_price" de la vue product du template de Front end. Pouvez-vous m'aider pour la modification du code ?

<?php
/**
* @package HikaShop for Joomla!
* @version 2.3.0
* @author hikashop.com
* @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$class ='';
if(!empty($this->row->prices) && count($this->row->prices)>1){
$class = ' hikashop_product_several_prices';
}
if(isset($this->element->main->product_msrp) && !(@$this->row->product_msrp > 0.0) )
$this->row->product_msrp = $this->element->main->product_msrp;
if(isset($this->row->product_msrp) && @$this->row->product_msrp > 0.0 && JRequest::getCmd('layout') == 'show' && $this->params->get('from_module','') == ''){ ?>
<span class="hikashop_product_msrp_price hikashop_product_price_full">
<span class="hikashop_product_msrp_price_title">
<?php
echo JText::_('PRODUCT_MSRP_BEFORE');
?>
</span>
<span class="hikashop_product_price">
<?php
$mainCurr = $this->currencyHelper->mainCurrency();
$app = JFactory::getApplication();
$currCurrency = $app->getUserState( HIKASHOP_COMPONENT.'.currency_id', $mainCurr );
$msrpCurrencied = $this->currencyHelper->convertUniquePrice($this->row->product_msrp,$mainCurr,$currCurrency);
if($msrpCurrencied == $this->row->product_msrp)
echo $this->currencyHelper->format($this->row->product_msrp,$mainCurr);
else
echo $this->currencyHelper->format($msrpCurrencied,$currCurrency).' ('.$this->currencyHelper->format($this->row->product_msrp,$mainCurr).')';
?>
</span>
</span>
<?php } ?>

<span class="hikashop_product_price_full<?php echo $class; ?>">
<?php
if(empty($this->row->prices)){
echo JText::_('FREE_PRICE');
}else{
$first=true;
echo JText::_('PRICE_BEGINNING');
$i=0;

if(isset($this->row->product_msrp) && @$this->row->product_msrp > 0.0 && JRequest::getCmd('layout') == 'show' && $this->params->get('from_module','') == ''){
echo '<span class="hikashop_product_our_price_title">'.JText::_('PRODUCT_MSRP_AFTER').'</span> ';
}

if($this->params->get('price_with_tax',3)==3){
$config =& hikashop_config();
$this->params->set('price_with_tax',$config->get('price_with_tax'));
}
foreach($this->row->prices as $k => $price){
if($first)$first=false;
else echo JText::_('PRICE_SEPARATOR');
if(!empty($this->unit) && isset($price->unit_price)){
$price =& $price->unit_price;
}
$start = JText::_('PRICE_BEGINNING_'.$i);
if($start!='PRICE_BEGINNING_'.$i){
echo $start;
}
if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $price->price_min_quantity>1){
echo '<span class="hikashop_product_price_with_min_qty hikashop_product_price_for_at_least_'.$price->price_min_quantity.'">';
}

$classes = array('hikashop_product_price hikashop_product_price_'.$i);
if(!empty($this->row->discount)){
$classes[]='hikashop_product_price_with_discount';
}

if(!empty($this->row->discount)){
if($this->params->get('show_discount',3)==3){
$config =& hikashop_config();
$this->params->set('show_discount',$config->get('show_discount'));
}
if($this->params->get('show_discount')==1){
echo '<span class="hikashop_product_discount">'.JText::_('PRICE_DISCOUNT_START');
if(bccomp($this->row->discount->discount_flat_amount,0,5)!==0){
echo $this->currencyHelper->format(-1*$this->row->discount->discount_flat_amount,$price->price_currency_id);
}elseif(bccomp($this->row->discount->discount_percent_amount,0,5)!==0){
echo -1*$this->row->discount->discount_percent_amount.'%';
}
echo JText::_('PRICE_DISCOUNT_END').'</span>';
}elseif($this->params->get('show_discount')==2){
echo '<span class="hikashop_product_price_before_discount">'.JText::_('PRICE_DISCOUNT_START');
if($this->params->get('price_with_tax')){
echo $this->currencyHelper->format($price->price_value_without_discount_with_tax,$price->price_currency_id);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
echo $this->currencyHelper->format($price->price_value_without_discount,$price->price_currency_id);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_AFTER_TAX');
}
if($this->params->get('show_original_price','-1')=='-1'){
$config =& hikashop_config();
$this->params->set('show_original_price',$config->get('show_original_price'));
}
if($this->params->get('show_original_price') && !empty($price->price_orig_value_without_discount_with_tax)){
echo JText::_('PRICE_BEFORE_ORIG');
if($this->params->get('price_with_tax')){
echo $this->currencyHelper->format($price->price_orig_value_without_discount_with_tax,$price->price_orig_currency_id);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax') && !empty($price->price_orig_value_without_discount)){
echo $this->currencyHelper->format($price->price_orig_value_without_discount,$price->price_orig_currency_id);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_AFTER_TAX');
}
echo JText::_('PRICE_AFTER_ORIG');
}
echo JText::_('PRICE_DISCOUNT_END').'</span>';
}elseif($this->params->get('show_discount')==3){

}
}

echo '<span class="'.implode(' ',$classes).'">';
if($this->params->get('price_with_tax')){
echo $this->currencyHelper->format(@$price->price_value_with_tax,$price->price_currency_id);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
echo $this->currencyHelper->format(@$price->price_value,$price->price_currency_id);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_AFTER_TAX');
}
if($this->params->get('show_original_price','-1')=='-1'){
$config =& hikashop_config();
$this->params->set('show_original_price',$config->get('show_original_price'));
}
if($this->params->get('show_original_price') && !empty($price->price_orig_value)){
echo JText::_('PRICE_BEFORE_ORIG');
if($this->params->get('price_with_tax')){
echo $this->currencyHelper->format($price->price_orig_value_with_tax,$price->price_orig_currency_id);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
echo $this->currencyHelper->format($price->price_orig_value,$price->price_orig_currency_id);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_AFTER_TAX');
}
echo JText::_('PRICE_AFTER_ORIG');
}
echo '</span> ';
if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $this->params->get('per_unit',1)){
if($price->price_min_quantity>1){
echo '<span class="hikashop_product_price_per_unit_x">'.JText::sprintf('PER_UNIT_AT_LEAST_X_BOUGHT',$price->price_min_quantity).'</span>';
}else{
echo '<span class="hikashop_product_price_per_unit">'.JText::_('PER_UNIT').'</span>';
}
}
if($this->params->get('show_price_weight')){
if(!empty($this->element->product_id) && isset($this->row->product_weight) && bccomp($this->row->product_weight,0,3)){

echo JText::_('PRICE_SEPARATOR').'<span class="hikashop_product_price_per_weight_unit">';
if($this->params->get('price_with_tax')){
$weight_price = $price->price_value_with_tax / $this->row->product_weight;
echo $this->currencyHelper->format($weight_price,$price->price_currency_id).' / '.JText::_($this->row->product_weight_unit);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_BEFORE_TAX');
}
if($this->params->get('price_with_tax')==2||!$this->params->get('price_with_tax')){
$weight_price = $price->price_value / $this->row->product_weight;
echo $this->currencyHelper->format($weight_price,$price->price_currency_id).' / '.JText::_($this->row->product_weight_unit);
}
if($this->params->get('price_with_tax')==2){
echo JText::_('PRICE_AFTER_TAX');
}
echo '</span>';
}
}
if(isset($price->price_min_quantity) && empty($this->cart_product_price) && $price->price_min_quantity>1){
echo '</span>';
}
$end = JText::_('PRICE_ENDING_'.$i);
if($end!='PRICE_ENDING_'.$i){
echo $end;
}
$i++;
}
echo JText::_('PRICE_END');
}
?></span>

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

  • Posts: 82561
  • Thank you received: 13288
  • MODERATOR
10 years 3 months ago #161405

Bonjour,

Il faut changer chaque occurrence du code:
JRequest::getCmd('layout') == 'show'

en:
(JRequest::getCmd('layout') == 'show'||JRequest::getCmd('layout') == 'listing')

dans le fichier.

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

Time to create page: 0.070 seconds
Powered by Kunena Forum