Hello,

I'm sorry if the answer to this is posted elsewhere, but I've searched for hours now to no avail. I'm currently using Drupal Commerce Kickstart to build a website for my client. This client prints business cards, and needs a website that will allow customers to order online. The smallest order they print would be 500 business cards, the typical order would be 1000.

I'm currently trying to figure out a way to change the quantity options. For example: A dropdown that offers the options of 500, 1000, 2000, 3000, 4000, 5000 and 10,000.

I've thought about creating a new line item, then configuring pricing rules to achieve this; however, it seems like there should be an easier way.

Thanks for your help,
Kyle

Comments

kloy23’s picture

Issue summary: View changes
pixelsweatshop’s picture

Status: Active » Closed (fixed)

Support requests better posted in the forums next time. The core issue queue is for issues related directly to core.

To point you in the right direction, you are probably going to add a field type of select list that identifies the preset quantities to your custom product type, then use rules to modify the commerce quantity field when a user adds it to cart. See the following tutorial. It is for donations but the concept is similar. https://commerceguys.com/blog/using-custom-line-items-provide-donation-f...

kloy23’s picture

Nicoz,

I did not realize that I had posted this as a drupal core support request, I thought I had posted this as a Drupal Commerce support request. My apologies.

Thank your for the link, and your time.

kloy23’s picture

Project: Drupal core » Commerce Kickstart
Version: 7.34 » 7.x-2.x-dev
Component: other » Code
Status: Closed (fixed) » Active

Changed "Project" to Commerce Kickstart. Still having some issues figuring out how to customize the quantity field.

kloy23’s picture

Well, I now have a working solution, but could use some advise. I've created a "Quantity" line item and added my desired quantity amounts (ie: 500, 1000, 2000, 3000, 4000, 5000, and 10,000).

I'm able to successfully create a rule that checks if the "Entity has field" "Parameter: Entity: [commerce-line-item], Field: field_quantity"
and performs the action "Set the unit price to a specific amount"; however, in order to change the price depending on which quantity was selected I had to add a data comparison.

The problem I'm having with this set up is that I had to create a new pricing rule for each quantity selection.

Is there any way to combine these rules? Or will the system work fine with the separate rules?

Thank you,
Kyle

kloy23’s picture

Status: Active » Closed (fixed)