I have many products nested within parent categories in WooCommerce.
I want to be able to apply a custom field where I can specify a time availability for categories as a admin feature only in Back end.
Theory:
Back end - On each parent category I will have this custom field where I can type or choose a time frame: for example 11:00-17:00.
Front end:
During this time frame, users will be able to browse all the products within that category.
Outside of this time frame all the products within that category will stay visible (but inactive) and they will be displayed greyed out or with a 'closed' banner (something like that).
Where can I start with this?
THE BEGINNING
You can start adding 2 plugins to add a custom time picker on product categories admin pages:
Advanced custom fields (ACF) plugin
Date & Time Picker for Advanced Custom Fields or also Date and Time Picker Field
This is just he beginning (and I can't confirm that is the best way). So In ACF you create a group and you name it:
Then you set the location (It's going to be a "taxonomy term" for "Product categories"):
Then In options you can chose it like a Metabox on the side (on backend):
After you add a new field and name it. You chose the field type and time only option:
[
Then now you are going to compile all the other options to fit your needs. Then you can save and add, if you need a 2nd field…
Now if you go to the WooCommerce Products Menu, under categories submenu, you will get this:
Now you can read a little the ACF documentation and also the wooThemes/woocommerce dev. documentation too.
You can customize WooCommerce overriding the templates and use hook filter and actions.
You will find in here on Stack OverFlow and over internet a lot of code, examples and tutorials, to begin and try to achieve your project. When needed you will post questions to get helped, with the code you are using telling what is working and what not…
Related
I am working on a woocommerce project with little bit knowledge on wordpress. Now, I have got a requirement which is shared below:
1. Show date calendar on product listing page top of list not in sidebar. I am saving product availiblity based on date ranges in separate table. This table has product id, date start and date end.
2. Show sizes dropdown on product listing on top of list. Sizes filter is already showing in sidebard but client wants it on top. So, I wil disable it in sidebar.
3. When customer will select date and size, product list should be filter accordingly.
I have read wordpress documentation where wc_query has option to use either "EXISTS or NOT Exists" through ws_meta_query. But I am not able to understand, how can I put filter on product query using either "EXISTS or NOT EXISTS" with my custom raw query?
Can someone please guide me how can I implement whole requirement along with how can I EXISTS using raw sql query with product query?
Thanks in Advance
For first 2 points, you'll need woocommerce_before_shop_loop action to display your custom filters.
and for 3rd point, you'll need pre_get_posts action to control your queries.
I am using the Storefront theme (downloaded a few days ago so newest version) and I want to do something quite simple:
on the archive-product page I want to display the product name of a list of variable products (all shoes) , along with two custom fields that I attached to the product post type.
All goes well with simple products. I can edit that which is shown through my theme-child folder/woocommerce/loop/price.php.
My issue appears as soon as I turn a product into a variable product. When I do that, the custom fields disappear, and all I see beneath the product is a button that says "select option"
I have been looking for hours to find the correct template/hook to fix this but I just cant find it...
I have no idea where to look :( Hope ome
I'm using Drupal Commerce and i have a product type called "Painting" this product type does not have an attribute fields, I'm using inline_entity_form module so i can show the product add form within the node add form for my product display content type.
The product in the site is the painting itself, it may come with a frame or without a frame (the user can choose) and the price will change based on the user's choice, how can i add such field without using attributes fields? as attributes fields requires that the site admin to add many products and put them in one product display, i just want to keep it simple to the site admin, to make him add the product in the same way he adds a node.
Thank you.
This sounds like you just need two variations:
Product one, without frame
Product two, with frame
Each variation has it's own price and title.
You can get by without using an attribute field. Drupal Commerce renders a dropdown when there are no attributes and allows user's to pick from the product variation titles. Since you are using Inline Entity Form this should be seamless for the site admin.
using last versions of wordpress, woocommerce and cheope (theme).
the question: how to
add some extra fields in variations form (text and image field types)
show them on frontend so that their values change accordingly on changing of attributes-select values.
e.g.: the site sells candles and uses variable products, for each kind of candle has several dimensions (with specific different prices), each of which has different duration.
The duration is an important element that I want the user to be informed about.
The same to show the available colors all together.
Unluckily in the standard variation form there is no field where I can insert these or other features.
some help please?
updated 07-August-2013
I succeeded in adding to variations form a new field displayed on back-end, as you can see here, by inserting the code you can find here (please see the comments too) in the function.php file of the theme.
Now, what I’m not able to do is get this field to display with each proper value on front-end (please take a look to the last comment in the above linked page).
Any tip or trick?
thanks
1)Add product attribute and check checkbox Used for variations and Visible on the product page
2)go to variations and add new and fill all fields price and stock must add on them
Your producr display variations and their data
I have created a content type Products.
Its having price, ratings ,and other fields. And whenever I add a content for this product type it gives me submission date for that product.
I have added 10 contents for this content type and created a view which displays all the products in a list. now i want to give a filter for "Price, Date and Ratings".
E.g, if I select price then it should sort the view list of product from lowest price to highest price value.
Any module is available to achieve this?? or any other procedure which can make this happen for product filter.
I have used Better Exposed Filters module in drupal for the same requirement. And i feel it will be very useful for you.
Just install the module from this link:
http://drupal.org/project/better_exposed_filters
Enable the module. and Go to view(Create a new view and add your fields. For e.g, Price,Ratings,Date according your requirement. Else if you have already created a view then use the same and edit it.)
Click on Exposed form(In Advance) and select "Better Exposed Filters ".
Now select the filters you want in Sort Criteria(For e.g, Price,Ratings,Date).
Click on Use AJAX and select "yes"(Mandatory field).
Click on Save and Enjoy Your View with the Filter.
Hope this will be useful.
If you edit the view and add a sort criteria for your field price there should be an option to expose it (tick box).
If you tick "Expose this sort to visitors, to allow them to change it" the sort filter will appear at the top of the view.