You can implement the theme of your MyCashflow online store in a way that makes it possible to see the pricing and make purchases only if you are logged in. This can be especially useful in case of retailer 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'll 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 should be located 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 {Products} tag:

{Products(
    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 case:'CustomerLogged' attribute so that the contents of the retrieved file will be visible only to logged in customers.

Product page

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'
)}

Visibility limitations based on customer groups

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 in the same way as in the examples above, but use the {Helper} tag with the attribute case:'CustomerGroup-n', in which the n stands for the selected customer group's ID:

{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 regarding this topic, contact the MyCashflow customer service.

Displaying prices without tax to selected customer groups

If your online store has a dedicated retailer area, you may want to show prices without tax to the retailers. To do it, use pricing tag's includetax attribute with the {Helper} tag.

In the example, 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')}'
)}