Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Changing the URL in the Order Confirmation when running site in iframe

Changing the URL in the Order Confirmation when running site in iframe

Locked

Views: 2,746

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
14 May 2010, 7:31 PM
#1
ibuttons avatar

ibuttons

New Zenner

Join Date:
Nov 2008
Posts:
51
Plugin Contributions:
0

Changing the URL in the Order Confirmation when running site in iframe

Can anyone tell me how to** change the URL in the Order Confirmation email** message that is behind the "Click here for a Detailed Invoice"?

Here is why I am asking for this:

I am displaying my ZC store from inside an IFRAME on my main site. This seems to work great--my cart is now integrated *perfectly *into the rest of my website. The only problem I have found so far is that Order Confirmation emails contain a link in them that goes directly to the store, and does not start at the real website and go through the IFRAME. That means, clicking on the link in the email order confirmation message brings up the store only and my store does not have a header and nav bars--these are part of the main site. So, I want to change the URL of that link, as follows:

from: http://bmisurgery.org/store/index.php?main_page=login
to: http://bmisurgery.org/index.php?ID=supplements-new

Also, I have not actually shipped out an order yet, as the store is not yet live, so are there any other such links that would also need to be changed in other email messages?

:smile: Sincere thanks in advance for any/all help anyone can give. All responses greatly appreciated!

For the record:

  1. I have searched extensively in the forums and on Google with many different keywords and phrases. No one has provided relevant info on this.

  2. I have used the Developer's Toolkit in the admin area and THOUGHT I found the file that is generating the email and tried to modify it, but not gotten the results I want. I am not sure I really l understand the code well enough to modify it.

  3. I am using: Zen Cart 1.3.8a
    Patch: 1::
    Database Patch Level: 1.3.8

  4. I have not upgraded this site -- it is brand new. I have been modifying the version I downloaded.

  5. I will list the few add-ons that I have if anyone wants me to, but they do not impact the email and I do not think that they are involved in this issue--I just need to modify the link in the email message.

14 May 2010, 8:39 PM
#2
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Changing the URL in the Order Confirmation when running site in iframe

Iframes and Zen Cart do not play well together, plus many payment gateways will not accept payments from an Iframes source, so this is a bad idea.

Check this thread http://www.zen-cart.com/forum/showthread.php?t=84362

15 May 2010, 9:02 PM
#3
ibuttons avatar

ibuttons

New Zenner

Join Date:
Nov 2008
Posts:
51
Plugin Contributions:
0

Re: Changing the URL in the Order Confirmation when running site in iframe

Got any suggestions for a better way to do this?

18 May 2010, 5:06 PM
#4
ibuttons avatar

ibuttons

New Zenner

Join Date:
Nov 2008
Posts:
51
Plugin Contributions:
0

Re: Changing the URL in the Order Confirmation when running site in iframe

Here's an important update for anyone interested (I found others who want to use an iframe within ZC by searching the forum using "iframe")"

When invoking ZC inside an iframe with Authorize.Net (SIM) as my 3rd Party Gateway, :yes:, I AM able to enter orders which are authorized and captured successfully.

To verify this, I checked A/N and the order shows up there, I checked ZC and see the order there. I even turned on the log and had it emailed to me and checked the fields in it: the return code from A/N looks fine.

Also of interest, I have tested my website and have not found any significant iframe issues other than the one I brought up in my original posting, (ie, *** the URL in the Order Confirmation "Click here for a Detailed Invoice"*** ). If anyone knows of any specific ones, please point them out to me, as I am human and could be missing something.

And lastly, I am not worried about the search engines as I have a site map for them to follow and also can set up URL redirects if needed. These will all be on the same domain name, just under different folders, so I don't THINK that Google et all will take umbrance with this, if I am interpreting their guidelines correctly.

So, given that, I'd like to go back to the original issue: I would think it really SHOULD be fairly easy to change the URL, provided one understands the code, which is a little difficult for me. So, again, does anyone know how to modify the URL in the Order Confirmation email?

Many thanks in advance for comments on this. I think it brought out many good issues which are important to consider.

18 May 2010, 11:01 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Changing the URL in the Order Confirmation when running site in iframe

If you must change it, just hack out the call in the orders.php class file which generates the URL intelligently by replacing the zen_href_link call with whatever replacement HTML you want to substitute instead.
ie: instead of zen_href_link(......), use literal '<a href='blahblah'>'

19 May 2010, 3:58 PM
#6
ibuttons avatar

ibuttons

New Zenner

Join Date:
Nov 2008
Posts:
51
Plugin Contributions:
0

Re: Changing the URL in the Order Confirmation when running site in iframe

DrByte:

... hack out the call in the orders.php class file which generates the URL intelligently by replacing the zen_href_link call with whatever replacement HTML you want to substitute instead.
ie: instead of zen_href_link(......), use literal '<a href='blahblah'>'

Thanks very much for the reply. I tried to do so, but apparently do not quite understand. Below is what I did:

  1. I edited the file: *** includes/classes/order.php***
  1. The first reference to zen_href_link was at line 75:
  • $zc_coupon_link = '<a href="javascript:couponpopupWindow(\'' . zen_href_link(FILENAME_POPUP_COUPON_HELP, 'cID=' . $coupon_link->fields['coupon_id']) . '\')">';*
    I do not change this because I am not sure what it is, but it mentions coupons, which do not show up in the confirmation email.
  1. The 2nd reference was at line 913:
    EMAIL_TEXT_INVOICE_URL . ' ' . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) . "\n\n";.

This looked like a good possibility, so I changed this to:
EMAIL_TEXT_INVOICE_URL . ' ' . '<a href="http://bmisurgery.org/index.php?ID=supplements-new" title="BMI Surgery Store">BMI Surgery Storeyyy</a>;' . "\n\n";.

I uploaded the file, reloaded my browser, entered a test order, and can see no change in the confirmation email.

  1. The 3rd reference was at line 924:
    $html_msg['INTRO_URL_VALUE'] = zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false);.

I changed this to:
$html_msg['INTRO_URL_VALUE'] = '<a href="http://bmisurgery.org/index.php?ID=supplements-new" title="BMI Surgery Store">BMI Surgery Storezzz</a>;';.

I uploaded the file, reloaded my browser, entered a test order, and the confirmation email now has a link to the wrong address: <http://bmisurgery.org/store/<a+href=>, which is, of course, no good, as it still is putting it's own prefix it and the remaining part is gibberish.

So, I could really use a little more help. Would you be able to send me the exact lines of code to use for:

  1. #1, if needed
  2. #2
  3. #3
  4. as well as the code to use to change the footer link Copyright (c) 2010 ** BMI Surgery Online Store** (I think I should probably change that as well)

Many thanks in advance.

22 May 2010, 7:31 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Changing the URL in the Order Confirmation when running site in iframe

Notwithstanding that I'm not a fan of the overall approach you're using with your site, and I'm not a fan of changing these links to no longer take the customer directly to their order, you should be able to accomplish what you requested by making the following changes in /includes/classes/order.php

  1. for Text-Only emails:
    Change this:EMAIL_TEXT_INVOICE_URL . ' ' . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false) . "\n\n";to this:```
    EMAIL_TEXT_INVOICE_URL . ' <a href="http://bmisurgery.org/index.php?ID=supplements-new" title="BMI Surgery Store">BMI Surgery Store</a>' . "\n\n";

2. for HTML-formatted emails:
Change this:```
    $html_msg['INTRO_URL_VALUE']       = zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $zf_insert_id, 'SSL', false);
```to this:```
    $html_msg['INTRO_URL_VALUE']       = '<a href="http://bmisurgery.org/index.php?ID=supplements-new" title="BMI Surgery Store">BMI Surgery Store</a>';
24 May 2010, 1:54 PM
#8
ibuttons avatar

ibuttons

New Zenner

Join Date:
Nov 2008
Posts:
51
Plugin Contributions:
0

Re: Changing the URL in the Order Confirmation when running site in iframe

Thank you for your help.

I tried what you sent me but still get the same result, that is, the link address is coming out wrong, as follows:

http://bmisurgery.org/store/<a+href=

Instead, it should be:

http://bmisurgery.org/index.php?ID=supplements-new

Looks like some other function is still putting the storefront directory name in the path and stripping out my stuff. Any ideas on how to fix?

Also, I appreciate your comment below and I actually do agree with you in part:

DrByte:

I'm not a fan of the overall approach you're using with your site....

However, I am at a loss for any other way to accomplish what I want, which is to really and truly integrate zc into the rest of my website. And judging from the forum entries, I am not the only one who wants to do this.

My thinking (plz tell me if I am wrong) is that there are just too many other, non-zc pages (some yet to come) and too much going on there to put my other pages into zc (as EZ pages or Define pages). And, the alternative is not attractive either, ie. have a link from the main part of my site that jumps into zc, which would have it own copy of the header, footer, css style sheets, and so forth. This is confusing for users to navigate in and out of--there are 2 different pages that are conceptually HOME--not to mention the maintenance effort required to keep both up to date and in sync.

I have looked through the add-on software for something that would allow me to build in LOTS of other pages, preferably CMS and blog stuff (which is coming) but found nothing. Have I just missed something there that you know of?

Any further discussion/suggestions/feedback form you on a better method would be appreciated. Zen Cart is truly a wonderful application--I am continually amazed and awed by what it does, how easy it is to customize, and how well it functions. Figuring out to more smoothly integrate it into a main website would be the frosting on the cake and would REALLY make it stand out as the premier shopping cart application. So let's do that! Hey, I'll even volunteer as your first beta tester! :yes:

TIA,

24 May 2010, 2:24 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Changing the URL in the Order Confirmation when running site in iframe

ibuttons:

Thank you for your help.

I tried what you sent me but still get the same result, that is, the link address is coming out wrong, as follows:

http://bmisurgery.org/store/<a+href=

Instead, it should be:

http://bmisurgery.org/index.php?ID=supplements-new

Looks like some other function is still putting the storefront directory name in the path and stripping out my stuff. Any ideas on how to fix?
I'm guessing that your language file has been customized and thus the original EMAIL_TEXT_INVOICE_URL definition is changed?
My suggestion was based on using the original content in the language file, particularly for that definition.

24 May 2010, 3:08 PM
#10
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Changing the URL in the Order Confirmation when running site in iframe

You could use the Document General product type to add additional pages to your Zen Cart. If you look at my nephew's site in my sig, it's Zen Cart as CMS and all the articles are Document General.

24 May 2010, 5:07 PM
#11
ibuttons avatar

ibuttons

New Zenner

Join Date:
Nov 2008
Posts:
51
Plugin Contributions:
0

Re: Changing the URL in the Order Confirmation when running site in iframe

afo:

If you look at my nephew's site in my sig, it's Zen Cart as CMS and all the articles are Document General.

Ok, sorry, *where *is that?

24 May 2010, 5:18 PM
#12
g1smd avatar

g1smd

Zen Follower

Join Date:
Mar 2010
Location:
UK
Posts:
449
Plugin Contributions:
0

Re: Changing the URL in the Order Confirmation when running site in iframe

24 May 2010, 8:13 PM
#13
ibuttons avatar

ibuttons

New Zenner

Join Date:
Nov 2008
Posts:
51
Plugin Contributions:
0

Re: Changing the URL in the Order Confirmation when running site in iframe

afo:

If you look at my nephew's site in my sig,

sorry, how do I get to that?

Never mind, I figured it out, you meant signature. I thought you were referring to a Special Interest Group or some such thing.

29 May 2010, 7:53 PM
#14
ibuttons avatar

ibuttons

New Zenner

Join Date:
Nov 2008
Posts:
51
Plugin Contributions:
0

Re: Changing the URL in the Order Confirmation when running site in iframe

DrByte:

I'm guessing that your language file has been customized and thus the original EMAIL_TEXT_INVOICE_URL definition is changed?
My suggestion was based on using the original content in the language file, particularly for that definition.

Can you be more specific on what you mean by your language file? I have kept a copy of the original files and can easily compare or go back and restore the file and then carefully add back in any changes I need, but I need to know what file(s) are involved.

I did compare my original version of includes/classes/order.php to my current one that has the changes you mentioned and that produced the bad results I reported, and the only differences are the lines that you gave me. So I am guessing you are referring to another file.

29 May 2010, 11:37 PM
#16
ibuttons avatar

ibuttons

New Zenner

Join Date:
Nov 2008
Posts:
51
Plugin Contributions:
0

Re: Changing the URL in the Order Confirmation when running site in iframe

DrByte:

https://www.zen-cart.com/tutorials/index.php?article=38
https://www.zen-cart.com/tutorials/index.php?article=39
Use the supplied Developers Toolkit to look up the define for that constant: EMAIL_TEXT_INVOICE_URL
Then compare that file from your server against the original Zen Cart files.

Thanks for the speedy reply, especially on a holiday weekend! Greatly appreciated.

Ok, I did as you suggested:

  1. I used the Dev Toolkit and searched on EMAIL_TEXT_INVOICE_URL.
  1. I found it is defined in /home/content/b/m/i/bmisurgery/html/store/includes/languages/english/checkout_process.php.
  1. I have not altered this file and I do not have a copy in my template override area, but just to be safe, I compared it to the original copy I have saved off on the side using WinMerge and found that the files are all identical.

While doing all that, I noticed that EMAIL_TEXT_INVOICE_URL is being set to the string Detailed Invoice. Here is the actual code: ***define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:'); *** which makes me wonder if this is even where the problem is.

Could you see if you can figure out where the value <a href="http://bmisurgery.org/index.php?ID=supplements-new" title="BMI Surgery Store">BMI Surgery Store</a> is being changed to http://bmisurgery.org/store/<a+href=?

I think it must be further down in this module where the variable email_order is being referred to a number of times. There are some str_replace function calls and some other things going on which I don't completely follow.

Hope that made sense. Let me know what you think and if you find anything.

30 Dec 2010, 5:03 PM
#17
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Changing the URL in the Order Confirmation when running site in iframe

ibuttons:

only[/U] and my store does not have a header and nav bars--these are part of the main site. So, I want to change the URL of that link, as follows:Hate to revive an old thread, but in case anyone runs across this (or the original author still lurks here) The BETTER way to do this is to NOT use iframes at all (as has been advised) and give a looksee at the Sanguine Embedded template..

This template is designed for sites that have an existing site design/template and want to incorporate their store into that design.. I've used this template, with great results..

anomalyrecords . net
clientphlaunthair . overthehillweb . com (Joomla & Zen Cart married using the Sanguine Embedded template)