View Single Post
  #2  
Old 11-09-2004, 12:29 PM
  minorgod's Avatar 
minorgod minorgod is offline
 

X-Adept
  
Join Date: Sep 2002
Location: Arivaca, AZ
Posts: 402
 

Default I've found a better way to do this...I think.

Disregard my previous method. It causes problems if you have hardcoded links that add products directly to your cart without going through the storefront. I have set up a different method that requires no modification to the skinswap mod itself. Instead modify your /customer/auth.php file by adding the following lines somewhere...it doesn't really matter where...
Code:
//skin swap mod modification by brett //first we register an x-cart session variable to hold the skinswap status //then we see if the customer has submitted a variable that triggers the skin swapping x_session_register('do_skinswap'); if(!empty($_GET[$value_to_swap_with])){ if(!empty($skinswap) && !empty($default_skin) && $skinswap != $default_skin){ $do_skinswap="true"; } } //now that we've set the variable that determines if we should swap skins or not //we check to see if it is empty (meaning it contains no string at all) which would //indicate that it has not yet been set. If it hasn't been set, we set the variable equal //to the string "false", expire the existing skinswap cookie that causes the swapping, //then redirect to wherever the user was. This should kill the skin swapping when the //page reloads if(empty($do_skinswap)){ $do_skinswap="false"; setcookie ("skinswap", $default_skin, time()-31536000); header("Location: $_SERVER[PHP_SELF]?$_SERVER[QUERY_STRING]"); }

The purpose of this mod is to keep the customer from being locked into the same skin each time they return to your store under a different session. With my modification, the skin swapping will stop if a user closes their browser window and revisits your site without going through your specific skinswap URLs. Enjoy.
__________________
www.brettbrewer.com
Getting back into x-cart dev after a long hiatus. Modded lots of x-carts from version 3.1.x to 4.1.x. Developer of ImageScaler mod, Pre-login per user coupon mod, Wordpress feed mod, DigitalSubscriptions mod, Phonetic bulk download keys addon for DownloadExpander mod, Serial Number Generator for ESD products, Custom CMS/LMS integrations, external products mod, and more.
Reply With Quote