What's the best the approach to add an extra attribute field in Drupal Commerce? - drupal

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.

Related

How can I build WooCommerce products collections?

I want to build products collections similar to AliExpress,Amazon, Etsy and other collections.
I can suggest you three ways:
You could create new taxonomy called collections, each term would be a collection. You can extend it for your needs by adding custom fields to collection taxonomy terms i.e. image, relations with specific brands ( which also can be created as taxonomy ).
To make final render adjustments, you will have to override archive.php template for your collection taxonomy - i.e. taxonomy-collection.php or taxonomy-collections.php ( depending on slug you choose to use )
You could create new custom post type collections, and then create for product post type additional custom field, that would list in dropdown ( multiselect ) or multiple checkboxes all collections.
You will then need to override single.php template for single custom post type view, i.e. single-collection.php
See: https://developer.wordpress.org/themes/basics/template-hierarchy/ for templates reference.
You could find and install some plugin ( there is a decent number of such ) that offer extending WooCommerce in terms of having brands and collections attached.
I would suggest first approach, or second if you are decent in WordPress and WooCommerce development. Third is at first easiest, but usually lacks of flexibility and customization, since it is not your code.
Wouldn't Grouped products work for you (or anyone searching here)?
https://docs.woocommerce.com/document/managing-products/#section-12
Go to: WooCommerce > Products > Add New.
Enter a Title for the Grouped product, e.g., Back to School set
Scroll down to Product Data and select Grouped from the dropdown. The price and several other fields disappear. This is normal because a
Grouped Product is a collection of ‘child products’, which is where
you add this information.
Publish.
The Grouped product is still an empty group. To this Grouped product,
you need to:
-Create products and add them
-Add existing child products
If you are looking to make collections like those in shopify, for example, grouping products by attributes, or a certain word contained in the title. There is a plugin called WooCommerce Collection by WooExperts. Unfortunately it is a paid plugin. I will give the link below to avoid confusion with another plugin called WooCommerce Collections.
I am not in anyway affiliated to them, I simply use it and it solved this issue for me.
Here is the link: https://wooexperts.com/plugins/woocommerce-collection/

BIGCOMMERCE - Add required field based on quantity

I am designing a T-shirt store for a client and need to be able to add custom fields to a BigCommerce product based on the user requesting more than one product (tshirt)
So - if the user has 2 products - they would be asked to complete fields for reverse name and size. Is this possible?
There aren't conditional options out of the box in Bigcommerce. You'd have to have unrequired fields that were hidden unless multiple quantities were selected (using javascript to accomplish the hide/show).
Alternatively, you can limit the item so only one can be added to the cart at a time. This could be a negative customer experience though.

How to allow uploading of photos while placing an order using Woocommerce

I'm new to WordPress, and want to use Woocommerce for my online shop. However, I am creating things using photos supplied by the customer for certain products. Other products can be sold as is.
That means if the customer orders an item in this category, he needs to upload the photo to be used to create that item while placing his order. This photo must be linked to the order, and must not be visible to the other customers, but only to me when I view his order.
Is there any existing WordPress theme that caters for this, and if not, how do I modify Woocommerce to cater for this?
More than one customer can order the same product, and each customer must be able to upload his photo to be used for that product for that order. Each client's photo must only be linked to that specific order for that specific customer for that specific date.
You can use Woothemes's Product Add-ons plugin. It allows you to add custom fields to your product including file-inputs. These fields will be displayed on the front-end & user can fill their values/upload files which will be included with their orders. And as an admin, only you will be able to see the values/files in the order-details section.
You required to add image with each product, which should not be display to your customer, only to you while some order placed by customer:
In this case you required to add custom field over there in Product Custom Post type.
You can refer to this link for creating Custom Field
http://wp-types.com/learn/create-an-ecommerce-wordpress-site/create-custom-fields-and-taxonomies/

woocommerce: how to add new fields to variations form and show them on frontend

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

Filtering my products on drupal commerce

I have imported 5.000 to my drupal-commerce website.I want the user to be able to navigate fast on all of these products,so I just figured out that I need to make somehow a filter or a search that when the user chooses/selects some of the features of the product the result will be only the products with these features.How can I manage to do this on Drupal 7 and Drupal Commerce(Commerce kickstart?)
The short answer is that you'll probably want to use the Views module. You can create a Views page display for your main products page that loads the Commerce product displays. Since the product displays don't actually contain the field values that you'd want to filter (they're on the referenced products), you'll need to add a Relationship to the products. That'll let you add filter criteria for product fields (exposing them will make them visible to the user). If you want the exposed filters to appear in a sidebar, use the "Exposed form in block" option on the Views display to create a filter block that you can add to your sidebar region on Administration » Structure » Blocks (/admin/structure/block).
Most people who have used Views over the years are used to outputting the Views result using Fields and then customizing the display of the fields with template files or extensive configuration, etc. However, you can create a custom view mode for your product display content types and give them layout with Display Suite. You can output those custom displays in Views using the Content Format.

Resources