X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   common if/then modifications I make to x-cart... (https://forum.x-cart.com/showthread.php?t=8881)

xtech 11-12-2012 02:14 AM

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?

totaltec 11-12-2012 03:09 AM

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';
        }


xtech 11-12-2012 03:17 AM

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.

totaltec 11-12-2012 03:51 AM

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. :-)

xtech 11-12-2012 03:59 AM

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..

totaltec 11-12-2012 05:36 AM

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

xtech 12-05-2012 12:13 AM

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?

totaltec 12-05-2012 10:09 AM

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}


xtech 12-05-2012 11:31 PM

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?

totaltec 12-05-2012 11:38 PM

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.


All times are GMT -8. The time now is 04:41 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.