| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
common if/then modifications I make to x-cart... | ||||
|
|
Thread Tools | Search this Thread |
#51
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
Hi,
Great stuff here! I'm a newbie with xcart and smarty and am having some problems hiding the pricing and buying abilty from all but one membership group. I have a category with 42 subcategories with 12 products in each that are only for sale to Wholesale members. However, the client wants all visitors to see these products and only make them available for sale to wholesale members. So, he wants to hide the prices from regular visitors. I was reall encouraged by this post and am trying to use if/then logic based on one of the examples above to accomplish this. Seems to me that the products _t.tpl and the products.tpl need to be modified? Here's what I tried in the products_t.tpl: {if $user_membership eq "Wholesale"} <font class="ProductPrice">{$lng.lbl_our_price}: {include file="currency.tpl" value=$products[product].taxed_price}</font><br /><font class="MarketPrice">{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$products[product].taxed_price}</font>{if $discount gt 0}{if $config.General.alter_currency_symbol ne ""},{/if} {$lng.lbl_save_price} {$discount}%{/if} {if $products[product].taxes}<br />{include file="customer/main/taxed_price.tpl" taxes=$products[product].taxes}{/if} {if $active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""} {include file="modules/Special_Offers/customer/product_special_price.tpl" product=$products[product]} {/if} {else} <font class="ProductPrice">{$lng.lbl_enter_your_price}</font> {/if} {/if} {else} Wholesale Only {/if} I was trying to get the price to show up only if the user is logged in as a Wholesale member, and if not, to show "Wholesale Only". But this just causes the page to display code where images should be and blows the page formatting apart. The solution can't be far from this and I'm continueing to hack away. Any help is greatly appreciated. Thanks in advance, Tony
__________________
Tony Galfano LC 2.2.21 XCart Gold 4.18 w/Fashoin Mosaic Skin XCart Gold 4.18 |
|||||||
#52
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#53
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
Hi,
Wow, thanks for the quick response! I tried that and couldn't get it to work either, though it did fix the page destruction issues. But what happens is that the prices don't show up for anyone in all of the categories. I just want to have the products in the one category to have prices show up for only wholesale members. I still hacking away and am trying variations of the if/then statements and the placement of them in the code to see if I can get this to work. Thanks for you help and if you can think of anything else fire away! Thanks, Tony
__________________
Tony Galfano LC 2.2.21 XCart Gold 4.18 w/Fashoin Mosaic Skin XCart Gold 4.18 |
|||||||
#54
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
Hi All,
Thanks for the great help. I've got this one licked now. I used a combination of balinar's code and on of the examples earlier on in this thread. My mistake was that I was not addressing the subcategory, but the root category. The code on the product.tpl only relates to the subcaetgory if the product is not in a root category. Once I fixed it your code worked like a charm! Thanks, Tony
__________________
Tony Galfano LC 2.2.21 XCart Gold 4.18 w/Fashoin Mosaic Skin XCart Gold 4.18 |
|||||||
#55
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
Thanks everyone, this thread has saved me countless hours! However, I am having a small cosmetic problem...I setup a long list of "if statements" so that each category would show a specific flash banner. This works well, however, since it is several lines of code, the first IFSTATEMENT goes into effect it is fine because it is the first line. BUT if lets say the last piece of code goes into effect there is a big space above it where the other inactive coding was. Its best to look at the pictures: Here are some attached examples.
EXAMPLE: Code:
I've tried adding the code to a sepearte TPL file but that woudlnt parse correctly. There must be an easy not to have the inactive code take up space....heres a brain buster for you experts but im sure this has been asked before....although i coudl not find anyting about this on this forum. Thanks in ADVANCE!
__________________
xcart 4.5.2 |
|||||||
#56
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
nevermind it wasnt parsing correctly because of a typo...
the spaces can be seen in FIREFOX but dont exist in IE...any ideas?
__________________
xcart 4.5.2 |
|||||||
#57
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
smek - could you elaborate a bit more on how this works, or perhaps show some example code? This is what I am wanting to do as well. I tried it as a test on my site with what you had shown, didn't work.
Edit - get it. I had the wrong cat id# Cool.
__________________
v 4.1.8 |
|||||||
#58
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
i put all the if statements into a sepearate TPL file and call it from the home.tpl file....
but it still shows a space in firefox where the "unused code" is..perfect in IE though.
__________________
xcart 4.5.2 |
|||||||
#59
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
I wanted to show something ONLY in the product.tpl pages and this code worked:
{if $product.productid ne "" }hello{/if}
__________________
4.1.8 Gold (Unix) |
|||||||
#60
|
|||||||
|
|||||||
Re: common if/then modifications I make to x-cart...
Hi,
I want to add an extra line at the checkout summary page depending upon the value of a field called 'prodlocation' The code I've insterted is: Quote:
But the message isn't displayed. If I enter: {if $products[prod_num].prodlocation eq ""} show this {/if} The message is shown which is strange as the value of prodlocation is Dave. Any ideas? |
|||||||
|
|||
X-Cart forums © 2001-2020
|