if price is 0

silviu

No avatar

2007-01-22 01:30

how can i remove add to basket button if price is 0 ??? i know is in products_details.tpl and products_list.tpl and i have to add a IF function..

treewood (OpenSolution)

Avatar: treewood

2007-01-23 09:55

silviu - do You know PHP good? i know solution but You will need PHP.

sergey

No avatar

2007-01-26 16:04

And how it to make?

idaryl

Avatar: idaryl

2007-06-05 07:35

Treewood, could you post the solution please - this would help me a lot

treewood (OpenSolution)

Avatar: treewood

2007-06-05 09:09

idaryl, sergey - this will be hard:
1. edit core/products.php and find throwProductsData(). There put if. If price ($aList['fPrice']) is over 0 then put in variable for example that: $aList['sBasket'] with html in LIST_LIST (from templates/products_list.tpl) using to add to basket. If price is 0 then $aList[sBasket] will be only html with price. Remove basket link and price from templates/products_list.pl and replace variable $aList['sBasket']

2. edit actions_client/products.php and find that: elseif( $a == 'More' ....
In this ELSEIF add IF to check price ($aData['fPrice']). And if price is 0 then add to variable $sData = null;. If price is over 0 then put in $sData variable HTML code from templates/products_details.tpl from SHOW block all div with id "addCart".

3. In core/orders.php in function addOrderProduct() add IF clause that if price of product ($aData['fPrice']) is 0 then return null;. This will protect from some hacks if someone try to order product with price 0.

This is not easy to do. But You can try it. We can do it for You and if You want then contact us via email.

hryssis

Avatar: hryssis

2008-03-26 23:30

well treewood can you edit the files for me and send them to hryssis@gmail.com because i don't know much of php. Please send me and instructions if you can.

Thanks in advance
Hryssis

Hryssis

merci

No avatar

2008-03-27 08:42

hryssis - sorry, but we don't send modyfied files. Treewood gives general hints how to do this, but if you don't know php, ask some programist to do this for you.

Back to top
about us | contact