Jump to content
thirty bees forum
  • 0

[SOLVED] Where did the Discount class go?




I've installed MyPresta's Voucher generator module, but get an exception when I try to mass generate vouchers through the module.

The exception starts with the following:

Class 'Discount' not found
at line 652 in file modules/vouchers/lib/voucherengine/engine.php

After examining the classes folder, I can see that the Discount class found in Prestashop 1.6, has been removed from Thirty Bees.

Does anyone know the reason behind this (I guess a lot of 3rd party modules rely on this class) or what it will take to modify my module in order to get it to work in Thirty Bees?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

If you look at the file classes/discount.php in Prestashop you will see that in its header it displays the comment " * @deprecated". It has been replaced by classes/specificPrice.php. As TB has thrown out some old stuff it has been discarded.

So you will need either to contact the author of the module or experiment yourself with using the specificPrice or specificPriceRule class instead of the Discount class.

Link to comment
Share on other sites

  • 0

Ahh... Thank you so much for the clarification.

As the module is already compatible with PS1.7 (which also uses the specificPrice class), all I had to to do in order to fix the module, was to change line 646 in modules/vouchers/lib/voucherengine/engine.php from

if (parent::psversion()== 7) to if (parent::psversion() > 5)

It now works flawlessly with Thirty Bees :slight_smile:

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