![]() |
Re: common if/then modifications I make to x-cart...
X-Cart 4.4.x currently, but probably all previous versions are compatible also - I can't remember. Let me know if any problems...
Better Search Box: If you want a custom search box on your X-Cart store that has an initial value of 'Search for products..." displayed, that when clicked turns blank so the user can type their search term without having to remove the text by hand & then when the search results are displayed, retains the term they just entered until they click back inside the box again, do this: in customer/search.tpl find the following code (around line 20): Code:
<input type="text" name="posted_data[substring]" class="text" value="{$search_prefilled.substring|escape}" /> and replace it with this: Code:
Just done this for the nth time and thought it might help, in case anyone missed it. |
Re: common if/then modifications I make to x-cart...
Trying to show an image on product.tpl only if wholesale prices are available for that product.
Is there an if statement that covers something like that? Thanks in advance. |
Re: common if/then modifications I make to x-cart...
Code:
{if $product_wholesale ne ""}...your image here...{/if} that should do it. Quote:
|
Re: common if/then modifications I make to x-cart...
Thanks ... works great!!
|
Re: common if/then modifications I make to x-cart...
I'm looking for and if/then statement that would either clear out the email field if it equals dummyemail@email.com (thus requiring the customer to fill it in) or require the email field to be changed upon initial login if membership id = 8.
What I'm looking to accomplish is to import a large list of customers when I do not have their email addresses. I've come to the conclussion that I'll have to do this with a dummy email instead. However, I need to require the customer to change this so that they will properly receive notifications rather than the dummy email receiving them. Any help on this would be greatly appreciated!! |
Re: common if/then modifications I make to x-cart...
This may already have come up in this thread but I can't find it. I'm using 4.4.x and I don't seem to have a $user_membership variable. I want to use an if/then like the one above to show one thing on a static page if the user is a wholesale customer and something else if the user is not.
|
Re: common if/then modifications I make to x-cart...
I want if else statement for static page.
For example if visitor click on static page link. The following javascript should be load Code:
<head> In short what if/else condition I should put between <head> </head> so that above javascript function load if person open static page id=1 ? |
Re: common if/then modifications I make to x-cart...
Code:
{if $smarty.get.pageid eq "1"} |
Register as customer and provider on front end of site
What is needed to allow anybody to register as a customer and a provider. I'm thinking I need an {if statement to accomplish this, but I'm not quite sure what is needed. I'm hoping someone can point me in the right direction or tell me what needs to be done. I don't want the admin in control of creating provider accounts, but I would like to approve the providers as they sign up. Any help would be much appreciated.
|
Re: common if/then modifications I make to x-cart...
Quote:
This should be close to what you need. I was having the same problem on my v4.3.1, and here is the solution: 1. In the file \include\check_useraccount.php find the following: Code:
$mail_smarty->assign("usertype",$current_area); ... and paste underneath: Code:
$smarty->assign("user_membership",$user_account["membership"]); This allows you to call {$user_membership} or {$user_membershipid} in the Smarty template to generate the name and ID number. Note: You can create other variables by using the $user_account database request on line 155. Hope this helps! Darren |
Load Script and Images on ONE Page
Hello I need to load scripts and images only if user on one page and I can not specify page Id because it custom made module and all categories shown there as:
custom.php?cat=7000 or custom.php?cat=3450 and so on Load script only on all of the module.php page with cat ID from 1 to 10000. or simply custom.php page thank you. |
Re: common if/then modifications I make to x-cart...
Hello did you figure this out.
I try to do the same but with more scripts and css. Also how to define page in if/else if it custom.php for example. thank you Quote:
|
Re: common if/then modifications I make to x-cart...
Hi I customized the Fulfilment account to be able to add products, works great, now my client wants to hide some options from the add/edit product page, I would like the help of you guys to let me know an If/then statment to hide the options to the fulfilment staff. I have almost 3 days working on it and I cann't find the varieble to do this.
Thanks |
Re: common if/then modifications I make to x-cart...
Hi OBO1,
I haven't tried this bu I know that include/security.php assigns the user account flag to smarty: $smarty->assign('current_membership_flag', $user_account['flag']); and fulfillment staff's flag is FS I believe. So maybe: {if $current_membership_flag ne "FS"} Show this stuff to regular admins. {elseif $current_membership_flag eq "FS"} Show this stuff only to Fulfillment Staff. {/if} |
Re: common if/then modifications I make to x-cart...
Quote:
Thank you Totaltec!! works Great!. :D |
Re: common if/then modifications I make to x-cart...
Quote:
Better to use this code in case they are using CDSEO or clean urls which won't have the pageid in the url: Code:
{if $page_data.pageid eq 'X'} |
Re: common if/then modifications I make to x-cart...
Hi, could anyone please point me in the right direction, I'm trying to hide the add to cart, update, price and amount for products in just one category in the wishlist using if/else statement. I think I should be editing wl_products.tpl, would anyone know if this is correct.
Thank you, Pauline. |
Re: common if/then modifications I make to x-cart...
Pauline, use webmaster mode to determine what template to edit. Follow the tutorial link in my signature if you don't know what I mean.
|
Re: common if/then modifications I make to x-cart...
Will Do,
thanks Mike. |
Re: common if/then modifications I make to x-cart...
I added a list of some common statements I use in a tutorial at: X-Cart Common Smarty Statements.
|
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? |
Re: common if/then modifications I make to x-cart...
Look near line 1274 of include/register.php
Code:
// Redirect just registered customer |
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. |
Re: common if/then modifications I make to x-cart...
Quote:
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 |
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.. |
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 ''} Now look in include/register.php Find this line: Code:
$script = 'address_book.php'; Code:
if ($custom == 'yes') { Works on my test site here: http://trainingpen.com/Special.html |
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? |
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 ''} |
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? |
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. |
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 |
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. |
Re: common if/then modifications I make to x-cart...
Quote:
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.. |
Re: common if/then modifications I make to x-cart...
Hi Mike,
Can you please look into this matter? |
Re: common if/then modifications I make to x-cart...
Quote:
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') { Code:
if ($mode == 'login') { 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) { 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') { Code:
if ($custom == 'yes') { Look down through the document. See: Code:
func_header_location($redirect_url); Now don't forget to include the ?custom=yes at the end of your link. |
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 :-) ? |
Re: common if/then modifications I make to x-cart...
How can i remove the Goodies tab from the providers area
|
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! |
Re: common if/then modifications I make to x-cart...
if (lng.variable != '')
|
Re: common if/then modifications I make to x-cart...
Quote:
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} |
All times are GMT -8. The time now is 07:03 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.