Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Responsive Joomla Virtuemart Template - LightMart (SKU# FLEX-00012)

TOPIC: Tiny Add to Cart Button only for logged in users

Tiny Add to Cart Button only for logged in users 10 years 5 months ago #7224

I need Tiny Add to Cart Button to show only for logged in users in both grid views. I know the code is somewhere in templates/flexible_lightmart/html/ but it seems I can't find the right one.

Thank you in advance.
The topic has been locked.

Tiny Add to Cart Button only for logged in users 10 years 5 months ago #7257

Hi,

You need to look at this PHP file:

/templates/flexible_lightmart/html/com_virtuemart/category/default.php

and look for these lines which print the tinyAdd To Cart button:

For the GridView layout
 if ($params->get('category_grid_tinyaddtocart',1)) {

For the MultiGridView layout
if ($params->get('category_multi_tinyaddtocart',1)) {

This IF.. STATEMENT checks if the "tinyaddtocart" plugin parameter is set to YES, then it prints the tiny button. All you need to do is adding an another condition to that IF statement, which is to check if the user is logged in.

Eventually it will look like:
if (($firstcondition == 1) and ($secondcondition == 1)) {

So the condition will be passed only if both conditions are validated. (1.condition= plugin parameter set to yes, 2.condition= user is logged in)

Unfortunately i can't provide you any more support about it, as it is a custom modification and it is beyond our free support.

Regards,
Support.
The topic has been locked.

Tiny Add to Cart Button only for logged in users 10 years 5 months ago #7315

Thank you and sorry for late replay.
Yes I know about support, I just needed the lines, and thank you for them.

I will post here example of the solution if someone needs it ( delete this lines if they are inappropriate...)
if ($params->get('category_grid_tinyaddtocart',1) && JFactory::getUser()->id) {
Last Edit: 10 years 5 months ago by ikik.
The topic has been locked.

Tiny Add to Cart Button only for logged in users 10 years 4 months ago #7332

Hi,

I am glad you figured that out, it was that much easy.
I hope others will get benefit from this topic.

Case solved. Topic closed.

Cheers,
support & development
Last Edit: 10 years 4 months ago by Support.
The topic has been locked.
Time to create page: 0.165 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo