Current versions of most of the stock template packages include a feature to display a message to let customers know if they have previously purchased a product, are currently subscribed to a product, or have already added the product to the basket. This feature is implemented through three sets of QuickCode Tags that may also be added to older template packages and custom template packages, to provide the same functionality.
Display a message if a customer has already added the product to the basket
To display a message if a customer has already added the product to the basket, use the following set of QuickCode Tags:
{IF-PRODUCT-IN-BASKET-BEGIN}
{PRODUCT-IN-BASKET-SUMMARY}
{IF-PRODUCT-IN-BASKET-END}
These QuickCode Tags are primarily used in the product template (product.tpl), but may also be used in templates for pages that display lists of products, as long as they are inserted in the appropriate block.
For instance, to use these QuickCode Tags in the category template (category.tpl), they would need to be inserted between {CATEGORY-RESULTS-BLOCK-BEGIN} and {CATEGORY-RESULTS-BLOCK-END}.
Display a message if a customer has previously purchased the product
To display a message if a customer has previously purchased the product, use the following set of QuickCode Tags:
{IF-PRODUCT-IN-ORDER-HISTORY-BEGIN}
{PRODUCT-IN-ORDER-HISTORY-SUMMARY}
{IF-PRODUCT-IN-ORDER-HISTORY-END}
These QuickCode Tags are primarily used in the product template (product.tpl), but may also be used in templates for pages that display lists of products, as long as they are inserted in the appropriate block.
For instance, to use these QuickCode Tags in the vendor template (vendor.tpl), they would need to be inserted between {VENDOR-RESULTS-BLOCK-BEGIN} and {VENDOR-RESULTS-BLOCK-END}.
login required
This set of order history summary QuickCode Tags is only able to display a message if the customer is currently logged into the customer account associated with the previous purchase of the product. If the customer is not logged into a customer account at all, or has since created a different customer account, the shopping cart will not be able to associate the previous purchase of the product with the current visitor, to display a message.
Display a message if a customer is currently subscribed to the product
To display a message if a customer is currently subscribed to the product, use the following set of QuickCode Tags:
{IF-PRODUCT-IN-SUBSCRIPTION-BEGIN}
{PRODUCT-IN-SUBSCRIPTION-SUMMARY}
{IF-PRODUCT-IN-SUBSCRIPTION-END}
These QuickCode Tags are primarily used in the product template (product.tpl), but may also be used in templates for pages that display lists of products, as long as they are inserted in the appropriate block.
For instance, to use these QuickCode Tags in the store home page template (index.tpl), they would need to be inserted between {FEATURED-PRODUCT-BLOCK-BEGIN} and {FEATURED-PRODUCT-BLOCK-END}.
login required
This set of subscription summary QuickCode Tags is only able to display a message if the customer is currently logged into the customer account associated with the subscription to the product. If the customer is not logged into a customer account at all, or has since created a different customer account, the shopping cart will not be able to associate the subscription to the product with the current visitor, to display a message.
Customizing the appearance of the messages
The "summary" QuickCode Tag may be wrapped in HTML code to allow CSS styles to be applied.
example
{IF-PRODUCT-IN-BASKET-BEGIN}
<span class="PRODUCT-IN-BASKET-SUMMARY">{PRODUCT-IN-BASKET-SUMMARY}</span>
{IF-PRODUCT-IN-BASKET-END}
The "summary" QuickCode Tag is wrapped in a span that has a class assigned to it, so that CSS rules for that class may be added to the template package's stylesheet, customizing the appearance of the "product in basket" message.
|