Page 1 of 3 123 LastLast
Results 1 to 10 of 30
  1. #1
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default set_snapshot - can I use it for scripts outside of index.php?

    I have been trying to figure it out myself, but I can't

    $_SESSION['navigation']->set_snapshot();

    If I just set that, it seems to strip out the base page, I don't want it to strip the base page, please help.

    So if page was...

    website.com/module_here.php?variable=3333

    it snapshots

    website.com/?variable=3333

    I want the snapshot to redirect back to the previous page and not strip any information out.
    Last edited by DigitalShadow; 5 Aug 2015 at 03:12 PM.

  2. #2
    Join Date
    Jul 2012
    Posts
    16,735
    Plugin Contributions
    17

    Default Re: set_snapshot

    Quote Originally Posted by DigitalShadow View Post
    I have been trying to figure it out myself, but I can't

    $_SESSION['navigation']->set_snapshot();

    If I just set that, it seems to strip out the base page, I don't want it to strip the base page, please help.

    So if page was...

    website.com/module_here.php?variable=3333

    it snapshots

    website.com/?variable=3333

    I want the snapshot to redirect back to the previous page and not strip any information out.
    In your call to set_snapshot() if the page you are on does not include main_page= and it is not index.php, then need to provide the array information associated with the page that you are on...

    These are the fields "reviewed":
    Code:
     
    'page' => $page['page'],
    'mode' => $page['mode'],
    'get' => $page['get'],
    'post' => $page['post']);
    Take a look at how it is done in: includes/modules/pages/checkout_payment_address/header_php.php around line 27.

    The array method allows storing the get data as well as any post data that is considered necessary to return to the same "page"...

    The function exists in includes/classes/navigation_history.php
    Last edited by mc12345678; 5 Aug 2015 at 05:09 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: set_snapshot

    I tried that, it didn't work...

    $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_ORDER_QUESTION));

    redirects to

    /index.php?main_page=order_question.php

    when it should redirect to

    /order_question.php?order_id=#######

  4. #4
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: set_snapshot

    $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => $_SERVER['REQUEST_URI']));

    That correctly now passes the page, but I need to remove "/index.php?main_page="

    /index.php?main_page=/order_question.php?order_id=######

  5. #5
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: set_snapshot

    Do I need to set path as well?

  6. #6
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: set_snapshot

    but I need to remove "/index.php?main_page="
    Why/what purpose do you have for needing to remove this??
    Zen-Venom Get Bitten

  7. #7
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: set_snapshot

    Due to the way the module is designed. The url doesn't include index...etc

  8. #8
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: set_snapshot

    Is it not possible to redirect without /index.php?main_page= ?

  9. #9
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: set_snapshot

    Due to the way the module is designed
    What module??

    Maybe you should answer/provide the information in posting tips available when you post
    Zen-Venom Get Bitten

  10. #10
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: set_snapshot

    Sorry I thought using the snapshot call was a core zen file and wouldn't require me to include further information.

    The plugin is outdated however, I wouldn't say it is broken. It is old and it may not follow the current correct practices regarding zen integration, so I didn't want to drag the module into the equation. Order Questions

    I hoped it would be possible to set a snapshot to enable a customer to login and then return back to this form to comment on their order. Is it not possible to set a snapshot that doesn't include /index.php?main_page=
    Last edited by DigitalShadow; 6 Aug 2015 at 02:49 PM.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. what is set_snapshot function use for ?
    By linjuming in forum General Questions
    Replies: 2
    Last Post: 29 Oct 2012, 02:05 AM
  2. Want to use index.php as a splash page...how?
    By laurenjj in forum Basic Configuration
    Replies: 8
    Last Post: 7 Sep 2011, 06:01 AM
  3. where can i find this link "/index.php?main_page=index&cPath=1"?
    By hangman21 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 19 Jul 2010, 04:15 AM
  4. Session info not updating for scripts outside of ZC folder after upgrade to 1.39
    By steel-track in forum Upgrading from 1.3.x to 1.3.9
    Replies: 3
    Last Post: 15 May 2010, 06:34 AM

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