Jump to content

help please


zee28
 Share

Recommended Posts

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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>

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More