Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

common if/then modifications I make to x-cart...

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #141  
Old 11-12-2012, 02:14 AM
 
xtech xtech is offline
 

X-Adept
  
Join Date: Jun 2010
Posts: 605
 

Default Re: common if/then modifications I make to x-cart...

Hi,
I have created a static page whose content is to display by login or register.When a customer fist time register then it directly goes into address book page I want to display the static page content after initial registration.That means after initially registration(not entering address book data) it redirects to that static page remaining functions remains the same.

How to achieve that?
__________________
X-cart Platinum
4.6.1
Reboot template
Reply With Quote
  #142  
Old 11-12-2012, 03:09 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: common if/then modifications I make to x-cart...

Look near line 1274 of include/register.php
Code:
// Redirect just registered customer if ($isAutoLogin) { $script = 'address_book.php'; } else { $script = 'home.php'; }
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #143  
Old 11-12-2012, 03:17 AM
 
xtech xtech is offline
 

X-Adept
  
Join Date: Jun 2010
Posts: 605
 

Default Re: common if/then modifications I make to x-cart...

Hi Mike,
Is this for particular static page or after registration only? Actually I want when a customer comes to that static page ,register then after registration it will redirected to that static page.The other functionality after registration remains as before.
__________________
X-cart Platinum
4.6.1
Reboot template
Reply With Quote
  #144  
Old 11-12-2012, 03:51 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: common if/then modifications I make to x-cart...

Quote:
Originally Posted by xtech
Hi Mike,
Is this for particular static page or after registration only?
I just pointed you to the code that redirects the user after signup. Forgot to say that it is /include/register.php

If you want to got to a different page, just put your page there in place of address_book.php. Haven't tested this yet.

If you need to assign a custom variable from the previous page, just pass it in the URL: register.php?custom=yes

Untested example:
Code:
// Redirect just registered customer if ($isAutoLogin) { if ($custom == 'yes'){ $script = 'pages.php?pageid=2' }else { $script = 'address_book.php'; } } else { $script = 'home.php'; }
This probably won't work but you can give it a shot.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #145  
Old 11-12-2012, 03:59 AM
 
xtech xtech is offline
 

X-Adept
  
Join Date: Jun 2010
Posts: 605
 

Default Re: common if/then modifications I make to x-cart...

Hi Mike,
My static page is https://www.health-shoppe.com/HelpAge.html but in order to view the static page content I have to register I want after inital registration it will again redirects to https://www.health-shoppe.com/HelpAge.html instead of address book if there is no product in the cart added.

This is applicable for this page only the other functionality that is after adding products to cart and registration process like before remains the same.

This will be applicable for this page only.How to achieve it?

Please help..
__________________
X-cart Platinum
4.6.1
Reboot template
Reply With Quote
  #146  
Old 11-12-2012, 05:36 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: common if/then modifications I make to x-cart...

Have you tried my suggestion above?

I'll explain it again.

Create a static page containing:
Code:
{if $login eq ''} Yes you have to register. Go here: <a href="register.php?custom=yes">Register</a> {else} You are registered and logged in! Congratulations! {/if}
Make sure you have "parse smarty tags" enabled. Take note of the pageid of the custom page.

Now look in include/register.php
Find this line:
Code:
$script = 'address_book.php';
Change it to:
Code:
if ($custom == 'yes') { $script = 'pages.php?pageid=7'; }else{ $script = 'address_book.php'; }
Change the pageid to your custom page's id.

Works on my test site here: http://trainingpen.com/Special.html
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #147  
Old 12-05-2012, 12:13 AM
 
xtech xtech is offline
 

X-Adept
  
Join Date: Jun 2010
Posts: 605
 

Default Re: common if/then modifications I make to x-cart...

Hi Mike,
You are the man... Thanks a lot...One things need to add I want to add login page also in static page and after login (if customer stays on that static page) the customer remains in that page not in home page or in cart page.

This will be applicable means that can be applicable for static page only that is after login stays on that static page.Remaining functions remains the same.

How to achieve that?
__________________
X-cart Platinum
4.6.1
Reboot template
Reply With Quote

The following user thanks xtech for this useful post:
totaltec (12-05-2012)
  #148  
Old 12-05-2012, 10:09 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: common if/then modifications I make to x-cart...

Thanks for the kudos.

If we need to pass special variables to login.php, we would need to do it in the same way by adding ?custom=yes or something like that.

I am not sure if this will work in your version, but it does in mine. I updated my test page linked above.
Code:
{if $login eq ''} If you have an account Please <a href="http://trainingpen.com/login.php" title="Sign in" onclick="javascript: return !popupOpen('login.php');">Sign in</a>! Or you have to register. Go here: <a href="register.php?custom=yes">Register</a> {else} You are registered and logged in! Congratulations! {/if}
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #149  
Old 12-05-2012, 11:31 PM
 
xtech xtech is offline
 

X-Adept
  
Join Date: Jun 2010
Posts: 605
 

Default Re: common if/then modifications I make to x-cart...

Hi Mike,
Thanks for your reply.But nothing to change in login.php like register.php?Because when a customer remains in static page when they click login.php if he is on that static page then after login that customer goes to post page not in home page.

How to do that?
__________________
X-cart Platinum
4.6.1
Reboot template
Reply With Quote
  #150  
Old 12-05-2012, 11:38 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: common if/then modifications I make to x-cart...

Are you using the popup sign in link like I demonstrated above?
http://trainingpen.com/Special.html - it works fine on my test site.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:53 PM.

   

 
X-Cart forums © 2001-2020