I’m using a custom single product page where ‘Sold by’ not appearing as it was ok in default single product page. I think I need to add_action hook in function.php, can you please let me know the code which should display just after or within woocommerce meta?
Thanks
]]>Thanks
]]>I’m trying to add a separate page on my multi-vendor website in order to make possible to vendors to only see their pending orders. Using fetch, this will keep updated the page on every new order.
The problem is that WCFM REST API is working without problems into Postman but, when the same request comes from the browser, then I receive the 401.
Here is the JS Fetch version that Postman automatically creates when clicking on “code” (this works inside Postman):
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
myHeaders.append("Authorization", "Basic <em>ENCODED_USER_PASSWD</em>");
var urlencoded = new URLSearchParams();
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://my-website.it/wp-json/wcfmmp/v1/orders/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Trying to use that as it is inside a clean html page generate a 401.
Then i tried to use different syntax for this fetch inside the html page but it gives me 401. Here is the code:
<div id="orders" class="container"></div>
<script>
let woousername = '<em>USERNAME</em>';
let woopassword = '<em>PASSWD</em>';
var wooencodedData = window.btoa(woousername + ":" + woopassword);
var myHeaders = new Headers();
myHeaders.append('Content-Type', 'application/json');
myHeaders.append('Authorization', 'Basic ' + wooencodedData);
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
async function gigi() {
fetch("https://my-website.it/wp-json/wcfmmp/v1/orders/", requestOptions)
.then(response => response.json())
.then((data) => {return data})
.then((data) => {
var x = "";
for (i in data) {
if (data[i].status == "processing") {
x += '<div class="order-list">' + '<p class="col-md-4">' + data[i].id + " " + data[i].status + "</p>" + '<a style="" href="https://my-website.it/dashboard/orderslist/" target="popup">Vai agli ordini</a>' + " " + '</div>';
document.getElementById("orders").innerHTML = x;
console.log(data[i].date_created);
}}
})
};
setInterval(gigi, 2000);
</script>
I’m using WP Basic Auth and everything is working fine only if the requests comes from Postman. Tried to host this HTML page inside WordPress and outside.
Is there something I could do?
Thank you,
Marco.
PS: WooCommerce API works good with browser and postman but I need WCFM REST API.
]]>I have a question: I’m evaluating WCFM for a multi-vendor website for a client. Is it possible to change, by php editing, the store “sold-by” that is automatically shown in products archive?
You can see this here: https://ibb.co/ZH4gRm5
The vendor’s name is “Arianna di Maio” and is by default at the end of product infos. How to make it to appear before the item title?
Thank you!
]]>some of the methods I have used are referenced below
https://wedevs.com/support/topic/display-product-vendors-name/
https://nayemdevs.com/display-vendor-name/
https://stackoverflow.com/questions/43632297/how-to-show-store-name-on-the-product-thumbnail-in-dokan-multivendor-plugin-by-w
i have tried to add the code to “code snippets”, theme’s function.php, and child theme’s function.php
but it’s not working
I would appreciate any help..
Thank you
how can i set “sold by” field to appear as tab inside single product page. i don’t want it to appear on products grid (shop). when i disable “visible sold by” it gets disabled from single product page also.
How can it be fixed please?
]]>