0.0.7 • Published 3 years ago

@goaffpro/affiliate-web-components v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Goaffpro affiliate web components

This library loads the necessary components to display affiliate information on your storefront or any other HTML page

Usage

  1. Load the library via CDN. Add the following script tag just above </body> OR </head> tag in your theme
<script type="module" src="https://unpkg.com/@goaffpro/affiliate-web-components@latest/dist/affiliate-web-components/affiliate-web-components.esm.js"></script> 
  1. Generate a public token to be used in the webcomponents. To generate the token, open Goaffpro merchant admin panel -> Settings page -> Advanced Settings tab -> Access tokens section. Click NEW API KEY to generate X-GOAFFPRO-PUBLIC-TOKEN. You will need to use the generated token in the next step

  2. Now you are ready to use the webcomponents. See below

Available Components


Affiliate Info component

This component allows you to display affiliate related information in your store when the customer uses the affiliate's link to enter the store.

<affiliate-info token="x-goaffpro-public-token" text="You are shopping with {{name}}"></affiliate-info>
Available attributes
AttributeDescriptionMandatory
tokenThe x-goaffpro-public-token generated in Step 2 aboveYES
textThe text to display on the page. A number of custom tags are available to customize the text. See list of available tags belowYES
classThe CSS class to apply on text
TagDescriptionExample
nameThe name of the affiliate{{name}}
first_nameThe name of the affiliate{{first_name}}
last_nameThe name of the affiliate{{last_name}}
company_nameThe name of the affiliate{{company_name}}
couponThe coupon code given to the affiliate{{coupon}}

Note: For Shopify's liquid files, please wrap the component in raw tag to ensure custom tags are preserved in generated HTML. eg.

{% raw %}
<affiliate-info token="x-goaffpro-public-token" text="You are shopping with {{name}}"></affiliate-info>
{% endraw %}

Affiliate selector component

This component allows you to display a list of affiliates for your customer to choose from when placing an order.

<affiliate-selector token="x-goaffpro-public-token"></affiliate-selector>
Available attributes
AttributeDescriptionMandatoryDefault
tokenThe x-goaffpro-public-token generated in Step 2 aboveYES
labelThe affiliate property to show in the selector. See list of available properties belowNOname
fallbackThe fallback property to show in case the label is not set by the affiliateNOname
group_idThe group whose members are visible in the selector. Group ID is visible in the admin panelNo
classThe CSS class to apply on the select elementNO

Available properties

PropertyDescription
nameThe name of the affiliate
first_nameThe first name of the affiliate
last_nameThe last name of the affiliate
company_nameThe company name of the affiliate

Affiliate photo component

This component allows you to display profile photo of the affiliate as an img tag

<affiliate-photo token="x-goaffpro-public-token"></affiliate-photo>
Available attributes
AttributeDescriptionMandatoryExample
tokenThe x-goaffpro-public-token generated in Step 2 aboveYES
altThe affiliate property to show in the selector. See list of available properties belowNOAffiliate's photo
fallback_srcThe affiliate property to show in the selector. See list of available properties belowNOhttps://via.placeholder.com/100x100
widthSet width of the imageNO100
heightSet height of the imageNo100
classThe CSS class to apply on the select elementNO
coverShorthand to set css object-fit property to coverNOYes
roundedShorthand to set image as roundedNOYes
borderRadiusShorthand to set border radius of the imageNO8
0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago