Add formula calculation gravityforms - wordpress

I helping a friend of mine to create a calculation formula in gravityforms and Woocommerce.
He whant to add:
number of prints: 1-24, 25-49
And number of prints color: 1, 2
based on the Quantity the prints color have differents prices.
ex:
prints 1-24, color 1 = 22,50 Skr
Prints 25-49, color 2 = 17,50 Skr
in my form now i have, product name, number of prints ( where i type the number of prints ), number of prints color ( dropdown ), And total.
But i donĀ“t now how i add the calculation formula.
Hope some one can help us.

I try not to post links to my products here unless I can provide a free alternative as well... but in this case, I do not know of a simple or free way to accomplish this without the use of my GP Conditional Pricing add-on for Gravity Forms. It supports tiered pricing (also known as bulk discounts) as you've described here. You'll need a copy of Gravity Perks to download this add-on.

Related

Customize function Variation product in Woocommerce

I have a project in wordpress and I am using woocommerce.
I have 3 attributes for each product and some variation. Look like this:
Now is mandatory to choose at least 1 variation for each attribute in order to get a price.
I wonder if its possible to get out a price from a first choice so I dont need to be forced to select the second and third attribute.
In my case I would like to get a 25 euro price if I select "digital".
So in some way "hide" or obfuscate all the other choices when "digital" is selected.
I found this plugin: "Simple linked variations for WooCommerce". but this just hide 1 variation based on one attribute and it does not show the price either.
I guess there must be something in the code that show the price ONLY if all 3 attributes are selected. And can hide/obfuscade another attribute (or give value 0).... ?
I solved it using product add-ons" instead of variations.
https://woocommerce.com/products/product-add-ons/
This extension lets you create various add-ons for a product, and you can set up conditions like the one I describe.

WooCommerce stock per attribute

I have a technical problem with the WooCommerce plugin that I can't seem to find an answer for.
I got a variable product that has two different times for workshops.
So an example to simplify:
Product: Event day ticket
Workshop 1: Red | Blue | Green
Workshop 2: Red | Blue | green
On workshop 1, every attribute needs to have 5 stock but on workshop 2 every attribute needs to have 10 stock.
I can make combination variables but if I do that, every combination has it's own stock. Not the attribute itself.
Any idea on how to work with issue?
I hope I explained it well enough.
I ran into something similar and the answer is a Variable Product with addons (one option is WooCommerce's own plugin # https://woocommerce.com/products/product-add-ons/). You'd create Workshop as a variable attribute, then create product variations and set each Workshop's total number of tickets in the variations. Then create product addons for Red, Blue, and Green (you can set the cost of addons to any value including 0). That should give you the result you're seeking.
Attributes define available "options" (like colors as you have it) but you need to set the product to be a variable product (the default is simple product) using the dropdown at the top of that configuration section. Then, on the attributes section, check the box to use the attributes as variations. Finally, on the variations tab, create the variations from attributes.
Now, you can set stock levels, prices, and more for each variation of the product where a variation is a single or combination of attributes.
Note: You may need to go into the Woocommerce settings and check the box to manage inventory at the variation level. This is from memory so I don't recall if it's in the Woocommerce settings or an option when you switch the product to variable.

Drupal Commerce Products for printing company

I'm new to Commerce I hope some kind fellow could give me some directions here.
I am creating an ecommerce website for a printing company. I will give an example of what I require
For instance they will offer A6 flyers but these come in different specifications each with differing prices
Here is an example:
http://4frontdesigns.co.uk/Untitled-1.jpg
So down the left column are quantities of flyers and along thw top different speciifications of those flyers with the prices shown in the middle.
Any help much appreciated
Can I just add each variation of these one by one as it is not possible to just say that a certain additional attribute to the product will add so much $$ to the base price.
Would I just add each variation one by one then some how pull these all into one display?
You could use the commerce price table module like Flo suggested or look at the Price attributes Module https://www.drupal.org/project/commerce_pricing_attributes
It uses option sets and then add to (or subtract from) the price based on the selected attribute.
The answer for me was to create each product variation as its own product. So every variation gets added as a separate product.
If you are wondering how to add different variations to product such as paper size or colour, you would do this with taxonomy. Simply create a taxonomy term called colour and then add all the colours into this term that you would require.
Then when you create your product type in commerce, you would add this as an option to choose from when adding products by doing the following. Go to manange fields for the product type you want to add it for and add a new field, type of data = term reference. You will then select the desired taxonomy term and also there will be an option to 'Enable this field to function as an attribute field on Add to Cart forms.' - You want to select this!
Then what you do is create a product display and pull all these in to a single page, which then gives you drop down options to change, and the price changes accordingly in real time.
You can create a product display by creating a new content type first, call it product display... Then add a field to this content type which is a 'product reference'.
Now add new content, pick to create a product display (what we have just created) and choose the products that you want to appear on that page.
Then automatically Drupal Commerce will take care of the rest. Hope this helps someone!

Making the +/- Plus and Minus quantity button go up in increments of 12 in WooCommerce

I have been trying to solve what I thought might be an easy fix but I can't seem to find any information anywhere.
My problem is this:
I am setting up a wholesale store using WooCommerce with the min/max quantity and wholesale store plugins. I want to show a simple product with its single unit price (no problem) but as all products in the store are wholesale they can only be sold in (multiples) cartons of 6 or 12.
The min/max plugin allows me to set a minimum order quantity (say 12 items) but when I click on the -/+ Minus and Plus quantity selector to add another carton (another 12 items) it only adds one number (single item) at a time... E.g. 13, 14, 15, 16 and so on.
So my question is... "Is it possible to modify the 'quantity.php' file so the order quantities only go up in increments of 12?" (E.g. 12, 24, 36, 48, etc.)
I know I could simply set up and show the single carton cost as a simple product or do variables but my client wants to show a per unit price.
Thanks in advance for any feedback you may have.
There's no need to change core, nor even to use WooCommerce's template override. As Rashid points out, there is a filter in place for modifying this value. We just need to use it. Put this in a site-specific plugin.
add_filter( 'woocommerce_quantity_input_step', 'kia_quantity_input_step', 10, 2 );
function kia_quantity_input_step( $step, $product ){
return 6; // the will be the new step value
}
I'm sure you've moved on by now, but for posterity's sake this plug in might do what you are looking for:
http://www.woothemes.com/products/minmax-quantities/
I wanted similar functionality for my cart section which I achieved like this.
In the woocommerce template file forlders navigate to cart->cart.php file then search for something like this
apply_filters( 'woocommerce_quantity_input_step', '1', $_product );
Then change '1' to '12'. I believe it should be similar if you want to change on single product page.
This is quite hard to do without any hackery. If you don't mind changing a core file (which you will have to do again each time you update WooCommerce), you can do the following:
open wp-content/plugins/woocommerce/assets/js/frontend/woocommerce.js
go to line 34 "$qty.val(currentVal + 1);" and change '1' into '12'.
do the same for the minus function on line 52
note that this affects ALL products!

Setting UberCart stock levels on content creation?

Currently if you create a product in UberCart, you have to first create the product before accessing the stock tab to set stock levels. I want to be able to set the stock levels when I create the product. I.e. Right below where I set the "list price". How would I do this?
Well, that's going to involve a little work.
You're going to have to create a hook_form_alter implementation to add the new form fields to the node_add/node_edit form.
You're going to want to add a hook_nodeapi() implementation for $op=='validate' to make sure you're getting valid information.
You're then going to want to extend that hook_nodeapi() implementation for $op=='insert' and 'update' to grab the field value (which should be stuck to the $node object) and write it to the stock levels table, whose name I'm too lazy to look up right now.
Alternately, instead of 2 and 3, you could mess around with creating a validation and submit function, and append them to the #validate and #submit arrays of the form.
For people looking for a module-based solution to this problem in Drupal 7, the latest dev version of the "Ubercart Product Power Tools" module has an excellent per-product setting to make stock-tracking active on creation, as well as set default stock quantity and threshold for the product.
Ubercart Product Power Tools

Resources