Require Help in detecting variants for #Bigcommerce platform - bigcommerce

We have an old questions which we have addressed to #Bigcommerce Support Department, but still haven't received a reply.
In our In Stock reminder app we faced a problem related to Stencil theme. On product page for detecting of variant selection we used hook 'product-options-change-remote' and added our own handler of this event in the following way:
window.stencilUtils.hooks.on('product-options-change-remote', function(data) {
var options = data.response.data;
... other code here ...
});
This code worked in the past. Now in our clients' shops we see that the code is not working because window.stencilUtils object doesn't exist there.

Related

UI element updates does not work when purchase completed - Google billing client 4

I have changed over to Google billing client 4.0 library. Since then when purchase is completed, my ui elements updates does not work.
I was trying to check if they are not in UThread anymore or something, but it is not working properly still.
billingClient!!.acknowledgePurchase(
acknowledgePurchaseParams
) { billingResult ->
if (billingResult.responseCode == BillingClient.BillingResponseCode.OK) {
saveSubscription(purchase.purchaseToken, sku)
mainAct?.runOnUiThread {
Toast.makeText(context , "Vásárlás sikeres", Toast.LENGTH_SHORT)
.show()
delegate?.purchaseSuccess(
actProduct,
prevProduct,
purchase.purchaseToken
)
}
}
}
When the acknowledge is done, my UI elements should be updated. There is a menu item should be enabled and in the purchase page a textfield should show that the item is purchased. The code is running, but the UI elements are not updated.
Once I move to a different fragment, the menu item turns to enabled, so it seems to me that somehow the UI is not refreshed.
In the code mainAct is the context to the MainActivity.
Any idea?
The code was running properly on Billing library 3.0.3 and runOnUIThread was not needed at all.
Still getting weird behaviour with this library. I was setting up the billing at the same time as my users log in to the app and go from the login page to the first fragment. This fragment has a recyclerview and this recycler view was filled with data from the web. The recycler view was randomly not showing the elements, even if they were loaded and the adapter was properly updated.
One you moved to another fragment and back the recycler view was showing the data properly.
As I said, the first time call when the billing server is approached the UIThread is messed up and even if data labels or menus are updated, the updates were not showed.
So something is definitely wrong with this library.
Any idea?
This behaviour is a bit weird. The documentation is saying the most of the billing library functions can be run from any thread. Only few needs to be run on UIThread. AcknowlegdePurchase should be running on AnyThread.
I have put the Toasts into runOnUIThread and the inside the delegate functions all commands I have also put inside a runOnUIThread closure.
Now it works as on billing library 3.0.3. But the documentation was not telling anything about any of these changes, so it is really unclear, why the behaviour has changed that much between the two libraries.

Custom Grid App

So I am trying to make modifications to the custom grid app that rally has already created. I found the source code at https://github.com/RallyApps/app-catalog/tree/master/src/apps/grid. However, I cannot get that code to work. I have added it to a js and then ran build (I also changed the json). However, when I then add the app to rally it doesn't give me the settings options (object, query, pagesize, etc) and just generates a table. This table generates 4 rows (the number of user stories I have), but the rows are completely blank except for gears at the beginning of each row. I was wondering if I was building this app incorrectly or if I had grabbed the wrong code. If not, is there a place where can I get the complete code or a way to modify the already existing code?
Thanks
You may add a fetch to the config as below:
config: {
defaultSettings: {
types: 'hierarchicalrequirement',
fetch: 'FormattedID,Name'
}
}
and it will display a grid.
It will not display settings dialog however. The source code in this github repo is not exactly the CustomGrid app available from the AppCatalog in the UI. It does not have the full functionality and not ready yet. I submitted a defect.

Javascript split working incorrectly in IE

I have one page checkout. My OPC works fine with other browsers but I get a fatal error with IE. IE's Javascript console says Object doesn't support this property or method.. The method in question is var items = field_name.split(reg) from the file: order-address.tpl.
I have no idea what is causing the problem. Because of this error, I cannot login properly from one page checkout when using IE. It seems that there are a lot of people with the same problem. What's the issue?
This error is present in 1.4.9, 1.4.10, and 1.5.3.
SOLVED. It turns out the issue is not with coding but with settings of IE.
All I had to do was reset IE from Tools => internet options => advanced => reset (including personal settings)
That did it for me. Thank you altafhussain for trying to help me out.

Issue With List Email Events and Custom List

I am having an issue with EmailReceived method with a custom list.
After creating the event receiver and setting "Handle EmailReceived" = true in the folder properties area of the event item the following is stubbed in the .cs file
public override void EmailReceived(SPList list, Microsoft.Sharepoint.SPEmailMessage
emailMessage, string receiverData)
{
base.EmailReceived(list, emailMessage, receiverData);
}
I know that SPEmailMessage is contained in Microsoft.Sharepoint.Utilities, but when I change the parameter in what is stubbed out the "Handle EmailReceived" is automatically changed to false causing my code not to get called.
I have tested using the default email to list item feature on other list types like announcements and everything works fine. However I have the same problem with the wrong parameters being stubbed out on them also.
I have searched everywhere and I can't find anyone else with a similar problem.
The software I am using is VS2010 SP1 and Sharepoint 2010.
Thank you,
Mike
I put in an incident with Microsoft Support and they concluded that it was a bug and will be fixed in a future update.

How to stop firefox from downloading and applying CSS via a firefox extension?

Thanks to everyone in advance -
So I have been banging on this issue for quite a while now and have burned through all my options. My current approach to canceling css requests is with nsIRequest.cancel inside of nsIWebProgressListener.onStateChange. This works most of the time, except when things are a little laggy a few will slip through and jump out of the loadgroup before I can get to them. This is obviously a dirty solution.
I have read through the following links to try and get a better idea of how to disable css before a nsIRequest is created...no dice.
https://developer.mozilla.org/en/Document_Loading_-_From_Load_Start_to_Finding_a_Handler
https://developer.mozilla.org/en/The_life_of_an_HTML_HTTP_request
https://developer.mozilla.org/en/Bird's_Eye_View_of_the_Mozilla_Framework
How do I disable css via presentation objects/interfaces? Is this possible? Inside of nsIDocShell there are a few attributes that kind of imply you can disable css via the browsers docshell - allowPlugins, allowJavascript, allowMetaRedirects, allowSubframes, allowImages.
Any suggestions?
Thanks,
Sam
The menu option that disables style sheets uses a function
setStyleDisabled(true)
so you probably can just call this function whenever new browser tab is created. Style sheets are still requested from server, but not applied. This function is not very sophisticated and doesn't mess with nsIRequest, source:
function setStyleDisabled(disabled) {
getMarkupDocumentViewer().authorStyleDisabled = disabled;
}
Digging in Web Developer Toolbar source code I have noticed that their "disable stylesheets" function loops trough all document.styleSheets and sets the disabled property to true, like:
/* if DOM content is loaded */
var sheets = document.styleSheets;
for(var i in sheets){ sheets[i].disabled = true; }
So if the key is to not apply CSS to pages, one of the above solutions should work. But if you really need to stop style sheets from being downloaded from servers, I'm affraid nsIRequest interception is your only option.
Set permissions.default.stylesheet to 2 and voilà!
You can actually use the permissions manager to block or allow stylesheets on a host-by-host basis.
Unfortunately there doesn't seem to be a simple flag like allowImages. The bugzilla adding for that is https://bugzilla.mozilla.org/show_bug.cgi?id=340746. You can now vote for it using the new bugzilla voting functionality. You can also add yourself to the CC list to be notified if anyone ever works on it.
A related request is to just give us basic HTML parsing support, which may be what you are trying to do. Unfortunately that isn't supported yet either, but you can vote/track the bugzilla for that at https://bugzilla.mozilla.org/show_bug.cgi?id=102699.
So the only workable solution seems to be some sort of interception as #pawal suggests. Here is a link that talks about the basics of interception to at least get you/us started https://developer.mozilla.org/en/XUL_School/Intercepting_Page_Loads. It lists several options that I list below.
These first few seem to just be at the page/document level so I don't think they help:
Load Events (addEventListener load)
Web Progress Listeners (nsIWebProgressListener) - I tried this approach, it only seems to be called for the page itself, not for content within the page.
Document Loader Service - A global version of nsIWebProgressListener so I think it has the same problem (page level only)
That leaves two others I have not tried yet. They work globally so you would need to filter them to just the browser/pages you care about.
HTTP Observers - Seems like it might work, need to verify it calls back for CSS
Content Policy - Seems like the best option to me since it explicitly is called for CSS, someday I hope to try it :)