Not sure what to use for this

Discussion in 'Java' started by Marshall Dudley, Feb 9, 2005.

  1. I have a requirement where I need to insert a cart contents into all the
    pages of a website. There are two websites involved, the main website
    of the store owner, and the website of the shopping cart service. I
    need to be able to display the cart contents of the cart that is on the
    service, on pages that are thrown by the main site.

    When an item is added to the cart a post is made from the main site to
    the service site, then after the service site adds the item to the cart,
    the customer is returned back to the main site. I need the cart
    contents to appear in a cell or applet on the main site.

    I have looked at the following, but seem to be constrained on each of
    them.

    Method
    Use cookies with javascript.
    Problem
    Cookies can be placed on the client's system by the cart system, but the
    javascript will be in a document on the main site and thus they cannot
    be read.

    Method
    Use javascript
    Problem
    I can't find any way to get javascript to access a webpage and put it's
    contents into the cell of a table in the main document, or access a
    website and acquire data which it puts into fields of the main
    document. If this can be done, I would appreciate it if someone could
    point me in the right direction.

    Method
    Use a Java Applet
    I am completely unfamiliar with this. But from reading it appears I can
    access information, but it cannot be from a different website than the
    one the present page is on for security reasons. If so I can't use it
    either. Also if it can access a page on another site, or information
    from another site, would it provide the appropriate cookies to the
    service site so they can identify the correct customer/cart?

    Thanks,

    Marshall
    Marshall Dudley, Feb 9, 2005
    #1
    1. Advertising

  2. Marshall Dudley wrote:
    > I have a requirement where I need to insert a cart contents into all the
    > pages of a website. There are two websites involved, the main website
    > of the store owner, and the website of the shopping cart service. I
    > need to be able to display the cart contents of the cart that is on the
    > service, on pages that are thrown by the main site.
    >
    > When an item is added to the cart a post is made from the main site to
    > the service site, then after the service site adds the item to the cart,
    > the customer is returned back to the main site. I need the cart
    > contents to appear in a cell or applet on the main site.
    >
    > I have looked at the following, but seem to be constrained on each of
    > them.
    >
    > Method
    > Use cookies with javascript.
    > Problem
    > Cookies can be placed on the client's system by the cart system, but the
    > javascript will be in a document on the main site and thus they cannot
    > be read.
    >
    > Method
    > Use javascript
    > Problem
    > I can't find any way to get javascript to access a webpage and put it's
    > contents into the cell of a table in the main document, or access a
    > website and acquire data which it puts into fields of the main
    > document. If this can be done, I would appreciate it if someone could
    > point me in the right direction.
    >
    > Method
    > Use a Java Applet
    > I am completely unfamiliar with this. But from reading it appears I can
    > access information, but it cannot be from a different website than the
    > one the present page is on for security reasons. If so I can't use it
    > either. Also if it can access a page on another site, or information
    > from another site, would it provide the appropriate cookies to the
    > service site so they can identify the correct customer/cart?
    >
    > Thanks,
    >
    > Marshall
    >

    what is the technologies that use the two sites ?

    Georgios Maravelias
    Giorgos Maravelias, Feb 9, 2005
    #2
    1. Advertising

  3. Marshall Dudley

    Guest

    As I understand it you are dealing with 2 sites: the shopping site, and
    the cart site. And you want to do this:

    shopping -> cart -> shopping

    And you want to display the cart contents on the second instance of the
    shopping site.

    If I've got that much right - I think you'll need to post whatever data
    you need back to the shopping site. There isn't a good method of
    passing data between sites using only client side code. And I don't
    see how an applet is going to help either.

    On the cart site, can you store the data in some hidden fields, do
    whatever processing you do, then post the data back to the shopping
    site?
    , Feb 9, 2005
    #3
  4. Giorgos Maravelias wrote:

    > what is the technologies that use the two sites ?
    >
    > Georgios Maravelias


    The shopping cart server, Free BSD, Apache and Perl.
    The main store site, can be anything, but most are running either a Unix
    flavor with Apache, or a Windows server with whatever they run. I have no
    control over them. I do not want to try to walk clients through getting server
    side includes turned on, expecially since many hosting companies do not even
    allow them.

    Thanks,

    Marshall
    Marshall Dudley, Feb 9, 2005
    #4
  5. wrote:

    > As I understand it you are dealing with 2 sites: the shopping site, and
    > the cart site. And you want to do this:
    >
    > shopping -> cart -> shopping


    Yes, it goes to the cart just long enough for the cart site to record the
    addition to the cart, then it does a meta refersh back to the original
    site. Of course when they go to checkout, it stays in the cart until the
    purchase is completed, but that is irrelevent to this issue.

    >
    >
    > And you want to display the cart contents on the second instance of the
    > shopping site.


    Correct.

    >
    >
    > If I've got that much right - I think you'll need to post whatever data
    > you need back to the shopping site. There isn't a good method of
    > passing data between sites using only client side code. And I don't
    > see how an applet is going to help either.


    Since their sites are going to plain html code in the document directory,
    instead of cgi code, it is not possible to post back to it.

    >
    >
    > On the cart site, can you store the data in some hidden fields, do
    > whatever processing you do, then post the data back to the shopping
    > site?


    Yes, the shopping cart side is fully functional. The problem is that some
    of my clients want to have a small cart contents box show on their main
    site after an item has been put into their cart, and I cannot figure out a
    way to get the cart information to display on a static html page on their
    site. The shopping cart site can be easily made to send whatever data, or
    page it needs to, it is strictly the customer's main site that I have no
    clue as to how to do it, or even if it can be done.

    Thanks,

    Marshall
    Marshall Dudley, Feb 9, 2005
    #5
  6. Marshall Dudley

    Anton Spaans Guest

    "Marshall Dudley" <> wrote in message
    news:...
    > wrote:
    >
    >
    > Yes, the shopping cart side is fully functional. The problem is that some
    > of my clients want to have a small cart contents box show on their main
    > site after an item has been put into their cart, and I cannot figure out a
    > way to get the cart information to display on a static html page on their
    > site. The shopping cart site can be easily made to send whatever data, or
    > page it needs to, it is strictly the customer's main site that I have no
    > clue as to how to do it, or even if it can be done.
    >
    > Thanks,
    >
    > Marshall
    >


    Make use of an <iframe>. Add an <IFRAME> element to the static page (page on
    customer's main site). Set the iframe's source (src attribute) to a page of
    your shopping-cart application. This page will just show a miminal
    shopping-cart. Then you can still use cookies, etc, because the <iframe> is
    within your domain, cookies are sent and received ok. Make sure, however,
    that the users of the customer's main site are allowed to have embedded
    documents (<iframe> elements) that cross domains (security settings of
    browser).

    Good luck
    -- Anton.
    Anton Spaans, Feb 10, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rein Petersen
    Replies:
    1
    Views:
    389
    Matt Anderson
    Jul 6, 2003
  2. Replies:
    0
    Views:
    540
  3. Chuck
    Replies:
    1
    Views:
    113
    Anthony Jones
    Feb 15, 2007
  4. Replies:
    7
    Views:
    174
    Peter J. Holzer
    Dec 15, 2007
  5. Marshall Dudley

    Not sure what to use for this

    Marshall Dudley, Feb 9, 2005, in forum: Javascript
    Replies:
    4
    Views:
    61
    Anton Spaans
    Feb 10, 2005
Loading...

Share This Page