Update Theme

Update theme to existing theme.

End Point

POST https://api.cartup.ai/v1/theme/update

Headers

NameTypeDescription

Accept*

String

application/json

Content_type*

String

application/json

X-Cartup-Access-Token*

String

$CARTUP_API_KEY

X-Cartup-orgId*

String

$CARTUP_ORD_ID

Request Body

NameTypeDescription

themeID*

String

theme ID (Should be unique)

orgID*

String

Your org ID

orgName*

String

You org name

type*

String

"Custom"

htmlTemplate*

String

Html template

cssTemplate*

String

CSS template

jsTemplate*

String

Java Script

themeId*

String

UUID

displayType*

String

carousel

id*

String

Theme Update IDtheme ID (Shou be unique)tdp meh

{
"errMsg":null,
"uid":"852968f0-7c8c-45d7-8ab0-e7287162a67e"
}

Curl Example

curl --request POST 'https://api.cartup.ai/v1/theme/update'
--header 'Accept: application/json' \  
--header 'Content-Type: application/json' \  
--header 'X-Cartup-Access-Token: $CARTUP_API_KEY'
--header 'X-Cartup-orgId : $CARTUP_ORD_ID'
{
  "id": "852968f0-7c8c-45d7-8ab0-e7287162a67e",
  "orgId": "850a8b8f-a6fe-49e4-88fc-874843279d66",
  "orgName": "WorldMarts",
  "type": "Custom",
  "description": "test",
  "themeId": "testtheme",
  "htmlTemplate": "<div class=\"wrapper\">\n      <div class=\"search-input\">\n        <a href=\"\" target=\"_blank\" hidden></a>\n        <input type=\"text\" placeholder=\"Enter a keyword..\" id=\"searchInput\">\n        <div class=\"autocom-box\" style=\"display:none\"></div>\n        <div class=\"icon\"><i class=\"fas fa-search\"></i></div>\n      </div>\n    </div>",
  "cssTemplate": "@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap');\n*{\n  margin: 0;\n  padding: 0;\n  box-sizing: border-box;\n  font-family: 'Poppins', sans-serif;\n}\n\nbody{\n  background: #ffffff;\n  padding: 0 20px;\n}\n\n::selection{\n  color: #fff;\n  background: #664AFF;\n}\n\n.wrapper{\n  max-width: 450px;\n  margin: 150px auto;\n}\n\n.wrapper .search-input{\n  background: #fff;\n  width: 100%;\n  border-radius: 5px;\n  position: relative;\n  box-shadow: 0px 1px 5px 2px rgba(0,0,0,0.12);\n}\n\n.search-input input{\n  height: 55px;\n  width: 100%;\n  outline: none;\n  border: none;\n  border-radius: 5px;\n  padding: 0 60px 0 20px;\n  font-size: 18px;\n  box-shadow: 0px 1px 2px rgba(0,0,0,0.1);\n}\n\n.search-input.active input{\n  border-radius: 5px 5px 0 0;\n}\n\n.search-input .autocom-box{\n  padding: 0;\n  max-height: 580px;\n  overflow-y: auto;\n}\n\n.search-input.active .autocom-box{\n  padding: 10px 8px;\n  opacity: 1;\n  pointer-events: auto;\n}\n\n.autocom-box li{\n  list-style: none;\n  padding: 8px 12px;\n  display: none;\n  width: 100%;\n  cursor: default;\n  border-radius: 3px;\n  z-index: 999\n}\n\n.search-input.active .autocom-box li{\n  display: block;\n  cursor:pointer;\n}\n.autocom-box li:hover{\n  background: #efefef;\n}\n\n.search-input .icon{\n  position: absolute;\n  right: 0px;\n  top: 0px;\n  height: 55px;\n  width: 55px;\n  text-align: center;\n  line-height: 55px;\n  font-size: 20px;\n  color:#5e615e;\n  cursor: pointer;\n}",
  "jsTemplate": "$(\"#searchInput\").keyup(function (e) {\n            $(\".suggestions\").hide();\n            var searchTxt = $(this).val();\n            if (e.keyCode == 13) {\n                $(\".search-keyword\").html(\"See \" + searchTxt);\n                $(\".search-keyword\").show();\n            }\n            $('.autocom-box').show()\n            renderUI(searchTxt);\n            searchTxt = searchTxt.toLowerCase();\n            $(\".suggestions li\").each(function () {\n                str = $(this).find(\".suggestionVal\").html();\n                str = str.toLowerCase();\n                //var isIncluded = str.includes(searchTxt);\n                if (str.indexOf(searchTxt) > -1) {\n                    //console.log(str);\n                    $(\".lgsearchbar\").attr(\"class\", \"lgsearchbar d-lgblock searchdrop\");\n                    $(this).show();\n                    $(this).find(\".searchIcon\").show();\n                    $(\".suggestions\").show();\n                } else {\n                    $(this).find(\".searchIcon\").hide();\n                    $(this).hide();\n                }\n            });\n        });\n\n        $(\".suggestions li\").click(function () {\n            $(\"#searchInput\").val($(this).find(\".suggestionVal\").html());\n            $(\".search-keyword\").html(\"See \" + $(this).find(\".suggestionVal\").html());\n            $(\".search-keyword\").show();\n        });\n\n        function renderUI(val){\n            return '<ul class=\"suggestions\" id=\"spodtdy-suggestions\" style=\"padding-top: 5px; display: block;\"><li class=\"spotdySuggestionItem\" style=\"cursor:pointer;\"><span class=\"searchIcon\" style=\"position: relative; margin-right:15px;margin-left:7px;\"><i style=\"color:#bdbdbd;font-size: 18px;\" class=\"fa fa-search\"></i></span><span category=\"undefined\" name=\"frankie\" onclick=\"setProductQuery(this)\" class=\"suggestionVal\">frankie</span></li><li class=\"spotdySuggestionItem\" style=\"display:flex;cursor:pointer;\" onclick=\"window.location.href=http://mdev.ecomtics.nl/frankie-sweatshirt.html\"><div style=\"position: relative;margin-left:0;margin-right: 10px;\"><img src=\"http://mdev.ecomtics.nl//pub/media/catalog/product/m/h/mh04-green_main_1.jpg\" style=\"width:30px;\"></div><div style=\"display:flex;flex-direction:column;\"><span category=\"undefined\" name=\"frankie sweatshirt\" class=\"suggestionVal\">frankie sweatshirt</span><span> $60.00 <button class=\"btn btn-small btn-primary addToCart\" style=\"float:none;display: inline-block;height: 23px;margin-left: 0;font-size: 11px;width: 85px;padding: 0px;cursor:pointer;\"><i class=\"fa fa-shopping-cart\"></i> Add to cart</button></span></div></li></ul>';\n        }",
  "displayType": "carousel"
}

Request Body

Please refer to field descriptions in the POST Body above.

‌Example

{
  "id": "d9d74dce-56af-40a8-946f-bd4b2dff62e8",
  "orgId": "8dbc90c4-ad66-48c4-9711-ce3065cfd189",
  "orgName": "freshcouture",
  "type": "Custom",
  "description": null,
  "themeId": "cartup-theme1",
  "htmlTemplate": "<div style=\"display:block;position: relative;\">\n\t<div class=\"widgetDisplayName\"><h2 class=\"recent__title theme\">{{widget_displayName}}</h2></div>\n\t\t<div class=\"product-grid\" id=\"test-widget-wrapper\">\n\t\t\t<div class=\"product-item one-quarter small--one-half\">\n\t\t\t\t<a class=\"product-link\" href=\"{{product_currentPageUrl}}\">\n\t\t\t\t\t<div class=\"product-item__image\">\n\t\t\t\t\t\t<div class=\"product-item__bg\" style=\"background-image:url({{product_imageUrl}});\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"product-information\">\n\t\t\t\t\t\t<span class=\"title\"><h5>{{product_name}}</h5></span>\n\t\t\t\t\t</div>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>",
  "cssTemplate": null,
  "jsTemplate": "",
  "displayType": "carousel"
}

Last updated