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

Jump to content


Welcome to the PrestaShop Forum! We hope you'll share your comments and suggestions with us. We ask that you please post in English to the main sections of the PrestaShop Forum. If you want to write in another language, please post in the corresponding PrestaShop Community section below.

Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

NYC

Vous parlez français ? par ici !


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


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

#1 geno

    PrestaShop Newbie

  • 31 Jan 2009
  • Members
  • Pip
  • 9 posts

Posted 07 February 2009 - 02:33 AM

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 File(s)



#2

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 07 February 2009 - 04:39 AM

Welcome to the PS community. Thank you very much for the module. It works perfectly. Thanks.

#3

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 09 February 2009 - 02:38 PM

Great job!

#4

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 14 February 2009 - 10:05 AM

Would it be easy to adapt this so you could only see the products after loggin in?

#5

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 14 February 2009 - 12:53 PM

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

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 19 February 2009 - 02:21 AM

thanks thats a great idea and very helpful

thanks for sharing :)

#7

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 02 March 2009 - 05:31 PM

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

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 02 March 2009 - 11:38 PM

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

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 March 2009 - 03:41 AM

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

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 March 2009 - 04:54 AM

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

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 March 2009 - 09:14 AM

Hello Geno

I just find also the solution.

Thanks

#12

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 March 2009 - 09:25 AM

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

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 March 2009 - 09:41 AM

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

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 03 March 2009 - 09:52 AM

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

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 29 March 2009 - 12:18 AM

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

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 29 March 2009 - 02:01 AM

HI guilliame

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

Cheers

Geno

#17

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 29 March 2009 - 10:04 AM

Yes, if you can have a look at :

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

#18

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 29 March 2009 - 10:31 AM

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

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 29 March 2009 - 10:50 AM

Thanks a lot, i will see and try to find what's happen.

#20

    PrestaShop Newbie

  • 15 Dec 2011
  • Members
  • Pip
  • 0 posts

Posted 29 March 2009 - 11:02 AM

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users