hector0371
Forum Replies Created
-
Problem solved .To whom may be interested in this, here is the solution:
instead of [******* user_id=”$bp_customer_id”]
use [******* user_id=” ‘.$bp_customer_id’. “]
@wordplus Sorry ,I read that article and did not see how that fit into the given purpose.Can you be more specific? Thanks!
@wordplus Well, I have been studying that shortcode several times. It seems that the only missing link is “passing the $customer_id into shotcodes` $user_id”.Is there a way to do so?
Forum: Plugins
In reply to: [Code Snippets] So how to insert JS code for running not displaying ?@bungeshea
I am appreciated for your timely response. The thing I was trying to add was a three-level dropdown selection field for city address. The codes for dropdown itself can be easily added via content snippet. However, it requires another piece of code to work. This is where I got confused.This city-selector originally is composed of three parts:
1.index.html ,which I can easily add via content block<div> <fieldset> <label for="addr-show02">您选择的是: <input type="text" id="addr-show02"> </label> <div id="addr-choice"> <ul id="title-wrap"> <li value="0">省份</li> <li value="1">城市</li> <li value="2">县区</li> </ul> <div id="show-panel"> <ul id="addr-wrap"> </ul> </div> </div> <button type="button" class="btn met2">确定</button> </fieldset> </div> <script src="city.js"></script>
2.The source code to back up that dropdown
var addrShow02 = document.getElementById('addr-show02'); //最终地址显示框 var titleWrap = document.getElementById('title-wrap').getElementsByTagName('LI'); var addrWrap = document.getElementById('addr-wrap'); //省市区显示模块 var btn2 = document.getElementsByClassName('met2')[0]; //确定按钮 var current2 = { prov: '', city: '', country: '', provVal: '', cityVal: '', countryVal: '' }; /*自动加载省份列表*/ window.onload = showProv2(); function showProv2() { addrWrap.innerHTML = ''; /*addrShow02.value = '';*/ btn2.disabled = true; titleWrap[0].className = 'titleSel'; var len = provice.length; for (var i = 0; i < len; i++) { var provLi = document.createElement('li'); provLi.innerText = provice[i]['name']; provLi.index = i; addrWrap.appendChild(provLi); } } /*************************需要给动态生成的li绑定点击事件********************** */ addrWrap.onclick = function (e) { var n; var e = e || window.event; var target = e.target || e.srcElement; if (target && target.nodeName == 'LI') { /*先判断当前显示区域显示的是省市区的那部分*/ for (var z = 0; z < 3; z++) { if (titleWrap[z].className == 'titleSel') n = z; } /*显示的处理函数*/ switch (n) { case 0: showCity2(target.index); break; case 1: showCountry2(target.index); break; case 2: selectCountry(target.index); break; default: showProv2(); } } }; /*选择省份之后显示该省下所有城市*/ function showCity2(index) { addrWrap.innerHTML = ''; current2.prov = index; current2.provVal = provice[index].name; titleWrap[0].className = ''; titleWrap[1].className = 'titleSel'; var cityLen = provice[index].city.length; for (var j = 0; j < cityLen; j++) { var cityLi = document.createElement('li'); cityLi.innerText = provice[index].city[j].name; cityLi.index = j; addrWrap.appendChild(cityLi); } } /*选择城市之后显示该城市下所有县区*/ function showCountry2(index) { addrWrap.innerHTML = ''; current2.city = index; current2.cityVal = provice[current2.prov].city[index].name; titleWrap[1].className = ''; titleWrap[2].className = 'titleSel'; var countryLen = provice[current2.prov].city[index].districtAndCounty.length; if (countryLen == 0) { addrShow02.value = current2.provVal + '-' + current2.cityVal; } for (var k = 0; k < countryLen; k++) { var cityLi = document.createElement('li'); cityLi.innerText = provice[current2.prov].city[index].districtAndCounty[k]; cityLi.index = k; addrWrap.appendChild(cityLi); } } /*选中具体的县区*/ function selectCountry(index) { btn2.disabled = false; current2.country = index; addrWrap.getElementsByTagName('li')[index].style.backgroundColor = '#23B7E5'; current2.countryVal = provice[current2.prov].city[current2.city].districtAndCounty[index]; } /*点击确定后恢复成初始状态,且将所选地点显示在输入框中*/ btn2.onclick = function () { addrShow02.value = current2.provVal + ' ' + current2.cityVal + ' ' + current2.countryVal; addrWrap.getElementsByTagName('li')[current2.country].style.backgroundColor = ''; }; /*分别点击省市区标题的处理函数*/ document.getElementById('title-wrap').onclick = function (e) { var e = e || window.event; var target = e.target || e.srcElement; if (target && target.nodeName == 'LI') { for (var z = 0; z < 3; z++) { titleWrap[z].className = ''; } target.className = 'titleSel'; if (target.value == '0') { showProv2(); } else if (target.value == '1') { showCity2(current2.prov); } else { showCountry2(current2.city); } } };
3. The js code file containing the list of cities to be selected from
Can you give me more information on how to implement those three scripts to my page via code snippet to make them whole?
I have seen that shortcode in plugin settings. However ,by default woocommerce/wordpress only offer editing menu items via existing pages, not shortcodes.
Well, I see. Thank you for your reply. I have managed to solve it using another approach.
Thank you for your reply. Here is a simple demonstration of the use of my function:
1. hook onto a trigger when a woocommerce/dokan order status changed to complete and the orders credit is transferred to vendors dokan account (I am using woocommerce_order_status_completed in this case)
2.automatically create a withdraw request for the vendor, with amount equal to all of his account available credit, using method ‘woo-wallet'(Terawallet)
3.automatically approve this withdraw request, transferring credit from his account balance to his woo-wallet(Terawallet) account
This is what this function supposed to work. After it finished, the vendor balance should become 0. However, when I finished running it, the vendor balance remain the last order credit just approved. I think that means my function was triggered before the last completed order credit went into vendor balance.
- This reply was modified 2 years, 1 month ago by hector0371.
Forum: Plugins
In reply to: [WooCommerce] Need recommendation on specific multi-vendor pluginHello! So far I did not receive letters or messages from WooCommerce support team,three days after I left my message on the link given. Did something go wrong ?
Forum: Plugins
In reply to: [WooCommerce] Need recommendation on specific multi-vendor pluginThank you soooooo much! This might be one of the most cheering news I got these weeks. I am writing a letter on it right now. Hopefully the plugin you mentioned can solve my problem once-and-for-all!
Forum: Plugins
In reply to: [Order Delivery Date for WooCommerce] Failed to get delivery date for orderThank you! I`m glad to receive your message. Can you tell me how to create a ticket?
I am glad to receive your thoughtful guide! I have made some progress so far, but it would be nice if I can get more codes to learn from. I read from other topics here that there is a function in Dokan called “automatic disbursement”, which can automatically transfer vendor account balance to target payment method with a set time interval, and it would be nice if I can use similar function to wallet. However, so far I did not find this function either in Dokan dashboard settings or those .php files, and the method to utilize this setting in developer document did not work. I wonder where this function is hiding?
- This reply was modified 2 years, 3 months ago by hector0371.
I
m glad to receive your thoughtful guide! I
ve made some progress so far, but it would be nice if I can get more codes to learn from. I read from other topics here that there is a function in Dokan called “automatic disbursement”, which can automatically transfer vendor account balance to target payment method with a set time interval, and it would be nice if I can use similar function to wallet. However, so far I didnt find this function either in dokan
s dashboard settings or those .php files, and the method to utilize this setting in developer document did`t work. I wonder where this function is hiding?@jahidulhassan
Thank you for your reply, i will try the advices you mentioned. In addition, I also want to know: what should I do if I want to add/remove credit in a Dokan account balance via programs and codes? ThanksForum: Plugins
In reply to: [WooCommerce] Codes in functions.php not workingI just finished the debugging process. Most of the problems are solved, thanks to your help! one problem left behind:
How to add a custom currency symbol via local .png file?
In the codes listed above I already knew how to add custom currency symbol like “$” or “#”, but what should i do if I want to show a .png picture here?
Forum: Plugins
In reply to: [WooCommerce] How to override payment method with a token-based methodThank you Paulo! I have been reading the documentations and pages you posted. They did resolve some problems, yet new problems just keep popping up. Honestly, I was hesitated when trying to post my questions here , since my questions were more “personal” than most core-modifications.
Again, thanks for your help so far! I will keep studying docs on customizing woocommerce in search for new insights.