How can I disable some fields in woocommerce edit product page for certain products? - function

I have some SKU's which I don't want accidentally someone from the staff, to add wholesale pricing and become available to wholesale customers. For that I want to create a function that checks if the product being edited belongs to the restricted SKU's and disable those fields in the screenshot, but just for these products only.
The plugin that produces these fields is called wholesale suite.
Screenshot of the fields I need to disable
How can I check for these sku's and how to target and disable those fields?
I would appreciate any help thanks in advance!

Related

Access query combo box source based on individual record

my database has MachineT, ProductT and ProductionT.
each product can be made only in some specific machines (multivalue field).
when planning production I need the dropdown menu to show only the possible machines for that product in a form containing a datasheet view.
In the actual database the ProductionF has a data picker and the subform is based on ProductionQ only for that day and it is important to keep the datasheet view because the planner is adding dozens of records in one sitting.
thank you
*edit - I tried to force the field in ProductionT via lookup but it does not filter for each record.
[If you only have 4 machines], what if in ProductT, rather than just one Machine ID, you have fields M1,M2,M3,M4 as a Yes/No (checkbox) selection, then you can make your combo box where fields = True
or maybe this link can help you http://allenbrowne.com/func-concat.html
Edit
What if you have a new table called something like "Product_machine_combo" and this is where you can combine the relationship between the product and the machine used. You could use a list box that lists the Products and have a ListBox for the machines (kind of shown below; link to this resource: https://www.iaccessworld.com/add-items-textbox-listbox/). I just don't know how it would show up in the table. Or you could add a list box to the product form itself?

MS Access: How to search a value on a table by clicking on a form record

I'm pretty new to Access and coding in general and I've been working on a database that was filled with data extracted from SAP.
I have a query that works as a way to "summarize" the information of a bunch of records from some purchase orders, it does sum the total of each PO, it's date as well as other information. It does consolidate a variety of items related to the purchase order into a single record that is displayed in a continuous subform for easy analysis in this structure.
[MES_CORTE][SOLPED][PO][FirstMIGO][TOTALPOVALUE]
This way, the user can preview easily each purchase order, date, value and other relevant information. This query is also used to generate some reports.
However, I want to be able of opening the source table ([Registro_OC]) and search the related records by clicking a field on the subform for a detailed view and posibly to edit or enter new data. is it posible?
I've tried to code some macros but can't figure out how to reference the table fields related to the query fields that are on the form.
Also, it seems that Access doesn't allow to create subforms based on continous forms.
Any help and opinions are appreciated.

Merge two fields before posting to MySQL

Any help and/or direction you can give me will be greatly appreciated.
My site has drupal 7 installed and a bunch of plug-ins. I am using a third party web hosting site.
On my website, I have a webform that submits a several member info. When this information is submitted, it gets submitted into, what appears to me, as a default form submission data table on mysql. I guess I have a two part question.
First, I would like my webform to be submitted in a custom table so that webform, contacts and etc have their own database table.
Secondly, I would like to merge two columns together to form a unique user email on my site. For instance, in my webform, the first field is a 'State' dropdown list where the user has to choose the state they are in. And the second field, they have to type in a user specific info. So when they choose the state and fill in their unique user info, I would like to combine these two columns to create an email address, e.g. unique_user_info#fl.mysite.com.
oh, btw, I put the values in state dropdown to add state-specific info. in other words, if the member chooses 'Florida' then it adds, #fl.mysite.com and chooses 'California', it adds #ca.mysite.com
Once again, your help on this will be greatly appreciated.
With the Webform Rules and Rules modules (may require Tokens module), you may be able to concatenate the two field values for storage in your email field when the form is sumbitted.
Or, you might write a jQuery function to handle concatenation and fill of a hidden email field on the clientside.

Best way to create a form that changes and gets information from multiple tables and queries

I've been pondering this for a couple of days now, i have a relatively large database with multiple tables, and my goal is to be able to administrate this with a MS-Access application. This is the workflow that i want to achieve:
1. Choose a category of products
2. Choose a specific price list.
3. This lists all products of that category in this price list.
4. Choose an item in the list a
5. this triggers an update in a subform and fetches the data related to the choosen row
6. Choose the price in the subform for that specific type.
This problem triggers some newbie questions:
1. How do i trigger an update in a datasheet from a drop down list, so that the datasheet only fetches products related to that category?
2. How do i make a subform trigger yet another subform to update?
And third but not least
3. Is there any good tutorials or other study material out there?
If theres anything that is unclear please tell me and i will try to clarify the questions, english is not my native language. :)
Access will do a lot without any code at all. For example, if your categories are listed in a listbox, that can be made to cascade to a second list box that shows only relevant price lists. Subforms have link child and link master fields that can refer to fields (columns) or controls. You can have a subset of records in the subform where the link master field(s) are the listbox(es) and the link child field(s) are the relevant related field(s). You can also refer to subform controls in link child and master fields.
You might like to look at the Northwind sample database that ships with all versions of Access, in particular, the Customer Order form.

Access form, search for a record from another table and insert into field in current form

I have a table that stores invoices and a form based off of that table that looks like an invoice so that you can search previous invoices. Currently I am creating the invoices in excel and then exporting the data as a new record into the Invoice table. I was wondering if there was a way I could create the invoices from my Invoice form. I have a table of all of the products and prices we carry that would used for the invoice.
Is there a way to put a search button on the invoice form that would search for a record or "product" in the product table and insert it into the fields of a new invoice?
I have looked a some code to connect to the products table and insert it into fields in the invoice form, but how do I search as well?
Any thought or ideas? Any help would be much appreciated!!
Handling this through VBA and control events is typically the best choice:
Use an unbound text box in your form as your search input field. This will allow the user to input some text into a box and hit enter, or click some related "GO" button if you choose to perform some sort of search.
Set the `OnChange` property of this text box control to the name of the macro or method you designed to handle this event (or click event property if you've instead set up a button to a) check the textbox value; and b) handle it; typically allowing for both the user pressing enter or clicking the button to perform this action). You may also simply call an `inputbox` from some button click event to pop up a prompt to allow the user to enter the product value to search for.
Within your handling script, use DLookup() to use that user-supplied value against your products table to get some meaningful product value back which you can then place anywhere on your form.
Also, although I'm not familiar with your particular setup, it seems as though you should ditch your excel file and go with a direct user interfacing MS Access input form. You may find it always easier to deal with user input directly rather than indirectly through oustide files. That way, you have better control over user input validation and user feedback vs fearing whatever the Excel client feels like putting in those spreadsheets.
Not sure this is the right design. Do you only invoice one product at a time?
Also, it doesn't sound as if you are thinking in terms of primary keys.
Nor does it sound as if you thinking "relationally".
Let me clarify. In most invoicing systems, there is usually an Invoices table, then an InvoiceItems table. The relationship between the invoice items and the invoice would be one invoice to (potentially but not necessarily) many items.
Then you have your Products table. The relationship between the Products and InvoiceItems is one product to many InvoiceItems. Ie, you can sell a given product to many different customers.
So we have:
Invoices --> InvoiceItems
Products --> InvoiceItems
Now you need to implement this in your forms.
Matching your tables and their relationships, you create an InvoiceForm and you create an InvoiceItemsSubForm. The InvoiceItemsSubForm, to hold many items, is a continuous form.
In the InvoiceItemsSubForm, you will have a field that takes the Primary Key of the Product (along with other fields such as date, number of products purchased, etc).
To search for your products, you can have a combo box that has the ProductId and ProductName fields. This combo box serves two purposes: it allows you to search for your products, and it allows you to input the product you want in your InvoiceItem record.
If I have misunderstood your question, my apologies. If I haven't misunderstood your question, you have a lot to learn...