Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2016
    Location
    Minneapolis, MN
    Posts
    37
    Plugin Contributions
    0

    help question Updating code a bit

    Hello!
    Name:  serverfp.jpg
Views: 145
Size:  14.3 KB

    I am attempting to convert so code that we had on old Oscommerce sites to Zen Cart compatible. I need help get things just right.

    PHP Code:
    <!--bof Add to Cart Box -->
    <?php

         
    if (STORE_STATUS 0) { ?>
            <tr>
            <td class="smallText">
            
            <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
              <tr class="infoBoxContents">
                <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
                  <tr>
                    <td class="main">To place your order please contact:</td>
                   </tr>
                  <tr>
                    <td class="main">
                    <?php  
                        
                        
    echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '" target="_blank" class="linkListing-navig"><strong>' 
                          
    zen_get_configuration_key_value('STORE_NAME') . '</strong></a><br>';
                        
                        echo 
    'Contact Name: <em>' zen_get_configuration_key_value('STORE_OWNER') . ' </em><br>';
                        echo 
    'Address: <em>' zen_get_configuration_key_value('STORE_NAME_ADDRESS') . '</em><br>' ;
                        
                    
    ?>
                    </td>
                    <td class="main">
                    <?php 
                        
    echo 'Phone: <em>(' zen_get_configuration_key_value('STORE_TELEPHONE_CUSTSERVICE'). '</em><br>';
                        echo 
    'Email: <em><a href="mailto:' zen_get_configuration_key_value('STORE_OWNER_EMAIL_ADDRESS') . '">' zen_get_configuration_key_value('STORE_OWNER_EMAIL_ADDRESS') . '</a></em><br>'
                            
                    
    ?>
                    </td>

                  </tr>
                </table></td>
              </tr>
            </table>

            <br>
                    <table width="100%"  border="0">
                              <tr>
                            <td class="main">Download the <a href="<?= zen_href_link(FILENAME_PDF,'products_id='.(int)$_GET['products_id'],'NONSSL'); ?>" class="linkListing-navig"> ORDER FORM</a>, fill it out and email it directly to <a href=mailto:"<?php zen_get_configuration_key_value('STORE_OWNER_EMAIL_ADDRESS');?>" >'. <?php zen_get_configuration_key_value('STORE_OWNER_EMAIL_ADDRESS');?> .'</a>
                                <br>If you can't open the file you need to get Acrobat Reader. <a href="http://www.adobe.com/products/acrobat/readstep2.html" target="_blank" class="linkListing-navig">Click here</a> to get it free of charge</a>.<br></td>
                            <td valign="top"><a href="http://www.adobe.com/products/acrobat/readstep2.html" target="_blank"><img src="images/getacro.gif" border="0"></a></td>
                              </tr>
                        </table><br><br>
                <?php 
                
            
    ?>
    This is for Showcase stores and I need them to create a pdf order form to send to the store owner. I have added
    PHP Code:
    define('FILENAME_PDF' 'pdf'); 
    to my filenames.php and I have the file pdf.php in a few places (/includes/ and /includes/templates/).

    I would like them to be able to email the form to the store owner.

    I'm reaching the end of my php knowledge.

    Any help will be appreciated and thank you in advance for any help.


    If you want to see it somewhat live here is a test site: Test Site

  2. #2
    Join Date
    Jun 2016
    Location
    Minneapolis, MN
    Posts
    37
    Plugin Contributions
    0

    Default Re: Updating code a bit

    So I think I've boiled it down to what may be the issue.

    So when I click on "ORDER FORM" (or hover) it wants to go here: http://peturncatalog.com/foreverp/in...roducts_id=907

    Which doesn't exist apparently. The code that creates the url link for Order Form is this:

    HTML Code:
    <td class="main">Download the <a href="<?= zen_href_link(FILENAME_PDF, 'products_id='.(int)$_GET['products_id'] ,'NONSSL'); ?>" target= "_blank" class="linkListing-navig"> ORDER FORM</a>
    I think it should look something like this: http://peturncatalog.com/foreverp/pd...products_id=37

    So I looked at html_output.php I saw this bit of the code for the the href links:
    PHP Code:
     if (!$static) {
          if (
    zen_not_null($parameters)) {
            
    $link .= 'index.php?main_page='$page "&" zen_output_string($parameters);
          } else {
            
    $link .= 'index.php?main_page=' $page;
          }
        } else {
          if (
    zen_not_null($parameters)) {
            
    $link .= $page "?" zen_output_string($parameters);
          } else {
            
    $link .= $page;
          }
        } 
    So I think I need to force the zen_href_link to be static and not add index.php?main_page.

    Can someone help with this?

    Thanks in advance

  3. #3
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Updating code a bit

    So to make upgrading easier, the define for FILENAME_PDF would probably better served in includes/extra_configures in its own file. This way there would not be a need to merge/remerge the line, but instead copy of the file(s) applicable to your changes.

    As to the zen_href_link change if you haven't already figured it out. The store/catalog side zen_href_link function is declared like this:
    Code:
    function zen_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true, $static = false, $use_dir_ws_catalog = true)
    Which means that any parameter(s) not added will be set to the value(s) seen in the function above.

    For the existing function call, unless there is a specific reason to use alternate settings between the current last parameter and the static parameter.

    Considering the proposed content, wouldn't it be wise to use the SSL if it is enabled and present? (note change below).

    Suggestion would be:
    Code:
    zen_href_link(FILENAME_PDF, 'products_id='.(int)$_GET['products_id'], 'SSL', true, true, true);
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v151 need help to find a little bit of code.
    By Nixe in forum General Questions
    Replies: 2
    Last Post: 19 Mar 2013, 01:58 PM
  2. v150 Why is this little bit of code showing on my page?
    By WebKat in forum General Questions
    Replies: 6
    Last Post: 1 Apr 2012, 07:19 PM
  3. coupon email - bit of code help required
    By Diva in forum General Questions
    Replies: 5
    Last Post: 6 Sep 2008, 09:24 PM
  4. which bit of code needs ammending in shipping.php
    By riseheadoffice in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 29 Aug 2008, 06:35 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