Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28
  1. #21
    Join Date
    Dec 2011
    Posts
    2
    Plugin Contributions
    0

    Default Re: Printable, numbered gift certificates

    Hi Georgefly,

    Great addon..

    I think I have most of it installed correctly.. Ive got the product all the way up to the download part and the get a 404 error when I hit the download button:

    **///Commented///**http://www.epiphanydayspa.com/store/pub/.isznbzi_5_5_1_0.01/gutsc431nForw.phpwww.epiphanydayspa.com/store/dompdf/dompdf.php?input_file=http%3A%2F%2Fwww.epiphanydayspa.com%2Fstore%2Fpub%2F.isznb zi_5_5_1_0.01%2Fgutsc431nForw.php%2F..%2F..%2F..%2Fdownload%2Fgutsc431n%2Fgutsc4 31n.php%3Forders_id%3D5%26orders_products_id%3D5%26products_quantity%3D1%26cur_p rice%3D0.01&paper=a4&output_file=GiftCertificate.pdf[/url]


    I would LOVE to get this working!
    Any ideas?

  2. #22
    Join Date
    Dec 2011
    Posts
    2
    Plugin Contributions
    0

    Default Re: Printable, numbered gift certificates

    I figured it out. Bad dompdf url I am now going to try to add fields to be printed. I need a date of purchase and product name. Any thoughts?

  3. #23
    Join Date
    Mar 2005
    Posts
    70
    Plugin Contributions
    0

    Default Re: Printable, numbered gift certificates

    Any chance of sharing "bad file location"? im stuck where you were at. which file did you change location in was it gutsc431n.php in the download folder?

    thanks
    Mike Z
    Never be afraid to try something new, remember that amateurs built the ark, professionals built the Titanic

  4. #24
    Join Date
    Apr 2011
    Posts
    10
    Plugin Contributions
    2

    Default Re: Printable, numbered gift certificates

    @ becktowery
    you can get product name as op.products_name (this is actually in table "orders_products"), and date of purchase as o.date_purchased (this is actually in table "orders")
    and in header_php.php:
    1. add these fields (op.products_name and o.date_purchased) to the sql query in line ~28-36
    2. to add the data to the string that makes up the temporary directory name:
    >in line ~213, where it says "$tempdir = zen_random_name($downloads->fiel...":
    add $downloads->fields['products_name'] and $downloads->fields['date_purchased']
    >in line ~71, where it says "function zen_random_name($orders_produc...":
    add variables passed to the function ("function zen_random_name($orders_products_id, $products_quantity, $products_price, $products_name, $date_purchased)")
    >in line ~77 $curOrder = $_GET['order'] . "_" . $orders_products_id . "_" . $products_quantity . "_" . round($products_price,2) . "_" . $products_name . "_" . $date_purchased;

    before adding extracting the info into the actual pdf, just try to download the original pdf. this may not work now or look screwed up, because you messed around with the temporary directory name, and e.g. added strange characters with products_name, or date_purchsed, so you may want to make sure to change products name to something that is tolerated as part of a directory name, and maybe you also have to modify the format that date_purchased is passed.

    anyway, once that is sorted, extract the info in gutsc431nForw.php (underneath line ~18 where it says "// identify order_id, products_price, etc. based on temp fold..." and add as GET variable to $curfileurl (line ~35)

    finally, $_GET the new data in gutsc431n


    as i said, the only bottleneck is the fact that you pass all data inside this temporary directory name, which may lead to problems if your data contains characters that are not allowed in directory names; furthermore, dompdf may be more choosy on the $curfileurl the we pass in gutsc431nForw.php (line ~37)

    hope that is of some help!
    G

  5. #25
    Join Date
    Mar 2006
    Posts
    89
    Plugin Contributions
    0

    Default Re: Printable, numbered gift certificates

    A problem I had that broke my brain for most of today... I was getting an "Internal Server Error".

    The server log showed:
    SoftException in Application.cpp:601: Directory "/home/mydir/public_html/mysite/pub/.ggnshlinhp_7_7_1_0" is writeable by group, referer: http://www.mysite.com.au/index.php?m...eckout_success

    This occurred when the download button was clicked. It seems not to like the group writeable dir. The fix is simple, as follows:

    includes/modules/pages/download/header_php.php around line 223:

    mkdir(DIR_FS_DOWNLOAD_PUBLIC . $tempdir, 0777);

    Changed to:

    mkdir(DIR_FS_DOWNLOAD_PUBLIC . $tempdir, 0755);

    Voila! It works now. Hope this saves another fried brain...
    (c:

  6. #26
    Join Date
    Mar 2006
    Location
    Tennessee
    Posts
    310
    Plugin Contributions
    0

    Default Re: Printable, numbered gift certificates

    Quote Originally Posted by becktowery View Post
    Hi Georgefly,

    Great addon..

    I think I have most of it installed correctly.. Ive got the product all the way up to the download part and the get a 404 error when I hit the download button:

    **///Commented///**http://www.epiphanydayspa.com/store/pub/.isznbzi_5_5_1_0.01/gutsc431nForw.phpwww.epiphanydayspa.com/store/dompdf/dompdf.php?input_file=http%3A%2F%2Fwww.epiphanydayspa.com%2Fstore%2Fpub%2F.isznb zi_5_5_1_0.01%2Fgutsc431nForw.php%2F..%2F..%2F..%2Fdownload%2Fgutsc431n%2Fgutsc4 31n.php%3Forders_id%3D5%26orders_products_id%3D5%26products_quantity%3D1%26cur_p rice%3D0.01&paper=a4&output_file=GiftCertificate.pdf[/url]


    I would LOVE to get this working!
    Any ideas?
    Quote Originally Posted by becktowery View Post
    I figured it out. Bad dompdf url I am now going to try to add fields to be printed. I need a date of purchase and product name. Any thoughts?
    I'm having the same issue. Can you please share what you changed to fix this? I've looked and looked, but apparently am completely missing whatever needs to be changed.
    Thanks!
    I'll finish that project tomorrow, I've made enough mistakes today!

  7. #27
    Join Date
    Apr 2011
    Posts
    10
    Plugin Contributions
    2

    Default Re: Printable, numbered gift certificates

    hi guys.
    with respect to adding purchase date, etc. see my last post in this thread.
    there is another issue i came across when i recently moved my shop to another webspace. it appeared that the server had problems with symlinks: the file thats called upon clicking the download button (e.g. /pub/.isznbzi_5_5_1_0.01/gutsc431nForw.php) is actually created on the fly as a symlink to the file /download/gutsc431nForw.php
    although my server allowed zencart to actually create the symlink file, i would keep getting an access right error message on my browser when trying to download the voucher. in case, anybody runs into the same problem, the solution is to have zen cart make an actual real copy of gutsc431nForw.php rather than just have zen cart create the symlink.
    to do that, make some changes in /includes/modules/pages/download/header_php.php

    line ~217
    replace:
    $link_create_status = @symlink(DIR_FS_DOWNLOAD . $origin_filename, DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $download_link);
    with:
    $link_create_status = copy(DIR_FS_DOWNLOAD . $origin_filename, DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $download_link);

    also, we want to totally avoid user accidently downloading our php file, if something goes wrong (i saw that this could happen, when i tried to figure out the symlink problem):
    line ~227
    replace
    if ( DOWNLOAD_BY_REDIRECT != 'true' or $link_create_status==false ) {
    with
    if (substr($origin_filename,-4) != ".php" && ( DOWNLOAD_BY_REDIRECT != 'true' or $link_create_status==false) ) {

  8. #28
    Join Date
    Mar 2006
    Location
    Tennessee
    Posts
    310
    Plugin Contributions
    0

    Default Re: Printable, numbered gift certificates

    Quote Originally Posted by georgfly View Post
    hi guys.
    with respect to adding purchase date, etc. see my last post in this thread.
    Hi Georgfly,

    Sorry for any confusion. I should have edited the 'quote' I copied. The problem I'm having is when I click the download button, I get:

    Forbidden

    You don't have permission to access /dompdf/dompdf.php on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    And the url shows as:
    Code:
    http://steelhorseroad.com/dompdf/dompdf.php?input_file=http%3A%2F%2Fsteelhorseroad.com%2Fstore%2Fpub%2F.sxfleryj_12978_88_1_10%2Fgutsc431nForw.php%2F..%2F..%2F..%2Fdownload%2Fgutsc431n%2Fgutsc431n.php%3Forders_id%3D12978%26orders_products_id%3D88%26products_quantity%3D1%26cur_price%3D10&paper=a4&output_file=My_Fancy_PDF.pdf
    A previous poster had a similar issue and said he/she fixed it, that it was a bad url, but didn't post where or what needed to be changed.

    Will the code change you posted above fix this issue?

    Any help would be greatly appreciated!
    Last edited by Boggled; 24 Nov 2012 at 12:31 AM.
    I'll finish that project tomorrow, I've made enough mistakes today!

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. New printable gift certificate module
    By le85 in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 14 Dec 2012, 04:20 PM
  2. Printable Gift Vouchers
    By niccol in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 13 Dec 2011, 12:29 AM
  3. Can I prevent Gift Certificates from being bought with Gift Certificates?
    By Brianwocky in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 21 Dec 2010, 07:11 PM
  4. Gift Certificates/Printable GCs/Group Discounts
    By STFlats in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 30 Nov 2009, 03:35 PM
  5. Creating sequentially numbered downloads for paper gift certificates ?
    By Austria_Des in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 27 Jun 2009, 03:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR