Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Modify Price in Basket, not Database


dwbeuki

Recommended Posts

Posted

Hi, I've been reading a lot, and unable to find the solution.

 

I have an osc 2.3 site, and have written an offer system.

 

The user can make an offer, the Offer-admin works from a separate 'admin panel' (not an osc admin -- but a user who works with offers - so I built a seperate page for them to look at the offers).

They can accept or counter. Once the offer has been accepted, the item gets placed in the users basket.

 

The problem, I don't see how to change the price, without changing it in the database.

 

Since we may accept an offer of 20% less than list price on 1 item, If I change it in database, the next person could reduce it an additional 20% and so forth.

 

It's a high traffic site, so changing the database temporarily will not work either.

 

I'm looking through all the related files, but I just seem to be overlooking it somehow. Any guidance would be GREATLY appreciated :) Thank you!

================================

edited 12/3/12-9:40

 

in shopping_cart.php -- if I changed the $products[$i].['final_price'] -- would that reflect in the cart, and at checkout?

Posted

Look in the add-ons section for b2b and/or customer pricing/discount mods, one might fit your need.

Posted

I have looked, and just double checked again. There is only one, and it broke somewhere along the way as I installed it. I tried it 3 times with the same results. So, I've used it to help guide me through some of the file changes that are needed - and been able to get as far as getting the accepted offer information to the basket. (that was what $products[$i].['final_price'] did for me).

 

However, the basket's total is not pulled from the basket's displayed contents - and it doesn't match.

 

which means the order is not matching....

 

(w00t) I'm stressing for sure... sorry...

 

Please, help me

Posted

Hi

 

The includes/classes/order.php in 2.3.3 pulls the final price from data gathered in includes/classes/shopping_cart.php - both look to whatever is in the database so are going to ignore what's on the screen in the cart I reckon.

 

Off the top of my head I reckon that what you want to do could be done by creating a customer specificsql table with a -ve price value to match the agreed discount.

 

You'd have to setup a new sql table - something like customer_id, product_id, discount_amount and then go find the code in classes/shopping_cart.php and tell it to go check the new table before displaying prices - that should kick into order.php too

 

You could also look at SPPC and maybe create a new customer group & price on the fly for the product - maybe a hammer to crack a nut though

 

Bob

Posted

Thank you bob! I think that will work! I believe I'm seeing what's happening 'finally' and can intercept it properly. Thank you for your time and explanation. I have a glimmer of hope haha.

Archived

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

×
×
  • Create New...