Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change price to zero


zlack

Recommended Posts

Hello all,

 

I have a little problem:

 

I got 2 products

 

1. Article worth ? 200

2. Article worth discount ? 300

 

when the customer selects both, then the price is negative atm. but I want it to be zero every time when something is lower then zero.

 

Anyone got the sollution for me how to add/modify code to fix my problem?

It's easier to remember, then to forget

Link to comment
Share on other sites

Thanks for your reply, but......

i'm very bad in coding php :cry:

Could you be more specific in where i have to change what?

 

Thanks alot!

It's easier to remember, then to forget

Link to comment
Share on other sites

thanks allot!

 

the only problem left is that in the shopping cart and in the product listing it has to be zero as well. do you have another line of code to fix that as well ?

It's easier to remember, then to forget

Link to comment
Share on other sites

  • 2 weeks later...
the only problem left is that in the shopping cart and in the product listing it has to be zero as well.

 

Did you try and apply the mod? I'd think that applying it to the order class would correct the problem everywhere.

 

Otherwise, can you tell me which pages you mean (file name)?

Christian Lescuyer

Link to comment
Share on other sites

I don't know which file it is, but the last problem is this:

 

I got some product with the value -200

But when they are listed in the catagorie(s) then i still see -200 for that product. But that has to be listed as 0 (zero) but still keep the value -200.

 

P.S.: thanks for your fast reply

It's easier to remember, then to forget

Link to comment
Share on other sites

OK. Look at the URL (the address) when you display the page.

 

It should be something as

http://www.oscommerce.com/forums/posting.php?mode=reply&t=29402

 

In that case, the file name is posting.php. It's the name after the last '/' and before the optional '?'

 

As there are prices all over the place, I need to know on which pages the problem occurs.

Christian Lescuyer

Link to comment
Share on other sites

I mean just an article. Like i have an HP printer with the value -200, but in the catalog it has to be displayed as 0.

But that article has to keep the value -200 cause, in combination with an other article someone has to get some discount.

 

Get my point? I hope i explained it right like this.

 

Thanks in advance, zlack

It's easier to remember, then to forget

Link to comment
Share on other sites

I'm afraid the price will appear all over the place :(

 

One way to proceed is to search files with "price" in them. You can do this with grep in Unix, or with the search tool in Windows. Look for *.php containing "price".

 

Unfortunately, you'll get quite a lot.

Christian Lescuyer

Link to comment
Share on other sites

well, since i ain't wanna mess with my running site i guess this is the end for me :(

 

but maybe you can handle me another sollution since the products only have to be in 1 categorie?

 

i just need one categorie with these products, and maybe its easy to solve it with another way?

 

thanks

It's easier to remember, then to forget

Link to comment
Share on other sites

well, since i ain't wanna mess with my running site i guess this is the end for me :(

 

It is a very good idea not to mess with a running site. But you could also install a copy of your site on your local computer with easyPHP, test your solution and load it on your production site when you're done.

 

but maybe you can handle me another sollution since the products only have to be in 1 categorie?

i just need one categorie with these products, and maybe its easy to solve it with another way?

 

No, it doesn't change the problem. I beleive that if you were successful with one page, it's only a matter of patience to get it done all over the place.

Christian Lescuyer

Link to comment
Share on other sites

Browse the site. On every page where the price appears, look at the URL in the address bar. The last part before the '?' is the filename.

Eg. in

http://www.oscommerce.com/forums/posting.php?mode=reply&t=29402

the filename is posting.php.

 

Open that file in a text editor, look for the price variable (usually called $products_price but it might also be in an array as in $random_product['products_price']). Then apply the max(0, price) trick.

 

If you have problems on a specific page, shout :P

Christian Lescuyer

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...