Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2006
    Location
    Austin, TX
    Posts
    25
    Plugin Contributions
    0

    changing the default product URL

    Trying to setup the tell a friend function, and it works like it's supposed to. However I've done some customized product pages and it directs the user in the email to check out the default url of the product instead.

    Been looking around the tell a friend php file and I'm willing to bet I need to change something about how zencart references:

    EMAIL_PRODUCT_LINK
    EMAIL_TEXT_LINK

    But how do I redefine these individually for each product?

    In my product page I have the correct URL referenced, so I'm confused.

    thanks for the ideas,

    Dave

    example : http://www.302designs.net/tshirts/test.html

    the link in the email and the auto redirect page should go to my own customized URL, not the zen cart one

  2. #2
    Join Date
    Jun 2006
    Location
    Austin, TX
    Posts
    25
    Plugin Contributions
    0

    Re: changing the default product URL

    anyone ?

  3. #3
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: changing the default product URL

    /includes/modules/pages/tell_a_friend/header_php.php
    approx line 92 has:
    PHP Code:
        $email_body .= sprintf(EMAIL_TEXT_LINKzen_href_link(zen_get_info_page($_GET['products_id']), 'products_id=' $_GET['products_id']), ''false) . "\n\n" .
        
    sprintf(EMAIL_TEXT_SIGNATURESTORE_NAME "\n" HTTP_SERVER DIR_WS_CATALOG "\n");

        
    $html_msg['EMAIL_TEXT_HEADER'] = EMAIL_TEXT_HEADER;
        
    $html_msg['EMAIL_PRODUCT_LINK'] = sprintf(str_replace('\n\n','<br />',EMAIL_TEXT_LINK), '<a href="'.zen_href_link(FILENAME_PRODUCT_INFO'products_id=' $_GET['products_id']).'">'.$product_info->fields['products_name'].'</a>' ''false); 
    change to:
    PHP Code:
    if ($product_info->fields['products_url'] == '') {
        
    $email_body .= sprintf(EMAIL_TEXT_LINKzen_href_link(zen_get_info_page($_GET['products_id']), 'products_id=' $_GET['products_id']), ''false) . "\n\n" .
        
    sprintf(EMAIL_TEXT_SIGNATURESTORE_NAME "\n" HTTP_SERVER DIR_WS_CATALOG "\n");

        
    $html_msg['EMAIL_TEXT_HEADER'] = EMAIL_TEXT_HEADER;
        
    $html_msg['EMAIL_PRODUCT_LINK'] = sprintf(str_replace('\n\n','<br />',EMAIL_TEXT_LINK), '<a href="'.zen_href_link(FILENAME_PRODUCT_INFO'products_id=' $_GET['products_id']).'">'.$product_info->fields['products_name'].'</a>' ''false);
        
    $html_msg['EMAIL_TEXT_SIGNATURE'] = sprintf(str_replace('\n','',EMAIL_TEXT_SIGNATURE), '' );
     } else {
        
    $email_body .= sprintf(EMAIL_TEXT_LINK$product_info->fields['products_url'], ''false) . "\n\n" .
        
    sprintf(EMAIL_TEXT_SIGNATURESTORE_NAME "\n" HTTP_SERVER DIR_WS_CATALOG "\n");

        
    $html_msg['EMAIL_TEXT_HEADER'] = EMAIL_TEXT_HEADER;
        
    $html_msg['EMAIL_PRODUCT_LINK'] = sprintf(str_replace('\n\n','<br />',EMAIL_TEXT_LINK), '<a href="'.$product_info->fields['products_url'].'">'.$product_info->fields['products_name'].'</a>' ''false);
    }
        
    $html_msg['EMAIL_TEXT_SIGNATURE'] = sprintf(str_replace('\n','',EMAIL_TEXT_SIGNATURE), '' ); 
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  4. #4
    Join Date
    Jun 2006
    Location
    Austin, TX
    Posts
    25
    Plugin Contributions
    0

    Default Re: changing the default product URL

    no luck unfortunately, still sends the user to the default template page of the product. this is a start, so I will start to experiment within this file. other ideas?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: changing the default product URL

    oops.

    Line 20 of that same file says:
    PHP Code:
      $product_info_query "SELECT pd.products_name 
    change it to:
    PHP Code:
      $product_info_query "SELECT pd.products_name, pd.products_url 
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Jun 2006
    Location
    Austin, TX
    Posts
    25
    Plugin Contributions
    0

    Default Re: changing the default product URL

    ALMOST worked.

    Now it sends me to url: http://www.302designs.net/catalog/ww...ee_design.html

    I looked around the code and cannot figure out how to get rid of the redundant URL.

    Also, after someone submits the "email a friend" form, there's an autoredirect to the default product page. I would need this page to match the URL that is being sent in the email too (or at least a page that says "thanks for the recommendation").

    Thanks for all your help Dr. Byte!

  7. #7
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: changing the default product URL

    You could either change all your product URL's to include the http:// at the start, or edit the code to embed it automatically.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Jun 2006
    Location
    Austin, TX
    Posts
    25
    Plugin Contributions
    0

    Default Re: changing the default product URL

    That did the trick for the bad URL, now about the redirect:

    After someone submits the "email a friend" form, there's an autoredirect to the default product page. I would need this page to match the URL that is being sent in the email too (or at least a page that says "thanks for the recommendation").

  9. #9
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: changing the default product URL

    You're gonna really love upgrading aren't you.

    Try playing with this, around line 124 of the same file:
    PHP Code:
        zen_redirect(zen_href_link(zen_get_info_page($_GET['products_id']), 'products_id=' $_GET['products_id'])); 
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. v151 Product Sort within Category - having problems changing the default sort order
    By Don Wagner in forum Customization from the Admin
    Replies: 4
    Last Post: 21 Oct 2012, 03:03 AM
  2. v138a Changing the shipping default
    By sammy419 in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 29 Jan 2012, 04:07 AM
  3. How to change the default URL?
    By CrazyArtist in forum Customization from the Admin
    Replies: 8
    Last Post: 27 Feb 2011, 04:12 AM
  4. Changing product ID's (shown in the URL)
    By empirenine in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 27 Sep 2006, 06:03 AM

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