This is not currently possible, sorry. It’s a good idea though, I’ll see if I can add it for the XF 2.3 updateIs there any way to make it so a coupon can only be used once per person? I can only see a way to set a limit of overall usage for everyone?
Update: Adding this was easier than I expected so this will be included in v4 for XenForo 2.3Is there any way to make it so a coupon can only be used once per person? I can only see a way to set a limit of overall usage for everyone?
Is there any way to get this patched in the 2.2x branch as I won't be upgrading to xf2.3 for quite some timeUpdate: Adding this was easier than I expected so this will be included in v4 for XenForo 2.3
Sadly not, I don't have the bandwidth to support feature updates for multiple XenForo versionsIs there any way to get this patched in the 2.2x branch as I won't be upgrading to xf2.3 for quite some time
Uncaught TypeError: a[0].querySelectorAll is not a function
at HTMLDocument.<anonymous> (shop/:962:52)
at HTMLDocument.dispatch (jquery-3.5.1.min.js?_v=591dcc09:2:43090)
at v.handle (jquery-3.5.1.min.js?_v=591dcc09:2:41074)
at Object.trigger (jquery-3.5.1.min.js?_v=591dcc09:2:71513)
at HTMLDocument.<anonymous> (jquery-3.5.1.min.js?_v=591dcc09:2:72108)
at Function.each (jquery-3.5.1.min.js?_v=591dcc09:2:2976)
at S.fn.init.each (jquery-3.5.1.min.js?_v=591dcc09:2:1454)
at S.fn.init.trigger (jquery-3.5.1.min.js?_v=591dcc09:2:72084)
at Object.activate (core-compiled.js?_v=591dcc09:44:50)
at h (core-compiled.js?_v=591dcc09:48:158)
$(document).on("xf:reinit",(c,a)=>{a&&a[0]&&a[0].querySelectorAll(".overlay[data-url]").forEach(b=>{gtag("event","page_view",{page_title:b.querySelector(".overlay-title").textContent,page_location:b.getAttribute("data-url")})})});document.querySelectorAll(".file-preview").forEach(filePreview=>{filePreview.addEventListener("click",()=>{gtag('event','file_download',{link_url:(new URL(filePreview.getAttribute("href"),window.location.origin)).href, file_name:filePreview.parentNode.querySelector('.file-name').textContent});});});document.querySelectorAll('.shareButtons-button').forEach(shareButton=>{shareButton.addEventListener('click',()=>{gtag('event','share',{method:shareButton.getAttribute('class').match(/.*shareButtons-button--(.*?)$|\s/)[1]});});});document.querySelectorAll('.bookmarkLink:not(.is-bookmarked)').forEach(bookmarkLink=>{bookmarkLink.addEventListener('click',()=>{gtag('event','bookmark');});});document.querySelectorAll(".js-installPromptButton").forEach(a=>{a.addEventListener("click",()=>{gtag("event","app_install_prompt")})});window.addEventListener("appinstalled",()=>{gtag("event","app_install")});XF.PWA&&XF.PWA.isRunning()&&document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&>ag("event","app_open")});setTimeout(()=>{document.querySelectorAll(".adsbygoogle").forEach(a=>{a.addEventListener("mouseenter",()=>{XF.aH=!0});a.addEventListener("mouseleave",()=>{XF.aH=!1});gtag("event","ads_impression",{ad_platform:"adsense"})});["pagehide","blur"].forEach(function(a){window.addEventListener(a,()=>{XF.aH&>ag("event","ad_click",{ad_platform:"adsense"})},!1)})},3E3);
Are you trying to run this on XF 2.3?There's an incompatibility with this and @digitalpoint Better Analytics.
With BA enabled, you can't click on any "Purchase" buttons, as it will throw error:
Code:Uncaught TypeError: a[0].querySelectorAll is not a function at HTMLDocument.<anonymous> (shop/:962:52) at HTMLDocument.dispatch (jquery-3.5.1.min.js?_v=591dcc09:2:43090) at v.handle (jquery-3.5.1.min.js?_v=591dcc09:2:41074) at Object.trigger (jquery-3.5.1.min.js?_v=591dcc09:2:71513) at HTMLDocument.<anonymous> (jquery-3.5.1.min.js?_v=591dcc09:2:72108) at Function.each (jquery-3.5.1.min.js?_v=591dcc09:2:2976) at S.fn.init.each (jquery-3.5.1.min.js?_v=591dcc09:2:1454) at S.fn.init.trigger (jquery-3.5.1.min.js?_v=591dcc09:2:72084) at Object.activate (core-compiled.js?_v=591dcc09:44:50) at h (core-compiled.js?_v=591dcc09:48:158)
Which relates to line:
Code:$(document).on("xf:reinit",(c,a)=>{a&&a[0]&&a[0].querySelectorAll(".overlay[data-url]").forEach(b=>{gtag("event","page_view",{page_title:b.querySelector(".overlay-title").textContent,page_location:b.getAttribute("data-url")})})});document.querySelectorAll(".file-preview").forEach(filePreview=>{filePreview.addEventListener("click",()=>{gtag('event','file_download',{link_url:(new URL(filePreview.getAttribute("href"),window.location.origin)).href, file_name:filePreview.parentNode.querySelector('.file-name').textContent});});});document.querySelectorAll('.shareButtons-button').forEach(shareButton=>{shareButton.addEventListener('click',()=>{gtag('event','share',{method:shareButton.getAttribute('class').match(/.*shareButtons-button--(.*?)$|\s/)[1]});});});document.querySelectorAll('.bookmarkLink:not(.is-bookmarked)').forEach(bookmarkLink=>{bookmarkLink.addEventListener('click',()=>{gtag('event','bookmark');});});document.querySelectorAll(".js-installPromptButton").forEach(a=>{a.addEventListener("click",()=>{gtag("event","app_install_prompt")})});window.addEventListener("appinstalled",()=>{gtag("event","app_install")});XF.PWA&&XF.PWA.isRunning()&&document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&>ag("event","app_open")});setTimeout(()=>{document.querySelectorAll(".adsbygoogle").forEach(a=>{a.addEventListener("mouseenter",()=>{XF.aH=!0});a.addEventListener("mouseleave",()=>{XF.aH=!1});gtag("event","ads_impression",{ad_platform:"adsense"})});["pagehide","blur"].forEach(function(a){window.addEventListener(a,()=>{XF.aH&>ag("event","ad_click",{ad_platform:"adsense"})},!1)})},3E3);
You can then click a second time and the modal will appear, but it doesn't stop the loading bar at the top.
2.2Are you trying to run this on XF 2.3?
If not, I would need @digitalpoint to let me know the cause as I don't believe I do anything non-standard, but if I am I'm happy to change
xf:reinit
is fired. Weirdly it's returning something (it wouldn't get far enough to throw an error if it returned nothing), but I'm not sure what it could be returning.Track overlay as page view
, although that doesn't really solve the problem of what's going on, instead it just doesn't try to track that event.That does indeed get things working again for now, so thank you for thatNot really sure what's going on there, but the jQuery .on() event handler isn't returning the expected array of DOM objects whenxf:reinit
is fired. Weirdly it's returning something (it wouldn't get far enough to throw an error if it returned nothing), but I'm not sure what it could be returning.
Only thing I can think of is something is overwriting jQuery's .on() method with something else.
You can disable the option forTrack overlay as page view
, although that doesn't really solve the problem of what's going on, instead it just doesn't try to track that event.
Hotfixed in v3.4.0, thanksBug: Namespace missing in Finder\SerialKey.php
Causes error:Code:ErrorException: Fatal Error: Cannot declare class SerialKey, because the name is already in use src\addons\DBTech\eCommerce\Finder\SerialKey.php:5
DB Credits adds a payment profile which can be used in eCommerce. If someone has added a “Cash” payment profile that would work too.@DragonByte Tech what's the chance of being able to allow people to purchase with "cash" or "credit" (DBTech Credits) in particular categories or products? We allow our community to earn credits for site activity so that people who cannot afford to pay for an item can 'earn it' through their actions in our community.
It sets up the ability that people who want to pay for X (as a way of supporting us) can, but if they cannot (times are hard for many) they can still get the same benefits as others by just being active.
It would be an awesome integration, at least from within my community -- I'm sure many others could find a benefit, too.
Error: Typed property DBTech\eCommerce\Service\Sale\Create::$threadCreator must not be accessed before initialization in src\addons\DBTech\eCommerce\Service\Sale\Create.php at line 365
DBTech\eCommerce\Service\Sale\Create->sendNotifications() in src\addons\DBTech\eCommerce\Admin\Controller\Sale.php at line 182
DBTech\eCommerce\Admin\Controller\Sale->finalizeSaleCreate() in src\addons\DBTech\eCommerce\Admin\Controller\Sale.php at line 334
DBTech\eCommerce\Admin\Controller\Sale->actionSave() in src\XF\Mvc\Dispatcher.php at line 352
XF\Mvc\Dispatcher->dispatchClass() in src\XF\Mvc\Dispatcher.php at line 259
XF\Mvc\Dispatcher->dispatchFromMatch() in src\XF\Mvc\Dispatcher.php at line 115
XF\Mvc\Dispatcher->dispatchLoop() in src\XF\Mvc\Dispatcher.php at line 57
XF\Mvc\Dispatcher->run() in src\XF\App.php at line 2487
XF\App->run() in src\XF.php at line 524
XF::runApp() in admin.php at line 13
Hotfixed in v3.4.0, thanksBug : If you don't have product thread creation enabled, then adding (or saving a sale) will throw an exception
Code:Error: Typed property DBTech\eCommerce\Service\Sale\Create::$threadCreator must not be accessed before initialization in src\addons\DBTech\eCommerce\Service\Sale\Create.php at line 365 DBTech\eCommerce\Service\Sale\Create->sendNotifications() in src\addons\DBTech\eCommerce\Admin\Controller\Sale.php at line 182 DBTech\eCommerce\Admin\Controller\Sale->finalizeSaleCreate() in src\addons\DBTech\eCommerce\Admin\Controller\Sale.php at line 334 DBTech\eCommerce\Admin\Controller\Sale->actionSave() in src\XF\Mvc\Dispatcher.php at line 352 XF\Mvc\Dispatcher->dispatchClass() in src\XF\Mvc\Dispatcher.php at line 259 XF\Mvc\Dispatcher->dispatchFromMatch() in src\XF\Mvc\Dispatcher.php at line 115 XF\Mvc\Dispatcher->dispatchLoop() in src\XF\Mvc\Dispatcher.php at line 57 XF\Mvc\Dispatcher->run() in src\XF\App.php at line 2487 XF\App->run() in src\XF.php at line 524 XF::runApp() in admin.php at line 13
Are you trying to run this on XF 2.3?
If not, I would need @digitalpoint to let me know the cause as I don't believe I do anything non-standard, but if I am I'm happy to change
<xf:js>
$(document).on("xf:reinit", (c, a) => {
console.log(a);
a &&
a[0] &&
a[0].querySelectorAll(".overlay[data-url]").forEach((b) => {
console.log(b);
});
});
</xf:js>
My guess is something is overwriting jQuery (maybe just partially), but the jQuery .on() method isn’t working as expected for whatever reason. If someone has a URL to share where it’s an issue I could probably work out what’s going on exactly.I can replicate this without using @digitalpoint add on.
Code:<xf:js> $(document).on("xf:reinit", (c, a) => { console.log(a); a && a[0] && a[0].querySelectorAll(".overlay[data-url]").forEach((b) => { console.log(b); }); }); </xf:js>
This code will work on any page (for example - report a post, post thread on main page) except eCommerce ones.
If that helps at all?
My guess is something is overwriting jQuery (maybe just partially), but the jQuery .on() method isn’t working as expected for whatever reason. If someone has a URL to share where it’s an issue I could probably work out what’s going on exactly.
Not sure exactly what's going on, but it has something to do with some annotation HTML comment being injected into the overlay. If you go to theI just ran that code into the developer console - and it causes the same error when hitting the Purchase button.DragonByte eCommerce
Sell your products in the ultimate forum eCommerce solution.www.dragonbyte-tech.com
helper_js_analytics
template, and change this line:<xf:if is="$xf.options.baGeneral.overlay">$(document).on("xf:reinit",(c,a)=>{a&&a[0]&&a[0].querySelectorAll(".overlay[data-url]").forEach(b=>{gtag("event","page_view",{page_title:b.querySelector(".overlay-title").textContent,page_location:b.getAttribute("data-url")})})});</xf:if>
<xf:if is="$xf.options.baGeneral.overlay">$(document).on("xf:reinit",(c,a)=>{if(a&&typeof(a)==='object'&&Object.prototype.toString.call(a)==='[object Object]'){for(const i of a){if(typeof(i.querySelectorAll)==='function'){i.querySelectorAll(".overlay[data-url]").forEach(b=>{gtag("event","page_view",{page_title:b.querySelector(".overlay-title").textContent,page_location:b.getAttribute("data-url")})});break;}}}});</xf:if>
We use essential cookies to make this site work, and optional cookies to enhance your experience.