Jump to content

Price change during order process (using module)


jareq

Recommended Posts

Is there possible to change price during order process in prestashop ? I need to make module that would add shipping price depending on some conditions (can't do it in presta, need module). I've tried to do it on some hooks (hookBackBeforePayment, hookBeforeCarrier, hookProcessCarrier, hookExtraCarrier) , i simply tried to change ['total_price'] or other variables that are passed to hook functions.

Would appreciate any help.

Link to comment
Share on other sites

Maybe try to find how they do it when changing carrier in PS. Here they change price as well, so should be similar to existing carrier change, i'd say. Sorry, no time to explore tonight for you... but probably the carrier module self, or otherwise some controller.

 

What version do you use??

  • Like 1
Link to comment
Share on other sites

<p>Maybe it helps to look how they update prices while (still in the product selection process) in the carriercompare module. Here they change prices ( real update seems to be done with this line:  </p>

<p>     if (!$this->context->cart->update())</p>

<div> </div>

<div>But pre-conditions need to be change beforehand of course. In this case the user can choose a county and a carrier and the (shipping) price will change accordingly.</div>

<div> </div>

<div>Maybe this looks like what you need? Give it a look.</div>

<div> </div>

<div>My 2 cents,</div>

<div>Pascal.</div>

 

Link to comment
Share on other sites

Maybe try to find how they do it when changing carrier in PS. Here they change price as well, so should be similar to existing carrier change, i'd say. Sorry, no time to explore tonight for you... but probably the carrier module self, or otherwise some controller.

 

What version do you use??

 

Hey, writing carrier module solved the problem. Thank you

Link to comment
Share on other sites

  • 1 year later...
  • 10 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...