PrestaShop Forum

The best place in the world to ask questions about PrestaShop and get advice from our passionate community!

PrestaShop Forum

Jump to content

Whole sale shop with no add to cart or prices until login ! The Easy Way

83 replies to this topic
#1
geno

    PrestaShop Newbie

  • Members
  • Pip
  • 9 posts
Hi all, I have been using Prestashop for a while now, but as I am an ASP developer and Don’t know php too well I have not really had anything to contribute until now.

There has been many posts regarding not displaying prices and ordering options until after a user logs in. I have just done it for a client and it is remarkably simple. Thanks of course to the wisdom of Paul C & Ningu.

I have set a standard install of Presta shop with the mod up so you can view it for your self.

Http://www.devtechchina.com/store

user login = demo@demo.com
password = 12345678

You will see that where ever a price or add to cart button should be displayed, it displays "login for prices and ordering options" until a user logs in and then all is displayed normaly.

How I have done it is as follows, and truly it is so simple.

I have added some php code to 4 tpl files. (thanks to Paul C for his php guidence)

Themes
product_list.tpl
product.tpl

Modules
Block special .... blockspecial.tpl
homefeatured .... homefeatured.tpl

the code involved is again very simple, just enclose any price of cart display code with


{if $logged} normal code is here

{else}
Login for Prices & Ordering Options
{/if}




That’s all there is to it. I have added the edited 4 tpl files this post for download, they are from the standard prestashop theme. You could use these or just see where the code edits are.

So now no prices of Add to cart button will display until a user logs in.
(of course if you want to use certain other modules that do display the price you will need to add the code to those also.


Now this presents an other problem, what’s to stop a user just registering automatically and then logging in? Well the fantastic Ningu gave me the solution for this. His great Customer registration module.

see here for the module

http://www.prestasho...tion_management

After implementing Ningu’s module this is the basic flow of what happens.

1: A user browses the store but can not see prices or ordering option.
2: User registers and prestashop emails them welcoming them and also that they CANNOT LOGIN until their account has been verified. Also store owner receives an email to let them know there is a new user waiting for verification.
3: Store owner verifies their account (or not) in the back office.
4: User receives a new email letting them know their account is now verified and they can login in.
5: They login and see prices and can order.

This setup is perfect for whole sale stores that do not want retail clients to see price etc.

I have done this mod on the latest release of Prestashop

I have tested this mod on the latest versions of

Firefox
Oprea
Safari for windows
IE 6 / 7

I do hope that this mod can help some prestashop users who want to set their shop as a wholesale store

Cheers

Geno

And great praise to the Presta team.

Attached Files



#2
Jack

    PrestaShop Apprentice

  • Members
  • PipPip
  • 239 posts
Welcome to the PS community. Thank you very much for the module. It works perfectly. Thanks.

#3
TropischBruin

    PrestaShop Fanatic

  • Moderators
  • 2198 posts
Great job!
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#4
TropischBruin

    PrestaShop Fanatic

  • Moderators
  • 2198 posts
Would it be easy to adapt this so you could only see the products after loggin in?
Norman in 't VeldtModeratorPrestaShopForums
Help PrestaShop, make a donation!

#5
geno

    PrestaShop Newbie

  • Members
  • Pip
  • 9 posts
that is an interesting idea, I can also see some benifits of doing it.

BUT I would image that you would have to change a lot more as just using my method to hide prices and ordering options still displays all the relevent blocks.

If you wanted to hide products also I feel as if the site would look very sparse and empty until after login. as really what would there be left to display. Not much.

but i do think its a good idea

Geno

#6
Me 8084

    PrestaShop Apprentice

  • Members
  • PipPip
  • 104 posts
thanks thats a great idea and very helpful

thanks for sharing :)
You cant choose to be smart but you choose to think

#7
guilliame

    PrestaShop Newbie

  • Members
  • Pip
  • 15 posts
Hello, i would like to use your option, i just dowload and replace the 4tpl files but it doesn't work.
Can you help me please? i 'm novice and using standard install of Presta 1.1.





From 1233970401:

Hi all, I have been using Prestashop for a while now, but as I am an ASP developer and Don’t know php too well I have not really had anything to contribute until now.

There has been many posts regarding not displaying prices and ordering options until after a user logs in. I have just done it for a client and it is remarkably simple. Thanks of course to the wisdom of Paul C & Ningu.

I have set a standard install of Presta shop with the mod up so you can view it for your self.

Http://www.devtechchina.com/store

user login = demo@demo.com
password = 12345678

You will see that where ever a price or add to cart button should be displayed, it displays "login for prices and ordering options" until a user logs in and then all is displayed normaly.

How I have done it is as follows, and truly it is so simple.

I have added some php code to 4 tpl files. (thanks to Paul C for his php guidence)

Themes
product_list.tpl
product.tpl

Modules
Block special .... blockspecial.tpl
homefeatured .... homefeatured.tpl

the code involved is again very simple, just enclose any price of cart display code with


{if $logged} normal code is here

{else}
Login for Prices & Ordering Options
{/if}




That’s all there is to it. I have added the edited 4 tpl files this post for download, they are from the standard prestashop theme. You could use these or just see where the code edits are.

So now no prices of Add to cart button will display until a user logs in.
(of course if you want to use certain other modules that do display the price you will need to add the code to those also.


Now this presents an other problem, what’s to stop a user just registering automatically and then logging in? Well the fantastic Ningu gave me the solution for this. His great Customer registration module.

see here for the module

http://www.prestasho...tion_management

After implementing Ningu’s module this is the basic flow of what happens.

1: A user browses the store but can not see prices or ordering option.
2: User registers and prestashop emails them welcoming them and also that they CANNOT LOGIN until their account has been verified. Also store owner receives an email to let them know there is a new user waiting for verification.
3: Store owner verifies their account (or not) in the back office.
4: User receives a new email letting them know their account is now verified and they can login in.
5: They login and see prices and can order.

This setup is perfect for whole sale stores that do not want retail clients to see price etc.

I have done this mod on the latest release of Prestashop

I have tested this mod on the latest versions of

Firefox
Oprea
Safari for windows
IE 6 / 7

I do hope that this mod can help some prestashop users who want to set their shop as a wholesale store

Cheers

Geno

And great praise to the Presta team.


#8
geno

    PrestaShop Newbie

  • Members
  • Pip
  • 9 posts
HI guilliame

Can you say what is happening, you say it doesnt work, what do you mean ? There is no reason this mod will not work as long as replace the 4 Tpls files and are using that theme.

Also can you post a link to your store so I can look and help you.

Cheers

Geno

#9
RYU

    PrestaShop Newbie

  • Members
  • Pip
  • 1 posts
i do have the same problem after direct "replace" those 4 files, they are solved by

1. reopen those file using text editor, and click "save"

not sure about the reason, but after do to all those 4 files, the function work without any problem. :D
Thanks for the solution.

#10
geno

    PrestaShop Newbie

  • Members
  • Pip
  • 9 posts
HI RYU

You have got me on this one, there is nothing different about the 4 edited tpl files than that of normal Prestashop files. But Im glad that you found a solution to that. If you figure out why it was happening please post cause I have no clue to that one.

Cheers

Geno

PS: what is the error you are getting? or were getting ?

#11
guilliame

    PrestaShop Newbie

  • Members
  • Pip
  • 15 posts
Hello Geno

I just find also the solution.

Thanks

#12
geno

    PrestaShop Newbie

  • Members
  • Pip
  • 9 posts
Hi both of you that had this problem, can you pleae let us know what was happening as in why it wouldnt work or an error. so we can work out why this happend. I think it may have something to code with the page encoding, but until i can find out what the error is I cant work it out completely.

Cheers

Geno

#13
guilliame

    PrestaShop Newbie

  • Members
  • Pip
  • 15 posts
Hi Geno
The code is correct and the function works perfectly. We just have to move the lines a little on the right, "using text editor" in order to be applicated.

Thanks again

#14
geno

    PrestaShop Newbie

  • Members
  • Pip
  • 9 posts
oh well thanks for the info, not sure why this is, cause I know at least 10 people that have cpied the 4 tpls straigh in and all was fine. Very stange. But Im glad that its all ok now.

Cheers

Geno

#15
guilliame

    PrestaShop Newbie

  • Members
  • Pip
  • 15 posts
Hello Geno

The prices are hidden on my web site.

I just find a bug.
I 'am using your method by adding the code in the 4 files and also using the great Customer registration module but :

After the customer completes his email, name, firsname, adresse, surname, town ... and even without a validation using the registration module, the customer can see the prices. I dont know why !!!

Perhaps you can help me?

#16
geno

    PrestaShop Newbie

  • Members
  • Pip
  • 9 posts
HI guilliame

Can you send a website link so I can look please ?

Cheers

Geno

#17
guilliame

    PrestaShop Newbie

  • Members
  • Pip
  • 15 posts
Yes, if you can have a look at :

http://www.ducerf.eu/DUCERF/

#18
geno

    PrestaShop Newbie

  • Members
  • Pip
  • 9 posts
HI guilliame

I have tested you shop and I think you need to edit your themes templates more. THe 4 FILES I gave were only for the standard pretashop template. You are using a different template. For me no prices are displaying on featured products OR main product lists, BUT only on product details. So this will be the template you need to edit.

Hope this helps.

Cheers

Geno

#19
guilliame

    PrestaShop Newbie

  • Members
  • Pip
  • 15 posts
Thanks a lot, i will see and try to find what's happen.

#20
geno

    PrestaShop Newbie

  • Members
  • Pip
  • 9 posts
HI Gu

The trick for this is enclose any price dispaly with this code

Quote

{if $logged} normal code is here

{else} Login for Prices & Ordering Options {/if}


Of corse changing the normal code here to what ever yours is and changing the login for Prices and ordering options with what ever you want.

Remember DO NOT over write your template files with MINE unless you are using the standard prestashop template as that will cause all sorts of weirdness.

Hope it helps

Cheers

GEno