Jump to content

prestashop module change the price of the product without changing the actual price


prestashop_newuser

Recommended Posts

Hi,

 

I am doing a small module. In that I want that I will fetch all the products in my module and when I will give the price amount(new amount) for that product without changine the original product price then it should show the price(new amount) of the product in frontend. Now when I will remove/uninstall the module then it should show the original price(actual old price) at the frontend. So can someone kindly tell me how to do this? Any help and suggestions will be really appreciable. Thanks

Link to comment
Share on other sites

A few problems you encounter are:

- What should happen when someone adds the product to his shopping cart?

- What should happen when someone buys it?

- Changing the price only on one place is not that simple as it shows up in so many places simultaneously (Page, shopping cart, ajax cart etc).

 

Does the module give a special price for individual products, or for all products the same discount/price-increase? If an all over the shop change, maybe consider to use groups, where non-logged in people see a different price from logged in people, and VIP's yet another price or so.

 

If this won't work, please explain the reason behind the price change in some more detail.

 

My 2 cents,

pascal

Link to comment
Share on other sites

A few problems you encounter are:

- What should happen when someone adds the product to his shopping cart?

- What should happen when someone buys it?

- Changing the price only on one place is not that simple as it shows up in so many places simultaneously (Page, shopping cart, ajax cart etc).

 

Does the module give a special price for individual products, or for all products the same discount/price-increase? If an all over the shop change, maybe consider to use groups, where non-logged in people see a different price from logged in people, and VIP's yet another price or so.

 

If this won't work, please explain the reason behind the price change in some more detail.

 

My 2 cents,

pascal

 

 

Hi,
I am going through all of your questions one by one here
 
Q - What should happen when someone adds the product to his shopping cart?
A - Yes the new price will be applied to the product when someone adds the product to his shopping cart?
 
Q - What should happen when someone buys it?
A - Yes the new price for the product will be applied when someone buys it.
Link to comment
Share on other sites

  • 2 weeks later...

Hi PS_newuser,

What you describe here seems not easy to build inside a module. What you could do is just updating the products using import/update using a csv file or so, with the new, temporary prices. Then when the time comes to undo the price change, re-import/update them again with the old prices...

 

Please backup your database before trying this though. Importing products is error-prone. Go carefully and try it out on one or two products first...

 

pascal.

Link to comment
Share on other sites

You should develop a module which uses its own DB table to store the price change value and it's conditions (a price change should have a reason rite ?)
You should also develop a custom classes file to implement all aspect that you want to achieve, and may have to override the default Prestashop Classes and Controller files.

 

For an example :

By default Product "Dummy" had a Price USD 50

Then via module that you've developed, the original Price can be modified according to specific conditions (which defined within your module) where the data will be saved on it's own DB table.

Finally in the Front Office  this modification will be processed and implemented by overriding the default Prestashop core files (Cart, Order, etc)

 

Good luck ... :)

Link to comment
Share on other sites

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...