selectCallback function on Empire theme

New Member
24 0 0

Hi, I'm trying to add a script on our store's selectCallback function but I cannot seem to find it. A help would be very much appreciated. Thanks!

0 Likes
Shopify Expert
2514 423 533

Hi @Jun_Kuan 

try to find in Asset->theme.js file-> find if (!variant) or if (variant), thats your callback functions

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
New Member
24 0 0

They don't have theme.js, only empire.js.liquid but still no luck of finding either of those two :(

0 Likes
Shopify Expert
2514 423 533

Then need to check in file and track code because cant send any solution without checking file or code. 

find variant in this file and you get any idea of code

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
New Member
24 0 0

Hi, I already did with no luck. They seem to have a different name for the function, tried to search "variant", "selectCallback", or "callback" on their js files with no luck. If it helps, here's a link to their main js file: https://pastebin.com/sAJX8ttF

0 Likes
Shopify Expert
2514 423 533

As i can see in this file you have not callback function as no any variants code so please check in other Js file  may be.

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
New Member
1 0 0

Did you find this in the end? I have the same issue.

0 Likes
Shopify Expert
2683 67 676

Most recent theme do not use selectCallback and @Jasoliya advice is the proper one in general.

 

However, I have bad news -- recent versions of Empire have their theme Javascript WebPacked'ed, so it' a) not easy to find the necessary code b) difficult to manage after it was modified. 

 

You can tell if your empire.js is WebPacked if it looks similar to this:

/******/ (function(modules) { // webpackBootstrap
/******/ 	// install a JSONP callback for chunk loading
/******/ 	function webpackJsonpCallback(data) {
/******/ 		var chunkIds = data[0];
/******/ 		var moreModules = data[1];
/******/ 		var executeModules = data[2];
/******/

I'd say that if you're asking this question, then you'd need to ask somebody to do it for you since this is a quite complex task.

Want to hire me to tweak a theme? Mail me at tairli@yahoo.com!
My post solved your problem? Like it!
0 Likes