You can implement the theme of your MyCashflow online store so that only logged-in visitors can see the pricing and make purchases. This can be especially useful in case of B2B stores.
Introduction
Hiding purchasing tools and pricing from non-logged in users requires making changes to the theme's product pages and lists.
Below you can see a sample implementation of a product list and product page where purchasing tools and prices are only displayed to logged in customers.
At the end of the article, we'll also show how to make pricing visible only to selected customer groups.
Product-lists
Product list prices are placed in the theme's helpers/list-product-prices.html file with the following content:
{ProductPrices}
{ProductAddToCart}The product list itself can be implemented e.g. by using the {ProductSet} tag:
{ProductSet(
before: '<ul>',
helper: {{
<li>
<h2>{ProductName}</h2>
{ProductListImage}
{Helper(
file: 'helpers/list-product-prices',
case: 'CustomerLogged'
)}
</li>
}},
after: '</ul>
)}In the example, the content of a single product list element is retrieved from the file helpers/list-product.html.
Prices can be retrieved to the list element by using the {Helper} tag and adding the attribute so that the contents of the retrieved file will be visible only to logged in customers.case:'CustomerLogged'
Product pages
Limiting the visibility of purchase tools and pricing on product pages to logged in customers can be implemented in the same way as on product lists: purchase tools and pricing should be placed in a helper file that will be retrieved on the product page with the {Helper} tag.
Below you'll find a sample helpers/product-page-prices.html file that contains prices used on a product page: Note that purchase tools are printed with the {ProductBuy} tag meant for product pages:
{ProductPrices}
{ProductBuy}Below you'll see a sample implementation of a product page:
<h1>{ProductName}</h1>
{ProductShortDesc}
{ProductImages}
{Helper(
file: 'helpers/product-page-prices',
case: 'CustomerLogged'
)}Limiting visibility by customer group
If necessary, you can limit the visibility of purchase tools and pricing to certain customer groups. This is useful if a part of the online store's product range is not available to all customers.
To limit pricing visibility to selected customer groups, implement the product page and product lists the same as in the examples above, but use the {Helper} tag with the attribute , in which the n stands for the selected customer group's ID:case:'CustomerGroup-n'
{Helper(
case: 'CustomerGroup-n'
)}You can find the customer ID in the browser address bar when you open a customer group for editing in the admin panel.
If you have any questions related to the topic, bring it up with the MyCashflow customer service.
Displaying tax-free prices to selected customer groups
If your online store has a dedicated B2B area, you may want to show tax-free prices to the retailers. To do it, use the includetax attribute of price tags along with the {Helper} tag.
In the example below, the prices will be shown without tax, provided that the customer is logged in and belongs to the customer group n. Otherwise, the prices will be shown with tax by using the or attribute (the value of the includetax attribute is true by default):
{Helper(
file: {{
{ProductBuy(variations: 'radio', includetax:'false')}
}},
case: 'CustomerGroup-n',
or: '{ProductBuy(variations: 'radio')}'
)}