Contributions
e-vouchers
This e-voucher contribution is suitable for small to medium sites and requires no alteration to the oscommerce php files so enjoy.
Expand All / Collapse All
Please use this in place of my contribution below. The voucher_popup_image.php file was incorrect.
These are two files that can be used to roll up the changes described in the contributions below. Voucher_info.php is a modification of product_info.php, and contains two changes:
1. Inclusion of some logic to enforce the "use once" rule, and advises customers if the voucher has been used (lines 18 and 50).
2. The use of a modification of the popup_image.php file, voucher_popup_image.php (line 111).
Voucher_popup_image.php contains a change that allows the popup to display an image only if the product status is inactive. The standard popup_image.php file will display a broken image if left unmodified.
Here is an additional fix for this great idea.
When i used this technique initially it would not link to a product that was set non active in the admin panel. If i set it active it would, but then you could see the voucher along with all the other products.
This is to do with the 'status' query check inside products_info.php,
in basic terms by default all status 1 products will be displayed.
All status 0 products will not.
By making a second version of products_info.php with the where status = 1
changed to where staus = 0, and then using that new file as the link to the
non activated voucher product, it then works exactly as described. :-)
So.. heres how i fixed my version.
(1) open up products_info.php in a text editor
(2) Look for the part where it says : where p.products_status = '1'
In my file it was on line 17 and 82, it could be different in yours.
(3) Change the 1 to a 0
(4) Re-save the file with a different name like : products_info_voucher.php
Now when you make your voucher product and set it non active.
Use the link to the product method as described in the original documentation
for this contribution but use products_info_voucher.php instead of products_info.php
That works perfectly for me - hopefully it will fix it for you as well!
This e-voucher contribution is suitable for small to medium sites and requires no alteration to the oscommerce php files so enjoy.
Note: Contributions are used at own risk.