Jump to content

Edit History

floriqn

floriqn

4 hours ago, Solver said:

Hello

Can you share the function that you create? and in wich file?

Hi Solver,

I'm not good for php but I tried something like that in category.php :

public static function getMinPriceValue($id_product, $priceTest)
{
	$reductions = DB::getInstance()->executeS('
		SELECT price
		FROM `'._DB_PREFIX_.'specific_price`
		WHERE id_product = '.$id_product.''
		);

	foreach($reductions as $reduction){
        $priceTest =$reduction['price'];
		return $priceTest;
	}

}

But i dont know if this request is working and if it is in the right php file.

Next i tried to display this value in product.tpl but its undefined.

Thanks

floriqn

floriqn

4 hours ago, Solver said:

Hello

Can you share the function that you create? and in wich file?

Hi Solver,

I'm not good for php but I tried something like that in category.php :

public static function getMinPriceValue($id_product, $priceTest)
{
	$reductions = DB::getInstance()->executeS('
		SELECT price
		FROM `'._DB_PREFIX_.'specific_price`
		WHERE id_product = '.$id_product.''
		);

	foreach($reductions as $reduction){
        $priceTest =$reduction['price'];
		return $priceTest
	}

}

But i dont know if this request is working and if it is in the right php file.

Next i tried to display this value in product.tpl but its undefined.

Thanks

floriqn

floriqn

3 hours ago, Solver said:

Hello

Can you share the function that you create? and in wich file?

Hi Solver,

I'm not good for php but I tried something like that in category.php :

public static function getMinPriceValue($id_product, $price)
{
	$reductions = DB::getInstance()->executeS('
		SELECT price
		FROM `'._DB_PREFIX_.'specific_price`
		WHERE id_product = '.$id_product.''
		);

	foreach($reductions as $reduction){
        $price =$reduction['price'];
	}

}

But i dont know if this request is working and if it is in the right php file.

Next i tried to display this value in product.tpl but its undefined.

Thanks

×
×
  • Create New...