Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration
You are here: Home

wrich

  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • August 21, 2010 at 1:20 pm in reply to: Items staying in cart between stores #23552
    wrich
    Member

    example1.com

    example1.com/site2

    Just like that, we had a temporary solution by terminating the session if a user switched sites, so there no cart items will travel from site to site. We added this to our index.php

    $locationArray = explode('/', $_SERVER['REQUEST_URI']);
    $store_id = $locationArray[1];
    if ($store_id == 'favicon.ico') {
    $store_id = 'other';
    }

    if (!(isset($_COOKIE['store_id']))) {
    if ($store_id != 'other') {
    setcookie('store_id', $store_id, mktime(0,0,0,date("n")+1,date("j"),date("Y")), '/', $_SERVER['SERVER_NAME'], false, true);
    }
    } else {
    if (($_COOKIE['store_id'] != $store_id) && ($store_id != 'other')) {
    session_destroy();
    $params = session_get_cookie_params();
    setcookie('PHPSESSID', '', time()-42000, $params['path'], $params['domain'], $params['secure'], $params['httponly']);
    setcookie('cart_in_use', '', time()-3600);
    setcookie('store_id', $store_id, mktime(0,0,0,date("n")+1,date("j"),date("Y")), '/', $_SERVER['SERVER_NAME'], false, true);
    }
    }

    Any better ideas?

    Chase

  • Author
    Posts
Viewing 1 post (of 1 total)

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ