zee28 Posted September 17, 2013 Share Posted September 17, 2013 Hi guys here is some code that i need to make products with multiple values hide pricing when logged out. Currently it hides all prices but not products with values when logged out. <span id="our_price_display">{if $logged}{if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="on_sale">{l s='On sale!'}</span>{elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="discount">{l s='Reduced price!'}</span>{/if}{if isset($product.online_only) && $product.online_only}<span class="online_only">{l s='Online only!'}</span>{/if}{if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}<div>{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc} <span style="color:#222222;"><span style="font-size: 12px;"><strong>Excl. VAT</strong></span></span></p>{/if}</span><br />{/if}{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}<span class="availability">{if ($product.allow_oosp || $product.quantity > 0)}{l s='Available'}{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}</span>{/if}</div>{/if}{if $product.recommended_retail_price != 0}<div><span class="old_price" style="display: inline;"><span class="bold">{l s='RRP:'} {convertPrice price=$product.recommended_retail_price}</span></span></div>{/if}{else}<p class="logout"><span style="font-size:16px;"><strong>Login For Pricing</strong></p>{/if}</span> Zee... Link to comment Share on other sites More sharing options...
vekia Posted September 17, 2013 Share Posted September 17, 2013 any chance to test how it works in your website? where you've got this code? in what .tpl file? Link to comment Share on other sites More sharing options...
zee28 Posted September 17, 2013 Author Share Posted September 17, 2013 WWW.3ADL.COM i got the code from product.tpl Link to comment Share on other sites More sharing options...
Jiten rash (away) Posted September 17, 2013 Share Posted September 17, 2013 <span id="our_price_display">{convertPrice price=$productPrice}</span> replace with this ok i made short code {if $logged}{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}{/if}{else}<p class="logged_out">login for prices</p>{/if} Link to comment Share on other sites More sharing options...
zee28 Posted September 17, 2013 Author Share Posted September 17, 2013 hey jiten still doesnt work Link to comment Share on other sites More sharing options...
zee28 Posted September 17, 2013 Author Share Posted September 17, 2013 http://www.3adl.com/home/9-mini-usb-speakers.html Link to comment Share on other sites More sharing options...
Jiten rash (away) Posted September 17, 2013 Share Posted September 17, 2013 now we redirect people to login page who wanna add products to cart or invisible or disable If the “Add to Cart”, we want if the user is not logged in, we redirect to the login page. <span style="color: #008000;">{if $logged}</span><a class="exclusive button ajax_add_to_cart_button" style="color: #000000;"> href="{$link->getPageLink('cart.php')}?qty=1&id_product={$accessory.id_product|intval}&token={$static_token}&add" rel="ajax_id_product_{$accessory.id_product|intval}" title="{l s='Add to cart'}">{l s='Add to cart'}</a><span style="color: #008000;">{else}</span><span style="color: #008000; cursor:not-allowed;"><a class="exclusive button" title="{l s='please login to add to cart'}" href="{$link->getPageLink('authentication.php')}">{l s='Add to cart'}</a></span><span style="color: #008000;">{/if}</span> Link to comment Share on other sites More sharing options...
Jiten rash (away) Posted September 17, 2013 Share Posted September 17, 2013 i was looking for other solution by logging is throwing error>check seo and url my-account Link to comment Share on other sites More sharing options...
El Patron Posted September 17, 2013 Share Posted September 17, 2013 Mr. Rash, I posted a one line hack in one of your topics on hiding prices... Would this not work for the OP? If so it may be easier for you to find as it was your topic and you could post it here. Thanks Link to comment Share on other sites More sharing options...
Jiten rash (away) Posted September 17, 2013 Share Posted September 17, 2013 every thing is working fine just need to hide prices of products which hv attributes Link to comment Share on other sites More sharing options...
zee28 Posted September 17, 2013 Author Share Posted September 17, 2013 the prices can still be seen for products with variables Link to comment Share on other sites More sharing options...
El Patron Posted September 17, 2013 Share Posted September 17, 2013 Mr. Rash, I posted a one line hack in one of your topics on hiding prices... Would this not work for the OP? If so it may be easier for you to find as it was your topic and you could post it here. Thanks Here is the post, for 1.5 http://www.prestashop.com/forums/topic/271324-solution-display-price-only-to-login-user/?do=findComment&comment=1358708 Then there is no change to 'any' templates/modules/etc... Link to comment Share on other sites More sharing options...
zee28 Posted September 17, 2013 Author Share Posted September 17, 2013 jiten where shall i place the basket code? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now