[TYPO3-commerce] List only one price in product list, possibly the lowest. Possible?

Ingo Schmitt mailinglisten at i-schmitt.de
Fri Jul 27 18:46:12 CEST 2007


Hi Karsten,

> Hi.
> 
> When listing products, I'd like to list the lowest price of the articles 
>  based on the product. So that I can list a "starting at xyz $" price.
> 
> Is that possible? If yes, how?
> 
> Thanks for any quick hints, pointers, ...
> 

i think we don't have a marker for this right now, but have a look at 
this coe, we have added it to the aditional marker hook in the output:

function additionalMarker($markerArray,$pobj,$articleObject,$productObject){
  		
  		$attributes = $articleObject -> 
getAttributeValue($pobj->conf['SelectAttributeUid']);
  		#debug($articleObject);
  		#debug($attributes );
  		if (is_string($attributes)) {
			$markerArray['###INHALT###'] = $attributes;
  		}else{
  			$markerArray['###INHALT###'] = '';
  		}
  		$prices=$articleObject->getPricsScaleObjects(2);
  		$staffelpreisOutput='';
  		if ((count($prices)>0) && (is_array($prices))) {
  			foreach ($prices as $start => $tmpArray) {
  				foreach ($tmpArray as $end => $locPiceObj) {
  					$staffelpreisOutputBlock = 
$pobj->cObj->StdWrap($locPiceObj->getPriceScaleAmountStart(),$pobj->conf['staffelpreis.']['amount.']); 

  					$staffelpreisOutputBlock.= 
$pobj->cObj->StdWrap(tx_moneylib::format($locPiceObj->getPriceGross(),$pobj->currency),$pobj->conf['staffelpreis.']['price.']); 

  					$staffelpreisOutput.= 
$pobj->cObj->StdWrap($staffelpreisOutputBlock,$pobj->conf['staffelpreis.']['block.']); 

  				}
  			}
  			$markerArray['###STAFFELPREIS###']=$staffelpreisOutput;
  		} else {
  			$markerArray['###STAFFELPREIS###']='';
  		}
  	#	debug ($pobj->conf['staffelpreis.']);
  		
  		
  		return $markerArray;
  	}

Here you shoudl get the data, you need ...

Regards

ingo

> 
> Regards,
> Karsten


Mit freundlichen Gruessen
-- 
Ingo Schmitt                        mailto:is at marketing-factory.de
Marketing Factory Consulting GmbH   http://typo3.marketing-factory.de/
Content Management mit Typo3: Beratung - Schulung - Realisierung


More information about the TYPO3-project-commerce mailing list