X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   View Only - Until logged in (https://forum.x-cart.com/showthread.php?t=30181)

stuartn 04-02-2007 01:40 PM

View Only - Until logged in
 
I bet thas been covered but I can't seem to find a thread for it.

What I want to achieve is that people can view and see the pricing, but cannot buy until they log in.

Has someone got a link for a thread that achieves this ?

Thanks in advance for your help.

balinor 04-02-2007 01:57 PM

Re: View Only - Until logged in
 
Hi Stuart, can you please update your signature with your X-Cart version? Each version is completely different and the answers you receive depend on the version you have. Thanks!

stuartn 04-02-2007 05:11 PM

Re: View Only - Until logged in
 
done it thanks

balinor 04-02-2007 06:27 PM

Re: View Only - Until logged in
 
Ok, just surround the buy now and add to cart buttons with an {if} statement like this:

{if login ne ""}

code for button

{/if}

stuartn 04-03-2007 03:31 AM

Re: View Only - Until logged in
 
Thanks do you know which templates this relates to....

off the top of my head as I'm at work.

Products Detailed & Buy Now

balinor 04-03-2007 03:52 AM

Re: View Only - Until logged in
 
All the info you need is right here:

http://forum.x-cart.com/showthread.php?t=21529

stuartn 04-03-2007 02:19 PM

Re: View Only - Until logged in
 
Had a look at your thread which makes sense....altered

customer/main/product.tpl - I have made some minor changes to the templates in the past in terms of positioning and coding I can cope with at a minor level at the beginning and then I seem to pick it up quick.

So I opened the template with Notepad ++ and found the code for Add to Cart and pasted you code top and bottom.

{if login ne ""}
<form name="orderform" method="post" action="cart.php?mode=add" onsubmit="javascript: return FormValidation();">
{/if}

Still the add to cart is showing..Its looks okay to me but maybe I'm missing something here.

balinor 04-03-2007 02:28 PM

Re: View Only - Until logged in
 
You need to surround the button, you surrounded the form line only. The button on product.tpl is this:

{include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"}

stuartn 04-03-2007 03:27 PM

Re: View Only - Until logged in
 
Did it...

<td>
{if login ne ""}{include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"}{/if}</td>

But still not working.

balinor 04-03-2007 03:52 PM

Re: View Only - Until logged in
 
May need to clear your template cache to see the changes.


All times are GMT -8. The time now is 07:07 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.