Jump to content

Recommended Posts

Hi all.. I'm new to the forums here, but ...

 

I'm looking after an ecommerce site for somebody & helping her come to grips with Prestashop's features. She's currently running a promotion whereby a voucher seller gave her a bunch of single-use codes associated with a range she's wanting to sell at a discount. So far so good.. I got the list of voucher codes, 500 in all.. and added them to the database with a script..

 

Now, we've noticed that any logged in customer can see ALL the voucher codes. This isn't quite what is needed to happen. I know we can assign a voucher or vouchers to groups or single customers, but we don't know ahead of time which customers are going to use which vouchers.

 

The way things look to go is.. if you can use the voucher, you should be able to see it by default. I want to be able to hide these 'bulk' vouchers.

 

I've been thinking of ways around this.. the quickest way would be to hack the theme template so that it simply doesn't show the 'my vouchers' link, but that's going to get in the way of future plans.

 

I've come up with an idea to alter the ps_discounts table to add a 'is_visible' column, which I can possibly parse to decide whether or not to show the voucher. Then we set the 'bulk' vouchers to 'invisible', then they're still usable & the only way anyone can use one is if somebody were to give them the code directly (which is what the voucher sales site does). Although after looking at the code in classes/Discount.php I suspect this method is flawed because the same code which lists all the vouchers is also used for voucher validation.

 

Can anybody come up with a better idea? Is there a module I can use to get this kind of functionality? I suspect that PS 1.5 might eat up this problem in one gulp but the template we have (from TemplateMonster) really won't operate with 1.5 without a lot of work.

 

Thanks in advance,

Justin

 

EDIT::

 

Whoops! After some experimentation I discovered that I should not have squirted the vouchers into the table with the group_id set to '1' (default)... with it set to '0' (all customers) instead the codes still work, and hey presto they're no longer listed in a logged in customer's 'My Vouchers' page.

 

Let that be a lesson for somebody else. Heh

Edited by justinh (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...