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
  #151  
Old 12-07-2012, 03:55 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,
I have added this in my static page but in pop it throws the error please have alook

__________________
X-cart Platinum
4.6.1
Reboot template
Reply With Quote
  #152  
Old 12-07-2012, 06:38 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...

It looks like your version does not include the sign-in popup. I guess it was a later version that included this, like 4.4.4

Hmmm, well then you are going to need to do the same as the register page. Include a special variable in the URL, and direct them back to the special page after login.

Where does the login page take you now? I suspect it is either the home page, or if you have items in your cart, the cart page.

Take a look at the code that performs this function, and include a catch for your special variable. Just like we did for registration.
__________________
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
  #153  
Old 12-08-2012, 12:00 AM
 
xtech xtech is offline
 

X-Adept
  
Join Date: Jun 2010
Posts: 605
 

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

Quote:
Originally Posted by totaltec

Where does the login page take you now? I suspect it is either the home page, or if you have items in your cart, the cart page.

Take a look at the code that performs this function, and include a catch for your special variable. Just like we did for registration.

Hi Mike,
My version is 4.4.2 Pro.is this a bug? Yes u r right Where does the login page take you now? I suspect it is either the home page, or if you have items in your cart, the cart page.

I want when a customer is in a static page then when he or she login then he will redirected to the next page but remaining functionality of going into cart if some products in cart and redirected to home page functionality remains the same.

Please provide me the codes.

Thanks..
__________________
X-cart Platinum
4.6.1
Reboot template
Reply With Quote
  #154  
Old 12-11-2012, 02:08 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,
Can you please look into this matter?
__________________
X-cart Platinum
4.6.1
Reboot template
Reply With Quote
  #155  
Old 12-11-2012, 07:28 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,
Can you please look into this matter?
I am helping you, but I am also trying to get you to understand. I am willing to help for free, but not simply provide the code. This is not paid support.

I am trying to guide you, so that you can make modifications like this without help. Remember how we solved this last time? We are going to do the same!

Open up your /include/login.php Take a look at the file and actually read it, Open it up in a real code editor like Notepad++. Very near to the top of the file, we see:
Code:
if ($REQUEST_METHOD == 'POST') {
This starts the actions that are supposed to happen when a user "Posts" the form submitting their credentials. Next see (near line 84 in my file)
Code:
if ($mode == 'login') {
This IF statement is the main meat of this file. You can see its closing bracket, down around line 440 (in my file). First you see some error checking being performed, next you see the Image verification for Captcha.

Then it checks to see if their if the user exists and if the account is active or suspended (lines 117, 134). From line 141 down to about 229, you can see it performing functions for admin users, suspending accounts that are inactive, forcing password changes, and checking for admin IP restrictions.

Line 231 checks the password, but near line 243 we see this:
Code:
if ($allow_login) {
Now we are getting close! See the next statement near line 259:
Code:
if ($login_type == 'C') {

Near line 264 we see the note // Redirect to saved URL
After that you can see it checking for cart contents and remembered data, and finally near line 286:
Code:
$redirect_url = $remember_data['URL'];

If you use CTRL F to search in the file for this variable "$redirect_url", you will see it mentioned in several places. There are several points along this chain that you can use our code from before:
Code:
if ($custom == 'yes') { $script = 'pages.php?pageid=7'; }else{ $script = 'address_book.php'; }
But it will have to be changed. Consider this code:
Code:
if ($custom == 'yes') { $redirect_url = 'pages.php?pageid=7'; }
You can see several examples of this type of logic being applied throughout the existing code. Now we know what code we want to insert, we just have to find the right place to put it.You should be wondering, where is this information from this variable used, so I can cut it off and have my code take priority?

Look down through the document. See:
Code:
func_header_location($redirect_url);
Suspicious right? What happens if you place the code directly above this statement? (I haven't tried it)

Now don't forget to include the ?custom=yes at the end of your link.
__________________
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
  #156  
Old 02-21-2013, 09:31 PM
 
anandat anandat is offline
 

X-Adept
  
Join Date: Jan 2004
Posts: 914
 

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

hello I want {if} {else} statement for following customization.

In the customer invoice just after product name I want to display manufacturer name: {product Name} by {manufacturer}

Also in above if product has got thumbnail then I want to display simple "." (DOT) after {manufacturer}, (This is just for internal purpose so that I can see which products doesn't have images)

So following will be logic for products with manufacturer & thumbnail
Code:
{product Name} by {manufacturer} {.}

And following will be logic for products with manufacturer WITHOUT thumbnail
Code:
{product Name} by {manufacturer}

I guess it should be real simple to achieve with proper variable & if/else statement.

Note: I am looking this for 4.5.4...can one help me on this ?
__________________
X-Cart: 4.7.7 LIVE
Skin:Ultra by xcartmods.co.uk
X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9)
---------------
Server: Linux
php: 5.3
mysql: 5.0.89
----------------
Reply With Quote
  #157  
Old 02-25-2013, 10:37 PM
 
suseela suseela is offline
 

Advanced Member
  
Join Date: Jan 2013
Posts: 55
 

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

How can i remove the Goodies tab from the providers area
__________________
www.indiancarnival.com

based on Xcart pro 4.5
Reply With Quote
  #158  
Old 09-11-2013, 05:30 PM
 
joannet joannet is offline
 

Senior Member
  
Join Date: Mar 2006
Posts: 105
 

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

I would like to add an if/then statement so that when there is text in a language variable it is displayed. If there is no text in the language variable, then the the language variable does not display. Is this possible?

Thanks in advance!
__________________
/joannet/
X-Cart version 4.1.9 and above
Reply With Quote
  #159  
Old 09-11-2013, 06:59 PM
  while.e.kyote's Avatar 
while.e.kyote while.e.kyote is offline
 

Senior Member
  
Join Date: Mar 2013
Posts: 136
 

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

if (lng.variable != '')
__________________
X-Cat 4.5.4 & (1/2)
Live June 1, 2013.
Reply With Quote
  #160  
Old 09-11-2013, 09:12 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,189
 

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

Quote:
Originally Posted by while.e.kyote
if (lng.variable != '')

missing the $ and this code looks more of a php than smarty so it won't work in templates

{if $lng.your_variable_name ne ''}{$lng.your_variable_name}{/if}
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following 2 users thank cflsystems for this useful post:
joannet (09-11-2013), tartaglia (09-12-2013)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:35 PM.

   

 
X-Cart forums © 2001-2020