Lost income due to COVID-19? E-junkie is providing 1 year free accounts to sell anything, anywhere. Click Here for more details.

E-junkie Help >

Template Engine | E-junkie

E-junkie has a Templating Engine to generate Shop/Product pages easily using EJTemplate.php. E-junkie Template is used for rendering E-junkie Marketplace Shops, the E-junkie Wordpress Plugin, E-junkie integration in E-junkie PHP Shop Script, and E-junkie Javascript Shop Script.


We have 3 kind of template syntax.

Global Variables

View Cart URL {EJ.ViewCartUrl} Renders clients view cart url

Products JSON {AllProducts} Renders JSON value of all the products in the current context.

Conditional Templating

Shop Page {IfShop}....{/IfShop} Renders the html code inside the tags if the current page is a shop page or tags page.

Product Page {IfProduct}....{/IfProduct} Renders the html code inside the tags if the current page is a product page. IfProduct html code will be removed when shop page is rendered and vice-versa.

Shop Level Variables

Avaibale when Shop/Tag page is rendered

All the variables are present in Shop example.
{Products}...{/Products} works in loop for generating all the products.
All the product level variables are also present inside the {Products}...{/Products} loop, you can simple use them using {Product.XXXX}, XXXX being the Product property.

Pagination {Pagination}....{/Pagination} Renders the pagination using the template inside the tags.

Product Level Variables

Avaibale when Product page is rendered

All the variables are present in Product example.

Common Variables

Avaibale when both Shop or Product page is rendered

Tags {Tags}...{/Tags} Renders the available tags using the template present inside it. {Tag.Active} renders "active" when the current tag is selected.

Product Form {Product.Form}...{/Product.Form} Renders the form or button code for Cart to work. Make sure you have all the Product.Form child tags present(as provided in example). This works in both shop and product pages.


Shop Template

<!-- Generate View Cart -->
    <h1>Demo Shop</h1>
    <a href="{EJ.ViewCartUrl}" onclick="return EJEJC_lc(this);"></a>

<!-- Generate Tags -->
	    <a class="{Tag.Active}" href="{Tag.Url}">{Tag.Name}</a>

<!-- Generate Products -->
	<a href="{Product.Url}">
    		<img src="{Product.Thumbnail}">
        	<span>{Product.Currency} {Product.Price}</span>

<!-- Generate Pagination -->
	<a class="{Pagination.Active}" href="{Pagination.Url}">{Pagination.Number}</a>

Product Template

<!-- Product Basic Details-->
<p>{Product.Currency} {Product.Price}</p>

<!-- Product Images -->
{Product.Image1}<img src="{Image}">{/Product.Image1}
{Product.Image2}<img src="{Image}">{/Product.Image2}
{Product.Image3}<img src="{Image}">{/Product.Image3}
{Product.Image4}<img src="{Image}">{/Product.Image4}
{Product.Image5}<img src="{Image}">{/Product.Image5}

<!-- Product Type -->
    {ProductSpecs.Bundle}<p>Product Bundle</p>{/ProductSpecs.Bundle}
    {ProductSpecs.Code}<p>Instant Code Delivery</p>{/ProductSpecs.Code}
    {ProductSpecs.File}<p>{ProductSpecs.File.Size} <b>{ProductSpecs.File.Type}</b></p>{/ProductSpecs.File}

<!-- Product Cart Form or Button -->
        <select name="{DropDown.Name}">{DropDown.Options}</select>
        <input type=text name="{TextField.Name}" placeholder="{TextField.PlaceHolder}">

        <button type="submit" onclick="javascript:return EJEJC_lc(this.parentNode);">ADD TO CART</button>

<!-- Product Details -->

<!-- More Details and Demo Link -->
<a href="{Product.HomepageLink}">More Details</a>
<a href="{Product.DownloadLink}">Try Demo</a>

<!-- Affiliate Section -->
    <h4>Become Affiliate</h4>
      <p>Like this product?</p>
      <p>Spread the word about it and <b>earn {Affiliate.Percentage}%</b> of the purchase price on sales you refer. </p>
      <a href="{Affiliate.Url}">Join our affiliate program</a>

<!-- Related Products -->
        <h4>More products</h4>
        <a href="{RelatedProduct.Url}">
                <img src="{RelatedProduct.Thumbnail}">
                <span>{RelatedProduct.Currency} {RelatedProduct.Price}</span>