How to display a product category on a Web Page Print

  • Store
  • 0

If you want to display a certain Product Category on a Web Page instead of the entire catalog, you can customize the integration code. To do this, you need to add the defaultCategoryId parameter to the integration code.

Copy your store integration code from Store > Store Settings and paste it into the Web Page HTML.

<div id="my-store-STOREID"></div>
<div><script data-cfasync="false" type="text/javascript" src="https://app.ecwid.com/script.js?STOREID&data_platform=code" charset="utf-8"></script>
<script type="text/javascript"> xProductBrowser("id=my-store-STOREID", "defaultCategoryId=CATEGORYID");</script></div>

2. Edit this line of code:

xProductBrowser("id=my-store-STOREID");

to be 

xProductBrowser("id=my-store=STOREID","defaultCategoryId=CATEGORYID");

IMPORTANT: Remember to change STOREID to your store's ID found on at the bottom of your Store Admin site. Also a comma is needed between parameters.

3. Get the CategoryID by navigating to the Category's page in the Store Admin site: Catalog > Categories.

4. Click the Category you would like to display and copy the ID from the browser URL. You will see a number after the "id=" section in the URL.

Store Category ID

5. Replace the CATEGORYID parameter in the integration code. In the example above it would be 80660254.

6. Save the Web Page. The Web Page should now display the Products that are assigned to the Category.


Was this answer helpful?

« Back

Powered by WHMCompleteSolution