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

TOPIC: Different Price Labels for logged in customers

Different Price Labels for logged in customers 10 years 2 months ago #8264

Hello,

Is there something built in to LightMart that allows Price labels to be different for anonymous users and then Logged/registered users ?

I would like to have a label next to the price that says something like "Log in to get pricing" for anonymous. Once they are registered and logged in, the label is either blank or ability to say something different like "Your Cost".

Thank you
The topic has been locked.

Different Price Labels for logged in customers 10 years 2 months ago #8281

Hi,

Yes, that's possible to hide the prices from anonymous or provide different prices for different shopper groups.
(those shopper groups can be regular "register users". or a special group, something like; special shopper that you put them into that group manually.)

Those are all possible through Virtuemart Backend.

First decide which option you need. Because there are 2 possible ways:
  1. Hide price from anonymous, show add to cart button
  2. Hide price from anonymous, hide add to cart button

Probably you want to go with the 2nd option, right? Because there is no point to show the add to cart button, if the price is unknown.

So i am assuming you want to go with the 2nd option. This is what you need to do.
Open the VM Backend.

First make sure this option is enabled:

Attachment Pasted_Image_1_29_14__4_52_PM-3.png not found



Then open any product and choose this option:
(you have to do this change to all products one-by one)

Attachment Pasted_Image_1_29_14__4_44_PM-8.png not found



If you choose this option, in the frontend you will see this (if you are not logged in):

Attachment Pasted_Image_1_29_14__4_47_PM-3.png not found



Since the price will be hidden (unknown) to -anonymous- users, the Virtuemart will pretend like, the price field left blank. So the "Call for Price" button will appear.

All you need to do is to change this "Call for Price" text and change it's link to "registration" page.

Open this PHP file:
/templates/flexible_lightmart/html/com_virtuemart/priductdetails/default.php

and find this line:
<a class="FlexibleAskforPrice" <?php  if (!($parameter == "quicklook")) { ?>rel="facebox" rev="iframe|550|650"<?php } ?> href="<?php echo JRoute::_('index.php?option=com_virtuemart&tmpl=component&view=productdetails&task=askquestion&virtuemart_product_id='.$this->product->virtuemart_product_id.'&virtuemart_category_id='.$this->product->virtuemart_category_id.''); ?>"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ASKPRICE') ?></a>

And replace it with this:
<a class="FlexibleAskforPrice" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&flexible=register&task=editaddresscart&addrtype=BT'); ?>">Register to see the price</a>

Change the text: Register to see the price, as you wish

The result will be:

Attachment Pasted_Image_1_29_14__4_56_PM-3.png not found


(the button "Register to see the price" will be linked to here: index.php?option=com_virtuemart&view=user&flexible=register&task=editaddresscart&addrtype=BT which is the registration page.

Attachment Pasted_Image_1_29_14__4_56_PMs-4.png not found



Regards,
Support
The topic has been locked.

Different Price Labels for logged in customers 10 years 2 months ago #8289

Hi,

Thanks for the all the information, but here is the point:

1) I have turned virtuemart/lightmart into a distributor website. Not through hacks that will break with each upgrade but by simplly using the Shopper Groups, Product Categories and Rate Calculations together. We have more specialized technology that we sell than commodities.

2) This means I want Anonymous people and search engines to pick up on the part numbers and MSRP prices.

3) When someone becomes a customer/register user then we can assign them pricing discounts based on the manufacturer and product.

With that said, I want to have a label that says something like "REGISTER TO GET YOUR PRICING" by the MSRP price when anonymous. When they login as as registered, I need it to go away or be customizable with a different label message. Of course will be displaying the discounted price.

So this is really about the Labels and not so much the price. Does this make more sense ?

I have attached sample looks for Anonymous and Registered and what I am looking for.


Thank you.
Attachments:
The topic has been locked.

Different Price Labels for logged in customers 10 years 2 months ago #8290

Ohh, i see what you meant now.

By the way, the tutorial i provided above didn't useful for your case, but i hope will be useful to somebody else who is looking for something like that.

Anyway, your case is quite simple to achieve though. What actually you need is;
- Check if the user logged or not.

In Joomla there is a simple way to make this check.
<?php 
     $user = JFactory::getUser();
     if (!$user->id) { ?>
         You are not logged-in label/button goes here. Include plain HTML here
     <?php } else { ?> 
         You are logged-in label/button goes here. Include plain HTML here
<?php } ?>

All you need to do is apply the same scheme to Category page or product details page (or what ever page you want to show the label based on user's login situations)

From the screenshot you provided, i am seeing you want to display this text/button below the Add to cart button in the Category page (ListView)

then open this PHP file:
/templates/flexible_lightmart/html/com_virtuemart/category/default.php

find this line
<?php } }  // Add To Cart Button END ?>
(look around 544th line, this is important, because you will find the same exact line in 3 different places. One for ListView, one for GridView and one for MultiGridView. the one around 544th is for the ListView):

and right after it, include these lines:
<?php 
     $user = JFactory::getUser();
     if (!$user->id) { ?>
            <a class="FlexibleAskforPrice" href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&flexible=register&task=editaddresscart&addrtype=BT'); ?>" style="margin:10px 0; text-transform:capitalize;font-size:15px;float:right;"> Register for your pricing</a>
     <?php } else { ?>
           <a class="FlexibleAskforPrice" href="#" style="margin:10px 0; text-transform:capitalize;font-size:15px;float:right;">You are logged in!</a>
     <?php } ?>

You can customize the A-tags as you wish.

Attachment ScreenShot2014-01-29at9.02.51PM.png not found





The result will be:

-anonymous- (not logged in users)

Attachment ScreenShot2014-01-29at9.03.31PM.png not found



-default- (logged in users)

Attachment ScreenShot2014-01-29at9.04.31PM.png not found




(those screenshots are captured live, they are not PhotoShop, so this modification is tested&confirmed)
Last Edit: 10 years 2 months ago by Support.
The topic has been locked.

Different Price Labels for logged in customers 10 years 2 months ago #8308

Thank you, I will give that a try tonight!
The topic has been locked.

Different Price Labels for logged in customers 10 years 2 months ago #8324

Let me know in case it won't work. But i have tested the code modification and took the screenshots from the live server. So, i am 100% sure it will work (if you follow exactly what i was saying)

Regards,
Support
The topic has been locked.

Different Price Labels for logged in customers 10 years 2 months ago #8325

Hi,

I tested and it does work perfectly !

That leads me to 2 questions to fine tune this:

1) How do I put the Label below the price instead of the Add to Cart

2) How do I add the text "MSRP" to the left of the price so I can let everyone know this the Manufacturer List Price? I tried to find the label in Language file, but PricesalesPrice Is not there. I can set the option to enable the label in the final sales price, but I don't see where this label is

Thanks
The topic has been locked.

Different Price Labels for logged in customers 10 years 2 months ago #8340

Hi,

The modification you were asking has already been "custom modification" and i have guided you to tackle this situation, but it was relatively easy and i thought it might be useful to many other people. Normally, we don't free support for custom modification. From this stand point, i can't provide you any further step-by step tutorial. Simply because there is no limit on "customization".

If you need any further support, you need to purchase premium support hours through:
www.flexiblewebdesign.com/premium-support

With "premium support", we take care the customizations for you on your website (instead of telling you how to do it.)

Here are my final guidance about the same topic:

1) to put the label below the "add to cart" button, you need to put the PHP lines (that i have provided) below the PHP lines to generate the "add to cart" button.

2) You will duplicate the PHP lines that i have provided you, but this time you will use those lines to generate another label (MSRP) and put it above the PHP lines which are used to generate the Price. (then with CSS, float:left; rule will move that label to the left side of price.)

Regards,
Support
Last Edit: 10 years 2 months ago by Support.
The topic has been locked.

Different Price Labels for logged in customers 10 years 2 months ago #8395

Thank you, I understand your point and I am not always looking for something free. I would rather understand how you are doing things to be more self sufficient.

I will give this a try.
The topic has been locked.

Different Price Labels for logged in customers 10 years 2 months ago #8420

Actually this:
With "premium support", we take care the customizations for you on your website (instead of telling you how to do it.)

is a good thing, so you won't waste any time on it. But if you would rather the other way around, it is absolutely fine.

Let me know if you need any further assistance (premium support).

Regards,
Support
Last Edit: 10 years 2 months ago by Support.
The topic has been locked.

Different Price Labels for logged in customers 10 years 1 month ago #8756

Cas solved. Topic is closed.

regards.
The topic has been locked.
Time to create page: 0.202 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